@Override protected Set<StepExecution> doHandle(StepExecution masterStepExecution, Set<StepExecution> partitionStepExecutions) throws Exception { Assert.notNull(step, "A Step must be provided."); final Set<Future<StepExecution>> tasks = new HashSet<>(getGridSize()); final Set<StepExecution> result = new HashSet<>(); for (final StepExecution stepExecution : partitionStepExecutions) { final FutureTask<StepExecution> task = createTask(step, stepExecution); try { taskExecutor.execute(task); tasks.add(task); } catch (TaskRejectedException e) { // couldn't execute one of the tasks ExitStatus exitStatus = ExitStatus.FAILED .addExitDescription("TaskExecutor rejected the task for this step."); /* * Set the status in case the caller is tracking it through the * JobExecution. */ stepExecution.setStatus(BatchStatus.FAILED); stepExecution.setExitStatus(exitStatus); result.add(stepExecution); } } for (Future<StepExecution> task : tasks) { result.add(task.get()); } return result; }
@Override protected Set<StepExecution> doHandle(StepExecution masterStepExecution, Set<StepExecution> partitionStepExecutions) throws Exception { Assert.notNull(step, "A Step must be provided."); final Set<Future<StepExecution>> tasks = new HashSet<Future<StepExecution>>(getGridSize()); final Set<StepExecution> result = new HashSet<StepExecution>(); for (final StepExecution stepExecution : partitionStepExecutions) { final FutureTask<StepExecution> task = createTask(step, stepExecution); try { taskExecutor.execute(task); tasks.add(task); } catch (TaskRejectedException e) { // couldn't execute one of the tasks ExitStatus exitStatus = ExitStatus.FAILED .addExitDescription("TaskExecutor rejected the task for this step."); /* * Set the status in case the caller is tracking it through the * JobExecution. */ stepExecution.setStatus(BatchStatus.FAILED); stepExecution.setExitStatus(exitStatus); result.add(stepExecution); } } for (Future<StepExecution> task : tasks) { result.add(task.get()); } return result; }
@Override protected Set<StepExecution> doHandle(StepExecution masterStepExecution, Set<StepExecution> partitionStepExecutions) throws Exception { Assert.notNull(step, "A Step must be provided."); final Set<Future<StepExecution>> tasks = new HashSet<Future<StepExecution>>(getGridSize()); final Set<StepExecution> result = new HashSet<StepExecution>(); for (final StepExecution stepExecution : partitionStepExecutions) { final FutureTask<StepExecution> task = createTask(step, stepExecution); try { taskExecutor.execute(task); tasks.add(task); } catch (TaskRejectedException e) { // couldn't execute one of the tasks ExitStatus exitStatus = ExitStatus.FAILED .addExitDescription("TaskExecutor rejected the task for this step."); /* * Set the status in case the caller is tracking it through the * JobExecution. */ stepExecution.setStatus(BatchStatus.FAILED); stepExecution.setExitStatus(exitStatus); result.add(stepExecution); } } for (Future<StepExecution> task : tasks) { result.add(task.get()); } return result; }
@Override protected Set<StepExecution> doHandle(StepExecution masterStepExecution, Set<StepExecution> partitionStepExecutions) throws Exception { Assert.notNull(step, "A Step must be provided."); final Set<Future<StepExecution>> tasks = new HashSet<Future<StepExecution>>(getGridSize()); final Set<StepExecution> result = new HashSet<StepExecution>(); for (final StepExecution stepExecution : partitionStepExecutions) { final FutureTask<StepExecution> task = createTask(step, stepExecution); try { taskExecutor.execute(task); tasks.add(task); } catch (TaskRejectedException e) { // couldn't execute one of the tasks ExitStatus exitStatus = ExitStatus.FAILED .addExitDescription("TaskExecutor rejected the task for this step."); /* * Set the status in case the caller is tracking it through the * JobExecution. */ stepExecution.setStatus(BatchStatus.FAILED); stepExecution.setExitStatus(exitStatus); result.add(stepExecution); } } for (Future<StepExecution> task : tasks) { result.add(task.get()); } return result; }