Interface StopWithSavepointTerminationHandler
-
- All Known Implementing Classes:
StopWithSavepointTerminationHandlerImpl
public interface StopWithSavepointTerminationHandler
StopWithSavepointTerminationHandler
handles the steps necessary for the stop-with-savepoint operation to finish. The order of the operations matter:- Creating a savepoint needs to be completed
- Waiting for the executions of the underlying job to finish
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<String>
getSavepointPath()
Returns the aCompletableFuture
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 terminatedExecutionStates
. stop-with-savepoint expects theterminatedExecutionStates
to only containExecutionState.FINISHED
to succeed.void
handleSavepointCreation(CompletedCheckpoint completedSavepoint, Throwable throwable)
Handles the result of aCompletableFuture
holding aCompletedCheckpoint
.
-
-
-
Method Detail
-
getSavepointPath
CompletableFuture<String> getSavepointPath()
Returns the aCompletableFuture
referring to the result of the stop-with-savepoint operation.- Returns:
- the
CompletableFuture
containing the path to the created savepoint in case of success.
-
handleSavepointCreation
void handleSavepointCreation(@Nullable CompletedCheckpoint completedSavepoint, @Nullable Throwable throwable)
Handles the result of aCompletableFuture
holding aCompletedCheckpoint
. Only one of the two parameters are allowed to be set.- Parameters:
completedSavepoint
- theCompletedCheckpoint
referring to the created savepointthrowable
- an error that was caught during savepoint creation- Throws:
IllegalArgumentException
- ifthrowable
andcompletedSavepoint
are setNullPointerException
- if none of the parameters is set
-
handleExecutionsTermination
void handleExecutionsTermination(Collection<ExecutionState> terminatedExecutionStates)
Handles the termination of the job based on the passed terminatedExecutionStates
. stop-with-savepoint expects theterminatedExecutionStates
to only containExecutionState.FINISHED
to succeed.- Parameters:
terminatedExecutionStates
- The terminatedExecutionStates
of the underlying job.- Throws:
NullPointerException
- ifnull
is passed.
-
-