Interface SubtaskCheckpointCoordinator
-
- All Superinterfaces:
AutoCloseable,Closeable
@Internal public interface SubtaskCheckpointCoordinator extends Closeable
Coordinates checkpointing-related work for a subtask (i.e.TaskandStreamTask). Responsibilities:- build a snapshot (invokable)
- report snapshot to the JobManager
- action upon checkpoint notification
- maintain storage locations
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidabortCheckpointOnBarrier(long checkpointId, CheckpointException cause, OperatorChain<?,?> operatorChain)voidcancel()Cancel all resources.voidcheckpointState(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetricsBuilder checkpointMetrics, OperatorChain<?,?> operatorChain, boolean isTaskFinished, Supplier<Boolean> isRunning)Must be called afterinitInputsCheckpoint(long, CheckpointOptions).ChannelStateWritergetChannelStateWriter()CheckpointStorageWorkerViewgetCheckpointStorage()voidinitInputsCheckpoint(long id, CheckpointOptions checkpointOptions)Initialize new checkpoint.voidnotifyCheckpointAborted(long checkpointId, OperatorChain<?,?> operatorChain, Supplier<Boolean> isRunning)Notified on the task side once a distributed checkpoint has been aborted.voidnotifyCheckpointComplete(long checkpointId, OperatorChain<?,?> operatorChain, Supplier<Boolean> isRunning)Notified on the task side once a distributed checkpoint has been completed.voidnotifyCheckpointSubsumed(long checkpointId, OperatorChain<?,?> operatorChain, Supplier<Boolean> isRunning)Notified on the task side once a distributed checkpoint has been subsumed.voidwaitForPendingCheckpoints()Waits for all the pending checkpoints to finish their asynchronous step.
-
-
-
Method Detail
-
initInputsCheckpoint
void initInputsCheckpoint(long id, CheckpointOptions checkpointOptions) throws CheckpointExceptionInitialize new checkpoint.- Throws:
CheckpointException
-
getChannelStateWriter
ChannelStateWriter getChannelStateWriter()
-
getCheckpointStorage
CheckpointStorageWorkerView getCheckpointStorage()
-
abortCheckpointOnBarrier
void abortCheckpointOnBarrier(long checkpointId, CheckpointException cause, OperatorChain<?,?> operatorChain) throws IOException- Throws:
IOException
-
checkpointState
void checkpointState(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetricsBuilder checkpointMetrics, OperatorChain<?,?> operatorChain, boolean isTaskFinished, Supplier<Boolean> isRunning) throws Exception
Must be called afterinitInputsCheckpoint(long, CheckpointOptions).- Throws:
Exception
-
notifyCheckpointComplete
void notifyCheckpointComplete(long checkpointId, OperatorChain<?,?> operatorChain, Supplier<Boolean> isRunning) throws ExceptionNotified on the task side once a distributed checkpoint has been completed.- Parameters:
checkpointId- The checkpoint id to notify as been completed.operatorChain- The chain of operators executed by the task.isRunning- Whether the task is running.- Throws:
Exception
-
notifyCheckpointAborted
void notifyCheckpointAborted(long checkpointId, OperatorChain<?,?> operatorChain, Supplier<Boolean> isRunning) throws ExceptionNotified on the task side once a distributed checkpoint has been aborted.- Parameters:
checkpointId- The checkpoint id to notify as been completed.operatorChain- The chain of operators executed by the task.isRunning- Whether the task is running.- Throws:
Exception
-
notifyCheckpointSubsumed
void notifyCheckpointSubsumed(long checkpointId, OperatorChain<?,?> operatorChain, Supplier<Boolean> isRunning) throws ExceptionNotified on the task side once a distributed checkpoint has been subsumed.- Parameters:
checkpointId- The checkpoint id to notify as been subsumed.operatorChain- The chain of operators executed by the task.isRunning- Whether the task is running.- Throws:
Exception
-
waitForPendingCheckpoints
void waitForPendingCheckpoints() throws ExceptionWaits for all the pending checkpoints to finish their asynchronous step.- Throws:
Exception
-
cancel
void cancel() throws IOExceptionCancel all resources.- Throws:
IOException
-
-