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 remove elements from a pane before/after the evaluation of
InternalWindowFunction and after the window evaluation gets triggered by a Trigger.
WindowOperator.AbstractPerWindowStateStore, WindowOperator.Context, WindowOperator.MergingWindowStateStore, WindowOperator.PerWindowStateStore, WindowOperator.Timer<K,W extends Window>, WindowOperator.WindowContextallowedLateness, internalTimerService, keySerializer, lateDataOutputTag, numLateRecordsDropped, processContext, timestampedCollector, triggerContext, windowAssigner, windowAssignerContext, windowSerializeruserFunctionchainingStrategy, config, lastRecordAttributes1, lastRecordAttributes2, latencyStats, LOG, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager| Constructor and Description |
|---|
EvictingWindowOperator(WindowAssigner<? super IN,W> windowAssigner,
org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer,
org.apache.flink.api.java.functions.KeySelector<IN,K> keySelector,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
org.apache.flink.api.common.state.StateDescriptor<? extends org.apache.flink.api.common.state.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,
org.apache.flink.util.OutputTag<IN> lateDataOutputTag) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This method is called at the very end of the operator's life, both in the case of a
successful completion of the operation, and in the case of a failure and canceling.
|
Evictor<? super IN,? super W> |
getEvictor() |
org.apache.flink.api.common.state.StateDescriptor<? extends org.apache.flink.api.common.state.AppendingState<IN,Iterable<IN>>,?> |
getStateDescriptor() |
void |
onEventTime(InternalTimer<K,W> timer)
Invoked when an event-time timer fires.
|
void |
onProcessingTime(InternalTimer<K,W> timer)
Invoked when a processing-time timer fires.
|
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g. state initialization.
|
void |
processElement(StreamRecord<IN> element)
Processes one element that arrived on this input of the
MultipleInputStreamOperator. |
deleteCleanupTimer, getKeySelector, getMergingWindowSet, getOperatorAttributes, getTrigger, getWindowAssigner, isCleanupTime, isElementLate, isWindowLate, registerCleanupTimer, sideOutputfinish, getUserFunction, getUserFunctionParameters, initializeState, notifyCheckpointAborted, notifyCheckpointComplete, setOutputType, setup, snapshotStategetChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, snapshotState, useSplittableTimersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetKeyContextElementfinish, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatenotifyCheckpointAborted, notifyCheckpointCompletegetCurrentKey, setCurrentKeyprocessLatencyMarker, processRecordAttributes, processWatermark, processWatermarkStatushasKeyContextpublic EvictingWindowOperator(WindowAssigner<? super IN,W> windowAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer, org.apache.flink.api.java.functions.KeySelector<IN,K> keySelector, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.state.StateDescriptor<? extends org.apache.flink.api.common.state.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, org.apache.flink.util.OutputTag<IN> lateDataOutputTag)
public void processElement(StreamRecord<IN> element) throws Exception
InputMultipleInputStreamOperator.
This method is guaranteed to not be called concurrently with other methods of the operator.processElement in interface Input<IN>processElement in class WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>Exceptionpublic void onEventTime(InternalTimer<K,W> timer) throws Exception
TriggerableonEventTime in interface Triggerable<K,W extends Window>onEventTime in class WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>Exceptionpublic void onProcessingTime(InternalTimer<K,W> timer) throws Exception
TriggerableonProcessingTime in interface Triggerable<K,W extends Window>onProcessingTime in class WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>Exceptionpublic void open()
throws Exception
AbstractStreamOperatorThe default implementation does nothing.
public void close()
throws Exception
StreamOperatorThis method is expected to make a thorough effort to release all resources that the operator has acquired.
NOTE:It can not emit any records! If you need to emit records at the end of
processing, do so in the StreamOperator.finish() method.
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.