return partitionStepExecutions;
}
private Set<StepExecution> applyPartitionPlan(StepExecution stepExecution,
PartitionPlan plan, boolean restoreState) throws JobExecutionException {
StepExecutionSplitter stepSplitter;
Set<StepExecution> partitionStepExecutions;
if(plan.getThreads() > 0) {
threads = plan.getThreads();
} else if(plan.getPartitions() > 0) {
threads = plan.getPartitions();
} else {
throw new IllegalArgumentException("Either a number of threads or partitions are required");
}
stepExecution.getExecutionContext().put("partitionPlanState", new PartitionPlanState(plan));
stepSplitter = new JsrStepExecutionSplitter(jobRepository, allowStartIfComplete, stepExecution.getStepName(), restoreState);
partitionStepExecutions = stepSplitter.split(stepExecution, plan.getPartitions());
registerPartitionProperties(partitionStepExecutions, plan);
return partitionStepExecutions;
}