Class StopWithSavepointTerminationHandlerImpl
java.lang.Object
org.apache.flink.runtime.scheduler.stopwithsavepoint.StopWithSavepointTerminationHandlerImpl
- All Implemented Interfaces:
StopWithSavepointTerminationHandler
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStopWithSavepointTerminationHandlerImpl(org.apache.flink.api.common.JobID jobId, S schedulerWithCheckpointing, org.slf4j.Logger log) -
Method Summary
Modifier and TypeMethodDescriptionReturns the aCompletableFuturereferring to the result of the stop-with-savepoint operation.voidhandleExecutionsTermination(Collection<ExecutionState> terminatedExecutionStates) Handles the termination of the job based on the passed terminatedExecutionStates. stop-with-savepoint expects theterminatedExecutionStatesto only containExecutionState.FINISHEDto succeed.voidhandleSavepointCreation(CompletedCheckpoint completedSavepoint, Throwable throwable) Handles the result of aCompletableFutureholding aCompletedCheckpoint.
-
Constructor Details
-
StopWithSavepointTerminationHandlerImpl
public StopWithSavepointTerminationHandlerImpl(org.apache.flink.api.common.JobID jobId, S schedulerWithCheckpointing, org.slf4j.Logger log)
-
-
Method Details
-
getSavepointPath
Description copied from interface:StopWithSavepointTerminationHandlerReturns the aCompletableFuturereferring to the result of the stop-with-savepoint operation.- Specified by:
getSavepointPathin interfaceStopWithSavepointTerminationHandler- Returns:
- the
CompletableFuturecontaining the path to the created savepoint in case of success.
-
handleSavepointCreation
Description copied from interface:StopWithSavepointTerminationHandlerHandles the result of aCompletableFutureholding aCompletedCheckpoint. Only one of the two parameters are allowed to be set.- Specified by:
handleSavepointCreationin interfaceStopWithSavepointTerminationHandler- Parameters:
completedSavepoint- theCompletedCheckpointreferring to the created savepointthrowable- an error that was caught during savepoint creation
-
handleExecutionsTermination
Description copied from interface:StopWithSavepointTerminationHandlerHandles the termination of the job based on the passed terminatedExecutionStates. stop-with-savepoint expects theterminatedExecutionStatesto only containExecutionState.FINISHEDto succeed.- Specified by:
handleExecutionsTerminationin interfaceStopWithSavepointTerminationHandler- Parameters:
terminatedExecutionStates- The terminatedExecutionStatesof the underlying job.
-