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:
TaskInvokable
,AbstractInvokable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abortCheckpointOnBarrier(long checkpointId, CheckpointException cause)
Aborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker
.Future<Void>
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.Future<Void>
notifyCheckpointCompleteAsync(long checkpointId)
Invoked when a checkpoint has been completed, i.e., when the checkpoint coordinator has received the notification from all participating tasks.Future<Void>
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.CompletableFuture<Boolean>
triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions)
This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.void
triggerCheckpointOnBarrier(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 Detail
-
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
false
if the checkpoint was not carried out,true
otherwise
-
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
Future<Void> notifyCheckpointCompleteAsync(long checkpointId)
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
Future<Void> 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.- 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
Future<Void> 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.- Parameters:
checkpointId
- The ID of the checkpoint that is subsumed.- Returns:
- future that completes when the notification has been processed by the task.
-
abortCheckpointOnBarrier
void abortCheckpointOnBarrier(long checkpointId, CheckpointException cause) throws IOException
Aborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker
.This requires implementing tasks to forward a
CancelCheckpointMarker
to their outputs.- Parameters:
checkpointId
- The ID of the checkpoint to be aborted.cause
- The reason why the checkpoint was aborted during alignment- Throws:
IOException
-
-