Package org.apache.wayang.java.operators
Class JavaObjectFileSink.StreamChunker
- java.lang.Object
-
- org.apache.wayang.java.operators.JavaObjectFileSink.StreamChunker
-
- Enclosing class:
- JavaObjectFileSink<T>
public static class JavaObjectFileSink.StreamChunker extends java.lang.Object
Utility to chunk aStream
into portions of fixed size.
-
-
Constructor Summary
Constructors Constructor Description StreamChunker(int chunkSize, java.util.function.BiConsumer<java.lang.Object[],java.lang.Integer> action)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fire()
Apply the specifiedaction
to the current chunk and prepare for a new chunk.void
push(java.lang.Object obj)
Add a new element to the current chunk.
-
-
-
Method Detail
-
push
public void push(java.lang.Object obj)
Add a new element to the current chunk. Fire, if the chunk is complete.
-
fire
public void fire()
Apply the specifiedaction
to the current chunk and prepare for a new chunk.
-
-