Class PendingCheckpoint
java.lang.Object
org.apache.flink.runtime.checkpoint.PendingCheckpoint
- All Implemented Interfaces:
Checkpoint
A pending checkpoint is a checkpoint that has been started, but has not been acknowledged by all
tasks that need to acknowledge it. Once all tasks have acknowledged it, it becomes a
CompletedCheckpoint.
Note that the pending checkpoint, as well as the successful checkpoint keep the state handles always as serialized values, never as actual values.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassImplementation ofCheckpoint.DiscardObjectforPendingCheckpoint.static enumResult of theacknowledgedTasksmethod.Nested classes/interfaces inherited from interface org.apache.flink.runtime.checkpoint.Checkpoint
Checkpoint.DiscardObject -
Field Summary
Fields inherited from interface org.apache.flink.runtime.checkpoint.Checkpoint
NOOP_DISCARD_OBJECT -
Constructor Summary
ConstructorsConstructorDescriptionPendingCheckpoint(org.apache.flink.api.common.JobID jobId, long checkpointId, long checkpointTimestamp, CheckpointPlan checkpointPlan, Collection<OperatorID> operatorCoordinatorsToConfirm, Collection<String> masterStateIdentifiers, CheckpointProperties props, CompletableFuture<CompletedCheckpoint> onCompletionPromise, PendingCheckpointStats pendingCheckpointStats, CompletableFuture<Void> masterTriggerCompletionPromise) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(CheckpointFailureReason reason, Throwable cause, CheckpointsCleaner checkpointsCleaner, Runnable postCleanup, Executor executor, CheckpointStatsTracker statsTracker) Aborts a checkpoint with reason and cause.acknowledgeCoordinatorState(OperatorInfo coordinatorInfo, ByteStreamStateHandle stateHandle) voidacknowledgeMasterState(String identifier, MasterState state) Acknowledges a master state (state generated on the checkpoint coordinator) to the pending checkpoint.acknowledgeTask(ExecutionAttemptID executionAttemptId, TaskStateSnapshot operatorSubtaskStates, CheckpointMetrics metrics) Acknowledges the task with the given execution attempt id and the given subtask state.booleanChecks whether this checkpoint can be subsumed or whether it should always continue, regardless of newer checkpoints in progress.finalizeCheckpoint(CheckpointsCleaner checkpointsCleaner, Runnable postCleanup, Executor executor) longlongReturns the completion future.org.apache.flink.api.common.JobIDgetJobId()intintintbooleanisAcknowledgedBy(ExecutionAttemptID executionAttemptId) booleanbooleanThis method precede theCheckpoint.DiscardObject.discard()method and should be called from theCheckpointCoordinator(under the lock) whileCheckpoint.DiscardObject.discard()can be called from any thread/place.booleansetCancellerHandle(ScheduledFuture<?> cancellerHandle) Sets the handle for the canceller to this pending checkpoint.voidsetCheckpointTargetLocation(CheckpointStorageLocation targetLocation) toString()
-
Constructor Details
-
PendingCheckpoint
public PendingCheckpoint(org.apache.flink.api.common.JobID jobId, long checkpointId, long checkpointTimestamp, CheckpointPlan checkpointPlan, Collection<OperatorID> operatorCoordinatorsToConfirm, Collection<String> masterStateIdentifiers, CheckpointProperties props, CompletableFuture<CompletedCheckpoint> onCompletionPromise, @Nullable PendingCheckpointStats pendingCheckpointStats, CompletableFuture<Void> masterTriggerCompletionPromise)
-
-
Method Details
-
getJobId
public org.apache.flink.api.common.JobID getJobId() -
getCheckpointID
public long getCheckpointID()- Specified by:
getCheckpointIDin interfaceCheckpoint
-
setCheckpointTargetLocation
-
getCheckpointStorageLocation
-
getCheckpointTimestamp
public long getCheckpointTimestamp() -
getNumberOfNonAcknowledgedTasks
public int getNumberOfNonAcknowledgedTasks() -
getNumberOfNonAcknowledgedOperatorCoordinators
public int getNumberOfNonAcknowledgedOperatorCoordinators() -
getCheckpointPlan
-
getNumberOfAcknowledgedTasks
public int getNumberOfAcknowledgedTasks() -
getOperatorStates
-
getMasterStates
-
isFullyAcknowledged
public boolean isFullyAcknowledged() -
isAcknowledgedBy
-
isDisposed
public boolean isDisposed() -
canBeSubsumed
public boolean canBeSubsumed()Checks whether this checkpoint can be subsumed or whether it should always continue, regardless of newer checkpoints in progress.- Returns:
- True if the checkpoint can be subsumed, false otherwise.
-
setCancellerHandle
Sets the handle for the canceller to this pending checkpoint. This method fails with an exception if a handle has already been set.- Returns:
- true, if the handle was set, false, if the checkpoint is already disposed;
-
getFailureCause
-
getCompletionFuture
Returns the completion future.- Returns:
- A future to the completed checkpoint
-
finalizeCheckpoint
public CompletedCheckpoint finalizeCheckpoint(CheckpointsCleaner checkpointsCleaner, Runnable postCleanup, Executor executor) throws IOException - Throws:
IOException
-
acknowledgeTask
public PendingCheckpoint.TaskAcknowledgeResult acknowledgeTask(ExecutionAttemptID executionAttemptId, TaskStateSnapshot operatorSubtaskStates, CheckpointMetrics metrics) Acknowledges the task with the given execution attempt id and the given subtask state.- Parameters:
executionAttemptId- of the acknowledged taskoperatorSubtaskStates- of the acknowledged taskmetrics- Checkpoint metrics for the stats- Returns:
- TaskAcknowledgeResult of the operation
-
acknowledgeCoordinatorState
public PendingCheckpoint.TaskAcknowledgeResult acknowledgeCoordinatorState(OperatorInfo coordinatorInfo, @Nullable ByteStreamStateHandle stateHandle) -
acknowledgeMasterState
Acknowledges a master state (state generated on the checkpoint coordinator) to the pending checkpoint.- Parameters:
identifier- The identifier of the master statestate- The state to acknowledge
-
abort
public void abort(CheckpointFailureReason reason, @Nullable Throwable cause, CheckpointsCleaner checkpointsCleaner, Runnable postCleanup, Executor executor, CheckpointStatsTracker statsTracker) Aborts a checkpoint with reason and cause. -
markAsDiscarded
Description copied from interface:CheckpointThis method precede theCheckpoint.DiscardObject.discard()method and should be called from theCheckpointCoordinator(under the lock) whileCheckpoint.DiscardObject.discard()can be called from any thread/place.- Specified by:
markAsDiscardedin interfaceCheckpoint
-
toString
-