当前位置:网站首页>Paging collections using streams
Paging collections using streams
2022-07-23 13:10:00 【Withered maple leaf】
/ Common cases of too much set data , If you cycle or process directly , The server may not be able to stand it , Now , We can batch the total data set , Then the batch data is processed in a single batch , So as to improve the performance of the server
// Paging the collection
Integer pageSize = 10;
List<List> trackPointCollect = IntStream.range(0, (trackPointList.size() + pageSize - 1) / pageSize)
.map(pageNum -> pageNum * pageSize)
.parallel()
.mapToObj(i -> trackPointList.stream().skip(i).limit(pageSize).collect(Collectors.toList()))
.collect(Collectors.toList());
边栏推荐
猜你喜欢
随机推荐
记录一次爬虫题库
融e学答案脚本制作(2020最新)
将集合使用流进行分页
4D天线阵列布局设计
OpenVPN deployment
Square root cube root
Intégrité du signal (si) intégrité de l'alimentation électrique (PI) notes d'apprentissage (32) Réseau de distribution d'énergie (4)
yum安装LNMP服务部署
虚拟内存技术的来龙去脉(上)
写一个可执行文件依赖.so的测试用例
0 dynamic programming leetcode918. Maximum sum of circular subarrays
数据进行脱敏
HCIA----06 OSPF
C#输入一个字母,判断其大小写
OSPF single area configuration instance learning record
Install LNMP service deployment using yum
Sword finger offer summary
ACL access control experiment
VLAN configuration instance learning record
HCIA----04 路由静态扩展、VLAN









