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.WindowContextAbstractStreamOperator.CountingOutput<OUT>allowedLateness, internalTimerService, keySerializer, lateDataOutputTag, numLateRecordsDropped, processContext, timestampedCollector, triggerContext, windowAssigner, windowAssignerContext, windowSerializeruserFunctionchainingStrategy, config, latencyStats, LOG, metrics, output, timeServiceManager| 构造器和说明 |
|---|
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) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
This method is called after all records have been added to the operators via the methods
OneInputStreamOperator.processElement(StreamRecord), or
TwoInputStreamOperator.processElement1(StreamRecord) and
TwoInputStreamOperator.processElement2(StreamRecord). |
void |
dispose()
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 at this operator.
|
deleteCleanupTimer, getKeySelector, getMergingWindowSet, getTrigger, getWindowAssigner, isCleanupTime, isElementLate, isWindowLate, registerCleanupTimer, sideOutputgetUserFunction, getUserFunctionParameters, initializeState, notifyCheckpointComplete, setOutputType, setup, snapshotStategetChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getUserCodeClassloader, initializeState, numEventTimeTimers, numProcessingTimeTimers, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessLatencyMarker, processWatermarkgetChainingStrategy, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, snapshotStategetCurrentKey, setCurrentKeypublic 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
OneInputStreamOperatorprocessElement 在接口中 OneInputStreamOperator<IN,OUT>processElement 在类中 WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>Exceptionpublic void onEventTime(InternalTimer<K,W> timer) throws Exception
TriggerableonEventTime 在接口中 Triggerable<K,W extends Window>onEventTime 在类中 WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>Exceptionpublic void onProcessingTime(InternalTimer<K,W> timer) throws Exception
TriggerableonProcessingTime 在接口中 Triggerable<K,W extends Window>onProcessingTime 在类中 WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>Exceptionpublic void open()
throws Exception
AbstractStreamOperatorThe default implementation does nothing.
public void close()
throws Exception
AbstractStreamOperatorOneInputStreamOperator.processElement(StreamRecord), or
TwoInputStreamOperator.processElement1(StreamRecord) and
TwoInputStreamOperator.processElement2(StreamRecord).
The method is expected to flush all remaining buffered data. Exceptions during this flushing of buffered should be propagated, in order to cause the operation to be recognized asa failed, because the last data items are not processed properly.
public void dispose()
throws Exception
AbstractStreamOperatorThis method is expected to make a thorough effort to release all resources that the operator has acquired.
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.