Interface CheckpointableTask
- All Known Implementing Classes:
AbstractInvokable,AbstractIterativeTask,AbstractTwoInputStreamTask,BatchTask,DataSinkTask,DataSourceTask,IterationHeadTask,IterationIntermediateTask,IterationSynchronizationSinkTask,IterationTailTask,MultipleInputStreamTask,OneInputStreamTask,SourceOperatorStreamTask,SourceStreamTask,StreamIterationHead,StreamIterationTail,StreamTask,TwoInputStreamTask
@Internal
public interface CheckpointableTask
A task that participates in checkpointing.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidabortCheckpointOnBarrier(long checkpointId, CheckpointException cause) Aborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker.notifyCheckpointAbortAsync(long checkpointId, long latestCompletedCheckpointId) Invoked when a checkpoint has been aborted, i.e., when the checkpoint coordinator has received a decline message from one task and try to abort the targeted checkpoint by notification.notifyCheckpointCompleteAsync(long checkpointId) Invoked when a checkpoint has been completed, i.e., when the checkpoint coordinator has received the notification from all participating tasks.notifyCheckpointSubsumedAsync(long checkpointId) Invoked when a checkpoint has been subsumed, i.e., when the checkpoint coordinator has confirmed one checkpoint has been finished, and try to remove the first previous checkpoint.triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions) This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.voidtriggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetricsBuilder checkpointMetrics) This method is called when a checkpoint is triggered as a result of receiving checkpoint barriers on all input streams.
-
Method Details
-
triggerCheckpointAsync
CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions) This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.This method is called for tasks that start the checkpoints by injecting the initial barriers, i.e., the source tasks. In contrast, checkpoints on downstream operators, which are the result of receiving checkpoint barriers, invoke the
triggerCheckpointOnBarrier(CheckpointMetaData, CheckpointOptions, CheckpointMetricsBuilder)method.- Parameters:
checkpointMetaData- Meta data for about this checkpointcheckpointOptions- Options for performing this checkpoint- Returns:
- future with value of
falseif the checkpoint was not carried out,trueotherwise
-
triggerCheckpointOnBarrier
void triggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetricsBuilder checkpointMetrics) throws IOException This method is called when a checkpoint is triggered as a result of receiving checkpoint barriers on all input streams.- Parameters:
checkpointMetaData- Meta data for about this checkpointcheckpointOptions- Options for performing this checkpointcheckpointMetrics- Metrics about this checkpoint- Throws:
IOException- Exceptions thrown as the result of triggering a checkpoint are forwarded.
-
notifyCheckpointCompleteAsync
Invoked when a checkpoint has been completed, i.e., when the checkpoint coordinator has received the notification from all participating tasks.- Parameters:
checkpointId- The ID of the checkpoint that is complete.- Returns:
- future that completes when the notification has been processed by the task.
-
notifyCheckpointAbortAsync
Invoked when a checkpoint has been aborted, i.e., when the checkpoint coordinator has received a decline message from one task and try to abort the targeted checkpoint by notification.- Parameters:
checkpointId- The ID of the checkpoint that is aborted.latestCompletedCheckpointId- The ID of the latest completed checkpoint.- Returns:
- future that completes when the notification has been processed by the task.
-
notifyCheckpointSubsumedAsync
Invoked when a checkpoint has been subsumed, i.e., when the checkpoint coordinator has confirmed one checkpoint has been finished, and try to remove the first previous checkpoint.- Parameters:
checkpointId- The ID of the checkpoint that is subsumed.- Returns:
- future that completes when the notification has been processed by the task.
-
abortCheckpointOnBarrier
Aborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker.This requires implementing tasks to forward a
CancelCheckpointMarkerto their outputs.- Parameters:
checkpointId- The ID of the checkpoint to be aborted.cause- The reason why the checkpoint was aborted during alignment- Throws:
IOException
-