当前位置:网站首页>Powerful tool for collection processing
Powerful tool for collection processing
2022-07-05 18:39:00 【InfoQ】
Why Stream
Stream Detailed explanation

- Intermediate operation
- No state : It means that the element is not affected by the previous element , There is no association between elements
- A stateful : Stateful intermediate operations must wait until all elements are processed before the final result is known
- Termination operation
- Short circuit operation : You can return results without processing all the elements
- Non short circuit operation : All elements must be processed to get the final result
Stream principle
- How to record user actions
- How operations stack
- How to perform the superimposed operation
How the operation records


How operations stack
- First begin() The method tells Slink The number of elements participating in the operation , It is convenient to determine the size of the intermediate result container
- After through accept() Method to add elements to the intermediate results , At the end of execution, the caller will call the method continuously , Until you go through all the elements
- Last end() The method tells Slink All elements are traversed , Start the corresponding operation steps , After the operation is completed, the result is passed to the downstream Slink
- If the downstream Slink Time short circuit operation , Ask constantly when passing the results to the downstream cancellationrequested() Whether the processing can be ended
How to execute the operation after stacking
Sink AbstractPipeline.opWrapSink(int flags, Sink downstream)
边栏推荐
- Tupu software digital twin | visual management system based on BIM Technology
- Is it complicated to open an account? Is online account opening safe?
- 2022最新Android面试笔试,一个安卓程序员的面试心得
- @Extension、@SPI注解原理
- 【在优麒麟上使用Electron开发桌面应】
- websocket 工具的使用
- Nacos distributed transactions Seata * * install JDK on Linux, mysql5.7 start Nacos configure ideal call interface coordination (nanny level detail tutorial)
- sample_rate(采樣率),sample(采樣),duration(時長)是什麼關系
- Electron安装问题
- About statistical power
猜你喜欢
Reading notes of Clickhouse principle analysis and Application Practice (5)
《力扣刷题计划》复制带随机指针的链表
Tupu software digital twin | visual management system based on BIM Technology
使用JMeter录制脚本并调试
buuctf-pwn write-ups (9)
AI Open2022|基于异质信息网络的推荐系统综述:概念,方法,应用与资源
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD
Copy the linked list with random pointer in the "Li Kou brush question plan"
buuctf-pwn write-ups (9)
Record eval() and no in pytoch_ grad()
随机推荐
深入底层C源码讲透Redis核心设计原理
技术分享 | 常见接口协议解析
【在優麒麟上使用Electron開發桌面應】
Logical words in Articles
Use of websocket tool
RPC协议详解
Memory leak of viewpager + recyclerview
Use of print function in MATLAB
Sibling components carry out value transfer (there is a sequence displayed)
使用JMeter录制脚本并调试
Linear table - abstract data type
LeetCode 6111. 螺旋矩阵 IV
Notes on common management commands of openshift
ViewPager + RecyclerView的内存泄漏
Maximum artificial island [how to make all nodes of a connected component record the total number of nodes? + number the connected component]
音视频包的pts,dts,duration的由来.
English sentence pattern reference
Nacos distributed transactions Seata * * install JDK on Linux, mysql5.7 start Nacos configure ideal call interface coordination (nanny level detail tutorial)
Is it complicated to open an account? Is online account opening safe?
Fix vulnerability - mysql, ES