当前位置:网站首页>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());
边栏推荐
- VLAN configuration instance learning record
- ACL access control experiment
- Harbor deployment
- Query the cross compiled executable dependency Library
- 三层交换配置实例学习记录
- Eth trunk configuration instance learning record
- 迷茫、工作没动力? 职业发展没希望? 看这篇文章就够了
- C # enter a letter and judge its case
- Numpy:基本操作快速入门
- TI单芯片毫米波雷达xWR1642硬件架构研究
猜你喜欢

Pod topology constraints

Query the cross compiled executable dependency Library

Intégrité du signal (si) intégrité de l'alimentation électrique (PI) notes d'apprentissage (32) Réseau de distribution d'énergie (4)

使用vscode进行远程编辑和调试

C语言-大端存储和小端存储

查询交叉编译出的可执行文件依赖库

根据不同时间统计不同类型的数据(存储过程)

Confused, work without motivation? Career development hopeless? It's enough to read this article

Numpy:基本操作快速入门

DHCP configuration instance learning record
随机推荐
ACL 配置实例学习记录
0 shortest path problem leetcode743. Network delay time
[offline voice topic ④] Anxin VC offline voice development board secondary development voice control LED light
时间复杂度总结(Ο是渐进上界,Ω是渐进下界,p,np,np-hard,NPC问题)
C # enter a letter and judge its case
2020-09-22
Three layer switching configuration example learning record
SAR成像之点目标仿真(一)—— 数学模型
linx的链接、一级目录、重定向、cp与mv
User and group management, file permissions
2020-09-20
课程设计-推箱子C#(win form)
PostgreSQL k8s deployment template
Harbor deployment
PPP configuration instance learning record
Ronge answer script production (latest in 2020)
机器学习:李航-统计学习方法(二)感知机+代码实现(原始+对偶形式)
力扣 729. 我的日程安排表 I
Leetcode problem solution summary
OSPF 单区域配置实例学习记录