K
- The type of key returned by the KeySelector
.IN
- The type of the incoming elements.OUT
- The type of elements emitted by the InternalWindowFunction
.W
- The type of Window
that the WindowAssigner
assigns.@Internal public class EvictingWindowOperator<K,IN,OUT,W extends Window> extends WindowOperator<K,IN,Iterable<IN>,OUT,W>
WindowOperator
that also allows an Evictor
to be used.
The Evictor
is used to evict elements from panes before processing a window and after
a Trigger
has fired.
WindowOperator.Context, WindowOperator.Timer<K,W extends Window>
AbstractStreamOperator.CountingOutput
allowedLateness, context, currentWatermark, inputSerializer, keySelector, keySerializer, mergingWindowsByKey, processingTimeTimerFutures, processingTimeTimers, processingTimeTimersQueue, processingTimeTimerTimestamps, timestampedCollector, trigger, watermarkTimers, watermarkTimersQueue, windowAssigner, windowAssignerContext, windowSerializer
userFunction
chainingStrategy, LOG, metrics, output
Constructor and Description |
---|
EvictingWindowOperator(WindowAssigner<? super IN,W> windowAssigner,
TypeSerializer<W> windowSerializer,
KeySelector<IN,K> keySelector,
TypeSerializer<K> keySerializer,
StateDescriptor<? extends ListState<StreamRecord<IN>>,?> windowStateDescriptor,
InternalWindowFunction<Iterable<IN>,OUT,K,W> windowFunction,
Trigger<? super IN,? super W> trigger,
Evictor<? super IN,? super W> evictor,
long allowedLateness) |
Modifier and Type | Method and Description |
---|---|
Evictor<? super IN,? super W> |
getEvictor() |
StateDescriptor<? extends AppendingState<IN,Iterable<IN>>,?> |
getStateDescriptor() |
void |
processElement(StreamRecord<IN> element)
Processes one element that arrived at this operator.
|
void |
processWatermark(Watermark mark)
Processes a
Watermark . |
void |
trigger(long time)
This method is invoked with the timestamp for which the trigger was scheduled.
|
close, deleteCleanupTimer, dispose, getKeySelector, getMergingWindowSet, getTrigger, getWindowAssigner, isCleanupTime, isLate, open, registerCleanupTimer, restoreState, setInputType, snapshotOperatorState
getUserFunction, getUserFunctionParameters, notifyOfCompletedCheckpoint, setOutputType, setup
getChainingStrategy, getContainingTask, getCurrentProcessingTime, getExecutionConfig, getMetricGroup, getOperatorConfig, getOperatorName, getPartitionedState, getPartitionedState, getRuntimeContext, getStateBackend, getUserCodeClassloader, registerTimer, setChainingStrategy, setKeyContext, setKeyContextElement1, setKeyContextElement2
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChainingStrategy, getMetricGroup, notifyOfCompletedCheckpoint, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setup
public EvictingWindowOperator(WindowAssigner<? super IN,W> windowAssigner, TypeSerializer<W> windowSerializer, KeySelector<IN,K> keySelector, TypeSerializer<K> keySerializer, StateDescriptor<? extends ListState<StreamRecord<IN>>,?> windowStateDescriptor, InternalWindowFunction<Iterable<IN>,OUT,K,W> windowFunction, Trigger<? super IN,? super W> trigger, Evictor<? super IN,? super W> evictor, long allowedLateness)
public void processElement(StreamRecord<IN> element) throws Exception
OneInputStreamOperator
processElement
in interface OneInputStreamOperator<IN,OUT>
processElement
in class WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>
Exception
public void processWatermark(Watermark mark) throws Exception
OneInputStreamOperator
Watermark
.
This method is guaranteed to not be called concurrently with other methods of the operator.processWatermark
in interface OneInputStreamOperator<IN,OUT>
processWatermark
in class WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>
Exception
Watermark
public void trigger(long time) throws Exception
Triggerable
If the triggering is delayed for whatever reason (trigger timer was blocked, JVM stalled due to a garbage collection), the timestamp supplied to this function will still be the original timestamp for which the trigger was scheduled.
public StateDescriptor<? extends AppendingState<IN,Iterable<IN>>,?> getStateDescriptor()
getStateDescriptor
in class WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.