@Test public void testSetGridSize() throws Exception { handler.setGridSize(2); handler.handle(stepExecutionSplitter, stepExecution); assertEquals(2, count); assertEquals("[foo0, foo1]", stepExecutions.toString()); }
@Test public void testTaskExecutorFailure() throws Exception { handler.setGridSize(2); handler.setTaskExecutor(new TaskExecutor() { @Override public void execute(Runnable task) { if (count > 0) { throw new TaskRejectedException("foo"); } task.run(); } }); Collection<StepExecution> executions = handler.handle(stepExecutionSplitter, stepExecution); new DefaultStepExecutionAggregator().aggregate(stepExecution, executions); assertEquals(1, count); assertEquals(ExitStatus.FAILED.getExitCode(), stepExecution.getExitStatus().getExitCode()); }
taskExecutor = new SyncTaskExecutor(); partitionHandler.setGridSize(gridSize); partitionHandler.setTaskExecutor(taskExecutor); step.setPartitionHandler(partitionHandler);
taskExecutor(new SyncTaskExecutor()); partitionHandler.setGridSize(getGridSize()); partitionHandler.setTaskExecutor(getTaskExecutor()); step.setPartitionHandler(partitionHandler);
private void configurePartitionStep(PartitionStep ts) { Assert.state(partitioner != null, "A Partitioner must be provided for a partition step"); Assert.state(step != null, "A Step must be provided for a partition step"); configureAbstractStep(ts); if (partitionHandler != null) { ts.setPartitionHandler(partitionHandler); } else { TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(step); if (taskExecutor == null) { taskExecutor = new SyncTaskExecutor(); } partitionHandler.setGridSize(gridSize); partitionHandler.setTaskExecutor(taskExecutor); ts.setPartitionHandler(partitionHandler); } SimpleStepExecutionSplitter splitter = new SimpleStepExecutionSplitter(jobRepository, step, partitioner); ts.setStepExecutionSplitter(splitter); }
taskExecutor = new SyncTaskExecutor(); partitionHandler.setGridSize(gridSize); partitionHandler.setTaskExecutor(taskExecutor); step.setPartitionHandler(partitionHandler);
taskExecutor = new SyncTaskExecutor(); partitionHandler.setGridSize(gridSize); partitionHandler.setTaskExecutor(taskExecutor); step.setPartitionHandler(partitionHandler);
taskExecutor = new SyncTaskExecutor(); partitionHandler.setGridSize(gridSize); partitionHandler.setTaskExecutor(taskExecutor); step.setPartitionHandler(partitionHandler);
taskExecutor(new SyncTaskExecutor()); partitionHandler.setGridSize(getGridSize()); partitionHandler.setTaskExecutor(getTaskExecutor()); step.setPartitionHandler(partitionHandler);
taskExecutor(new SyncTaskExecutor()); partitionHandler.setGridSize(getGridSize()); partitionHandler.setTaskExecutor(getTaskExecutor()); step.setPartitionHandler(partitionHandler);
taskExecutor(new SyncTaskExecutor()); partitionHandler.setGridSize(getGridSize()); partitionHandler.setTaskExecutor(getTaskExecutor()); step.setPartitionHandler(partitionHandler);