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.WindowContext
AbstractStreamOperator.CountingOutput<OUT>
allowedLateness, internalTimerService, keySerializer, lateDataOutputTag, numLateRecordsDropped, processContext, timestampedCollector, triggerContext, windowAssigner, windowAssignerContext, windowSerializer
userFunction
chainingStrategy, 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, sideOutput
getUserFunction, getUserFunctionParameters, initializeState, notifyCheckpointComplete, setOutputType, setup, snapshotState
getChainingStrategy, 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, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processLatencyMarker, processWatermark
getChainingStrategy, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setup, snapshotState
getCurrentKey, setCurrentKey
public 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
OneInputStreamOperator
processElement
在接口中 OneInputStreamOperator<IN,OUT>
processElement
在类中 WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>
Exception
public void onEventTime(InternalTimer<K,W> timer) throws Exception
Triggerable
onEventTime
在接口中 Triggerable<K,W extends Window>
onEventTime
在类中 WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>
Exception
public void onProcessingTime(InternalTimer<K,W> timer) throws Exception
Triggerable
onProcessingTime
在接口中 Triggerable<K,W extends Window>
onProcessingTime
在类中 WindowOperator<K,IN,Iterable<IN>,OUT,W extends Window>
Exception
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
public void close() throws Exception
AbstractStreamOperator
OneInputStreamOperator.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
AbstractStreamOperator
This method is expected to make a thorough effort to release all resources that the operator has acquired.
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.