public class SavepointCoordinator extends CheckpointCoordinator
The savepoint coordinator is meant to be used as a separate coordinator instance. Otherwise, there can be unwanted queueing effects like discarding savepoints, because of in-progress periodic checkpoints.
The savepoint coordinator registers callbacks on the regular checkpoint life-cycle and manages a map of promises, which are completed/failed as soon as the trigged checkpoint is done.
Important: it's necessary that both the periodic
checkpoint coordinator and the savepoint coordinator share the same
instance of the CheckpointIDCounter
to ensure that all task managers
see ascending checkpoints IDs.
checkpointIdCounter, lock
Constructor and Description |
---|
SavepointCoordinator(JobID jobId,
long baseInterval,
long checkpointTimeout,
ExecutionVertex[] tasksToTrigger,
ExecutionVertex[] tasksToWaitFor,
ExecutionVertex[] tasksToCommitTo,
ClassLoader userClassLoader,
CheckpointIDCounter checkpointIDCounter,
StateStore<CompletedCheckpoint> savepointStore,
CheckpointStatsTracker statsTracker) |
Modifier and Type | Method and Description |
---|---|
ActorGateway |
createActivatorDeactivator(akka.actor.ActorSystem actorSystem,
UUID leaderSessionID) |
String |
getSavepointRestorePath() |
protected void |
onCancelCheckpoint(long canceledCheckpointId)
Callback on cancellation of a checkpoint.
|
protected void |
onFullyAcknowledgedCheckpoint(CompletedCheckpoint checkpoint)
Callback on full acknowledgement of a checkpoint.
|
protected void |
onShutdown()
Callback on shutdown of the coordinator.
|
void |
restoreSavepoint(Map<JobVertexID,ExecutionJobVertex> tasks,
String savepointPath)
Resets the state of
Execution instances back to the state of a savepoint. |
scala.concurrent.Future<String> |
triggerSavepoint(long timestamp)
Triggers a new savepoint using the current system time as the checkpoint timestamp.
|
getAndIncrementCheckpointId, getJobStatusListener, getNumberOfPendingCheckpoints, getNumberOfRetainedSuccessfulCheckpoints, getPendingCheckpoints, getSuccessfulCheckpoints, isShutdown, receiveAcknowledgeMessage, receiveDeclineMessage, restoreLatestCheckpointedState, setJobStatusListener, shutdown, startCheckpointScheduler, stopCheckpointScheduler, triggerCheckpoint, triggerCheckpoint
public SavepointCoordinator(JobID jobId, long baseInterval, long checkpointTimeout, ExecutionVertex[] tasksToTrigger, ExecutionVertex[] tasksToWaitFor, ExecutionVertex[] tasksToCommitTo, ClassLoader userClassLoader, CheckpointIDCounter checkpointIDCounter, StateStore<CompletedCheckpoint> savepointStore, CheckpointStatsTracker statsTracker) throws Exception
Exception
public String getSavepointRestorePath()
public scala.concurrent.Future<String> triggerSavepoint(long timestamp) throws Exception
Exception
public void restoreSavepoint(Map<JobVertexID,ExecutionJobVertex> tasks, String savepointPath) throws Exception
Execution
instances back to the state of a savepoint.
The execution vertices need to be in state ExecutionState.CREATED
when calling
this method. The operation might block. Make sure that calls don't block the job manager
actor.
tasks
- Tasks that will possibly be resetsavepointPath
- The path of the savepoint to rollback toIllegalStateException
- If coordinator is shut downIllegalStateException
- If mismatch between program and savepoint stateException
- If savepoint store failureprotected void onShutdown()
CheckpointCoordinator
onShutdown
in class CheckpointCoordinator
protected void onCancelCheckpoint(long canceledCheckpointId)
CheckpointCoordinator
onCancelCheckpoint
in class CheckpointCoordinator
protected void onFullyAcknowledgedCheckpoint(CompletedCheckpoint checkpoint)
CheckpointCoordinator
onFullyAcknowledgedCheckpoint
in class CheckpointCoordinator
public ActorGateway createActivatorDeactivator(akka.actor.ActorSystem actorSystem, UUID leaderSessionID)
createActivatorDeactivator
in class CheckpointCoordinator
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.