T
- The type of elements that this WindowBuffer
can store.@Internal public class ListWindowBuffer<T> extends Object implements EvictingWindowBuffer<T,T>
EvictingWindowBuffer
that stores elements on the Java Heap.Modifier and Type | Class and Description |
---|---|
static class |
ListWindowBuffer.Factory<T> |
Modifier | Constructor and Description |
---|---|
protected |
ListWindowBuffer(ArrayDeque<StreamRecord<T>> elements,
TypeSerializer<T> serializer) |
protected |
ListWindowBuffer(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.
|
void |
removeElements(int count)
Removes the given number of elements, starting from the beginning.
|
int |
size()
Returns the number of elements that are currently in the buffer.
|
void |
snapshot(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 ListWindowBuffer(TypeSerializer<T> serializer)
protected ListWindowBuffer(ArrayDeque<StreamRecord<T>> elements, TypeSerializer<T> serializer)
public void storeElement(StreamRecord<T> element)
WindowBuffer
storeElement
in interface WindowBuffer<T,T>
element
- The element to add.public void removeElements(int count)
EvictingWindowBuffer
removeElements
in interface EvictingWindowBuffer<T,T>
count
- The number of elements to remove.public Iterable<StreamRecord<T>> getElements()
WindowBuffer
getElements
in interface WindowBuffer<T,T>
public Iterable<T> getUnpackedElements()
WindowBuffer
StreamRecord
.getUnpackedElements
in interface WindowBuffer<T,T>
public int size()
WindowBuffer
size
in interface WindowBuffer<T,T>
public void snapshot(DataOutputView out) throws IOException
WindowBuffer
DataOutputView
for checkpointing.snapshot
in interface WindowBuffer<T,T>
IOException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.