Hi,
I'm working on a Spring Batch application which runs a job and partitions it into a number of Tasklet steps using the PartitionStep. In the Partitioner that I feed into the StepExecutionSplitter, I need to be able to skip the block of code that actually figures out how the steps will be partitioned so that if one of the Tasklet steps fail, only the unsuccessful ones will be run if the job is restarted and even the code that does the splitting of the job into a number of steps can be skipped. Is there a way for the Partitioner to have access to an ExecutionContext so it could check for the existence of a variable if it should skip the code that does the splitting of the job into small steps? I'm looking for something similar to the code snippet in the Spring Batch documentation section 3.3. Here's the code snippet in the Spring Batch documentation..
Thanks.Code:if (executionContext.containsKey(getKey(LINES_READ_COUNT))) { log.debug("Initializing for restart. Restart data is: " + executionContext); long lineCount = executionContext.getLong(getKey(LINES_READ_COUNT)); LineReader reader = getReader(); Object record = ""; while (reader.getPosition() < lineCount && record != null) { record = readLine(); } }


Reply With Quote
