T - The type of elements that this WindowBuffer can store.@Internal public class ReducingWindowBuffer<T> extends Object implements WindowBuffer<T,T>
WindowBuffer that stores elements on the Java Heap. This buffer uses a
ReduceFunction to incrementally aggregate elements that are added to the buffer.| Modifier and Type | Class and Description |
|---|---|
static class |
ReducingWindowBuffer.Factory<T> |
| Modifier | Constructor and Description |
|---|---|
protected |
ReducingWindowBuffer(org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction,
StreamRecord<T> data,
org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer) |
protected |
ReducingWindowBuffer(org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction,
org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<StreamRecord<T>> |
getElements()
Returns all elements that are currently in the buffer.
|
Iterable<T> |
getUnpackedElements()
Returns all elements that are currently in the buffer.
|
int |
size()
Returns the number of elements that are currently in the buffer.
|
void |
snapshot(org.apache.flink.core.memory.DataOutputView out)
Writes the contents of the window buffer to a
DataOutputView for checkpointing. |
void |
storeElement(StreamRecord<T> element)
Adds the element to the buffer.
|
protected ReducingWindowBuffer(org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
protected ReducingWindowBuffer(org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, StreamRecord<T> data, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
public void storeElement(StreamRecord<T> element) throws Exception
WindowBufferstoreElement in interface WindowBuffer<T,T>element - The element to add.Exceptionpublic Iterable<StreamRecord<T>> getElements()
WindowBuffergetElements in interface WindowBuffer<T,T>public Iterable<T> getUnpackedElements()
WindowBufferStreamRecord.getUnpackedElements in interface WindowBuffer<T,T>public int size()
WindowBuffersize in interface WindowBuffer<T,T>public void snapshot(org.apache.flink.core.memory.DataOutputView out)
throws IOException
WindowBufferDataOutputView for checkpointing.snapshot in interface WindowBuffer<T,T>IOExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.