-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide method for stopping Batch 5 Jobs upon user request
In the previous release of SCDF we used the JsrJobOperator to stop job executions. The 2 stages of stopping jobs is as follows: 1) Sets the Batch Status of the job execution to STOPPING. This signals to Spring Batch to stop execution at the next step. 2) If the Job is a StepLocator it will go through each of the StoppableTasklets and stop them. So when using Batch 4.x it was just a quick check of the JobRegistry to retrieve the job, which was always empty since SCDF never deals with Jobs directly. But with Batch 5.x they loaded the Job Registry and attempted to retrieve the Job in a different way using the SimpleJobOperator. In the updated solution, SCDF doesn't use the SimpleJobOperator since SCDF doesn't have access to the StepLocator for the Job, nor does it use the JobRegistry and even if it did, it would always be empty. w * Modify stopAll so that it calls stop() instead of using its own logic * Add Test for stopAll Updated based on code review Extract job stop code from stop(long) and place into stopJobExecution method. The stopJobExecution method will be used by stop(long) and stopAll. Updated Based on Code Review Moved Job Stop Code from assert methods to the tests. Updated the JobExecution Create methods so that they verify that the job is not Stopping
- Loading branch information
Showing
2 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters