public class WatermarkAssignerOperator extends AbstractStreamOperator<RowData> implements OneInputStreamOperator<RowData,RowData>, ProcessingTimeCallback
chainingStrategy, config, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
WatermarkAssignerOperator(int rowtimeFieldIndex,
WatermarkGenerator watermarkGenerator,
long idleTimeout,
ProcessingTimeService processingTimeService)
Create a watermark assigner operator.
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
onProcessingTime(long timestamp)
This method is invoked with the timestamp for which the trigger was scheduled.
|
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g.
|
void |
processElement(StreamRecord<RowData> element)
Processes one element that arrived at this operator.
|
void |
processWatermark(Watermark mark)
Override the base implementation to completely ignore watermarks propagated from upstream (we
rely only on the
WatermarkGenerator to emit watermarks from here). |
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, numEventTimeTimers, numProcessingTimeTimers, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processLatencyMarker
getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
public WatermarkAssignerOperator(int rowtimeFieldIndex, WatermarkGenerator watermarkGenerator, long idleTimeout, ProcessingTimeService processingTimeService)
rowtimeFieldIndex
- the field index to extract event timestampwatermarkGenerator
- the watermark generatoridleTimeout
- (idleness checking timeout)public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<RowData>
open
in class AbstractStreamOperator<RowData>
Exception
- An exception in this method causes the operator to fail.public void processElement(StreamRecord<RowData> element) throws Exception
OneInputStreamOperator
processElement
in interface OneInputStreamOperator<RowData,RowData>
Exception
public void onProcessingTime(long timestamp) throws Exception
ProcessingTimeCallback
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.
onProcessingTime
in interface ProcessingTimeCallback
timestamp
- The timestamp for which the trigger event was scheduled.Exception
public void processWatermark(Watermark mark) throws Exception
WatermarkGenerator
to emit watermarks from here).processWatermark
in interface OneInputStreamOperator<RowData,RowData>
processWatermark
in class AbstractStreamOperator<RowData>
Exception
Watermark
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.
close
in interface StreamOperator<RowData>
close
in class AbstractStreamOperator<RowData>
Exception
- An exception in this method causes the operator to fail.public void dispose() throws Exception
AbstractStreamOperator
This method is expected to make a thorough effort to release all resources that the operator has acquired.
dispose
in interface StreamOperator<RowData>
dispose
in interface Disposable
dispose
in class AbstractStreamOperator<RowData>
Exception
- if something goes wrong during disposal.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.