Class StopWithSavepointTerminationHandlerImpl
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.stopwithsavepoint.StopWithSavepointTerminationHandlerImpl
-
- All Implemented Interfaces:
StopWithSavepointTerminationHandler
public class StopWithSavepointTerminationHandlerImpl extends Object implements StopWithSavepointTerminationHandler
StopWithSavepointTerminationHandlerImplimplementsStopWithSavepointTerminationHandler.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:
StopWithSavepointTerminationManager
-
-
Constructor Summary
Constructors Constructor Description StopWithSavepointTerminationHandlerImpl(org.apache.flink.api.common.JobID jobId, S schedulerWithCheckpointing, org.slf4j.Logger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<String>getSavepointPath()Returns 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.
-
-
-
Method Detail
-
getSavepointPath
public CompletableFuture<String> 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
public void handleSavepointCreation(CompletedCheckpoint completedSavepoint, Throwable throwable)
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
public void handleExecutionsTermination(Collection<ExecutionState> terminatedExecutionStates)
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.
-
-