public abstract class SlidingPreReducer<T> extends WindowBuffer<T> implements PreAggregator
| Modifier and Type | Field and Description |
|---|---|
protected T |
currentReduced |
protected LinkedList<Integer> |
elementsPerPreAggregate |
protected int |
elementsSinceLastPreAggregate |
protected LinkedList<T> |
reduced |
protected org.apache.flink.api.common.functions.ReduceFunction<T> |
reducer |
protected org.apache.flink.api.common.typeutils.TypeSerializer<T> |
serializer |
protected int |
toRemove |
emitEmpty, emitPerGroup, nextID, sequentialID| Constructor and Description |
|---|
SlidingPreReducer(org.apache.flink.api.common.functions.ReduceFunction<T> reducer,
org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCurrentToBuffer(T element) |
boolean |
addFinalAggregate(StreamWindow<T> currentWindow) |
protected void |
addToBufferIfEligible(T element) |
protected void |
afterEmit() |
protected void |
afterStore() |
abstract SlidingPreReducer<T> |
clone() |
protected abstract boolean |
currentEligible(T next) |
protected boolean |
currentNotEmpty() |
void |
emitWindow(org.apache.flink.util.Collector<StreamWindow<T>> collector) |
void |
evict(int n) |
static int |
max(int a,
int b) |
protected void |
removeLastReduced() |
protected void |
resetCurrent() |
void |
store(T element) |
String |
toString() |
protected void |
updateCurrent(T element) |
createEmptyWindow, emitEmpty, sequentialIDprotected org.apache.flink.api.common.functions.ReduceFunction<T> reducer
protected T currentReduced
protected LinkedList<T> reduced
protected LinkedList<Integer> elementsPerPreAggregate
protected org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer
protected int toRemove
protected int elementsSinceLastPreAggregate
public void emitWindow(org.apache.flink.util.Collector<StreamWindow<T>> collector)
emitWindow in class WindowBuffer<T>protected void afterEmit()
public boolean addFinalAggregate(StreamWindow<T> currentWindow) throws Exception
Exceptionpublic void store(T element) throws Exception
store in class WindowBuffer<T>Exceptionprotected void afterStore()
protected void addToBufferIfEligible(T element) throws Exception
Exceptionprotected void resetCurrent()
protected boolean currentNotEmpty()
protected abstract boolean currentEligible(T next)
public void evict(int n)
evict in class WindowBuffer<T>protected void removeLastReduced()
public static int max(int a,
int b)
public abstract SlidingPreReducer<T> clone()
clone in class WindowBuffer<T>Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.