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(org.apache.flink.api.common.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(org.apache.flink.api.common.JobID jobId,
S schedulerWithCheckpointing,
org.slf4j.Logger log)
public CompletableFuture<String> getSavepointPath()
StopWithSavepointTerminationHandlerCompletableFuture referring to the result of the stop-with-savepoint
operation.getSavepointPath in interface StopWithSavepointTerminationHandlerCompletableFuture containing the path to the created savepoint in case of
success.public void handleSavepointCreation(CompletedCheckpoint completedSavepoint, Throwable throwable)
StopWithSavepointTerminationHandlerCompletableFuture holding a CompletedCheckpoint. Only
one of the two parameters are allowed to be set.handleSavepointCreation in interface StopWithSavepointTerminationHandlercompletedSavepoint - the CompletedCheckpoint referring to the created savepointthrowable - an error that was caught during savepoint creationpublic void handleExecutionsTermination(Collection<ExecutionState> terminatedExecutionStates)
StopWithSavepointTerminationHandlerExecutionStates. stop-with-savepoint expects the terminatedExecutionStates to only
contain ExecutionState.FINISHED to succeed.handleExecutionsTermination in interface StopWithSavepointTerminationHandlerterminatedExecutionStates - The terminated ExecutionStates of the underlying
job.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.