CommT- The committable type of the
GlobalCommT- The global committable type of the
@Internal public final class StreamingGlobalCommitterOperator<CommT,GlobalCommT> extends AbstractStreamOperator<CommT> implements BoundedOneInput
|Modifier and Type||Method and Description|
This method is called after all records have been added to the operators via the methods
It is notified that no more data will arrive from the input.
Stream operators with state which can be restored need to override this hook method.
Notifies the listener that the checkpoint with the given
Processes one element that arrived on this input of the
Stream operators with state, which want to participate in a snapshot need to override this hook method.
dispose, getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, open, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose, getMetricGroup, getOperatorID, initializeState, open, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
public void endInput()
WARNING: It is not safe to use this method to commit any transactions or other side
effects! You can use this method to flush any buffered data that can later on be committed
e.g. in a
public void close() throws Exception
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 notifyCheckpointComplete(long checkpointId) throws Exception
checkpointIdcompleted and was committed.
These notifications are "best effort", meaning they can sometimes be skipped. To behave
properly, implementers need to follow the "Checkpoint Subsuming Contract". Please see the
class-level JavaDocs for details.
Please note that checkpoints may generally overlap, so you cannot assume that the
notifyCheckpointComplete() call is always for the latest prior checkpoint (or snapshot) that
was taken on the function/operator implementing this interface. It might be for a checkpoint
that was triggered earlier. Implementing the "Checkpoint Subsuming Contract" (see above)
properly handles this situation correctly as well.
Please note that throwing exceptions from this method will not cause the completed checkpoint to be revoked. Throwing exceptions will typically cause task/job failure and trigger recovery.
checkpointId- The ID of the checkpoint that has been completed.
Exception- This method can propagate exceptions, which leads to a failure/recovery for the task. Not that this will NOT lead to the checkpoint being revoked.
public void initializeState(StateInitializationContext context) throws Exception
context- context that allows to register different states.
public void processElement(StreamRecord<InputT> element) throws Exception
MultipleInputStreamOperator. This method is guaranteed to not be called concurrently with other methods of the operator.
public void snapshotState(StateSnapshotContext context) throws Exception
context- context that provides information and means required for taking a snapshot
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.