public class StopWithSavepointTerminationHandlerImpl extends Object implements StopWithSavepointTerminationHandler
StopWithSavepointTerminationHandlerImpl
implements StopWithSavepointTerminationHandler
.
The operation only succeeds if both steps, the savepoint creation and the successful termination of the job, succeed. If the former step fails, the operation fails exceptionally without any further actions. If the latter one fails, a global fail-over is triggered before failing the operation.
The implementation expects the savepoint creation being completed before the executions terminate.
StopWithSavepointTerminationManager
Constructor and Description |
---|
StopWithSavepointTerminationHandlerImpl(JobID jobId,
S schedulerWithCheckpointing,
org.slf4j.Logger log) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<String> |
getSavepointPath()
Returns the a
CompletableFuture referring to the result of the stop-with-savepoint
operation. |
void |
handleExecutionsTermination(Collection<ExecutionState> terminatedExecutionStates)
Handles the termination of the job based on the passed terminated
ExecutionStates . |
void |
handleSavepointCreation(CompletedCheckpoint completedSavepoint,
Throwable throwable)
Handles the result of a
CompletableFuture holding a CompletedCheckpoint . |
public StopWithSavepointTerminationHandlerImpl(JobID jobId, S schedulerWithCheckpointing, org.slf4j.Logger log)
public CompletableFuture<String> getSavepointPath()
StopWithSavepointTerminationHandler
CompletableFuture
referring to the result of the stop-with-savepoint
operation.getSavepointPath
in interface StopWithSavepointTerminationHandler
CompletableFuture
containing the path to the created savepoint in case of
success.public void handleSavepointCreation(CompletedCheckpoint completedSavepoint, Throwable throwable)
StopWithSavepointTerminationHandler
CompletableFuture
holding a CompletedCheckpoint
. Only
one of the two parameters are allowed to be set.handleSavepointCreation
in interface StopWithSavepointTerminationHandler
completedSavepoint
- the CompletedCheckpoint
referring to the created savepointthrowable
- an error that was caught during savepoint creationpublic void handleExecutionsTermination(Collection<ExecutionState> terminatedExecutionStates)
StopWithSavepointTerminationHandler
ExecutionStates
. stop-with-savepoint expects the terminatedExecutionStates
to only
contain ExecutionState.FINISHED
to succeed.handleExecutionsTermination
in interface StopWithSavepointTerminationHandler
terminatedExecutionStates
- The terminated ExecutionStates
of the underlying
job.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.