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:
    1. Creating a savepoint needs to be completed
    2. Waiting for the executions of the underlying job to finish
    • Method Detail

      • getSavepointPath

        CompletableFuture<String> getSavepointPath()
        Returns the a CompletableFuture 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 a CompletableFuture holding a CompletedCheckpoint. Only one of the two parameters are allowed to be set.
        Parameters:
        completedSavepoint - the CompletedCheckpoint referring to the created savepoint
        throwable - an error that was caught during savepoint creation
        Throws:
        IllegalArgumentException - if throwable and completedSavepoint are set
        NullPointerException - if none of the parameters is set
      • handleExecutionsTermination

        void handleExecutionsTermination​(Collection<ExecutionState> terminatedExecutionStates)
        Handles the termination of the job based on the passed terminated ExecutionStates. stop-with-savepoint expects the terminatedExecutionStates to only contain ExecutionState.FINISHED to succeed.
        Parameters:
        terminatedExecutionStates - The terminated ExecutionStates of the underlying job.
        Throws:
        NullPointerException - if null is passed.