This commit is contained in:
Michael Minella
2019-08-02 14:33:16 -05:00
parent 85b3e90026
commit 4b9554fcce
12 changed files with 55 additions and 54 deletions

View File

@@ -258,9 +258,9 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
/**
* Uses either the {@link PartitionMapper} or the hard coded configuration to split
* the supplied master StepExecution into the slave StepExecutions.
* the supplied manager StepExecution into the worker StepExecutions.
*
* @param stepExecution master {@link StepExecution}
* @param stepExecution manager {@link StepExecution}
* @param isRestart true if this step is being restarted
* @return a {@link Set} of {@link StepExecution}s to be executed
* @throws Exception

View File

@@ -54,14 +54,14 @@ public class PartitionStep extends org.springframework.batch.core.partition.supp
/**
* Delegate execution to the {@link PartitionHandler} provided. The
* {@link StepExecution} passed in here becomes the parent or master
* {@link StepExecution} passed in here becomes the parent or manager
* execution for the partition, summarizing the status on exit of the
* logical grouping of work carried out by the {@link PartitionHandler}. The
* individual step executions and their input parameters (through
* {@link ExecutionContext}) for the partition elements are provided by the
* {@link StepExecutionSplitter}.
*
* @param stepExecution the master step execution for the partition
* @param stepExecution the manager step execution for the partition
*
* @see Step#execute(StepExecution)
*/

View File

@@ -16,6 +16,12 @@
package org.springframework.batch.core.partition.support;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.Step;
@@ -28,12 +34,6 @@ import org.springframework.core.task.TaskExecutor;
import org.springframework.core.task.TaskRejectedException;
import org.springframework.util.Assert;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
/**
* A {@link PartitionHandler} that uses a {@link TaskExecutor} to execute the
* partitioned {@link Step} locally in multiple threads. This can be an
@@ -90,7 +90,7 @@ public class TaskExecutorPartitionHandler extends AbstractPartitionHandler imple
}
@Override
protected Set<StepExecution> doHandle(StepExecution masterStepExecution,
protected Set<StepExecution> doHandle(StepExecution managerStepExecution,
Set<StepExecution> partitionStepExecutions) throws Exception {
Assert.notNull(step, "A Step must be provided.");
final Set<Future<StepExecution>> tasks = new HashSet<>(getGridSize());

View File

@@ -69,12 +69,12 @@ public class PartitionStepBuilder extends StepBuilderHelper<PartitionStepBuilder
* Add a partitioner which can be used to create a {@link StepExecutionSplitter}. Use either this or an explicit
* {@link #splitter(StepExecutionSplitter)} but not both.
*
* @param slaveStepName the name of the slave step (used to construct step execution names)
* @param workerStepName the name of the worker step (used to construct step execution names)
* @param partitioner a partitioner to use
* @return this for fluent chaining
*/
public PartitionStepBuilder partitioner(String slaveStepName, Partitioner partitioner) {
this.stepName = slaveStepName;
public PartitionStepBuilder partitioner(String workerStepName, Partitioner partitioner) {
this.stepName = workerStepName;
this.partitioner = partitioner;
return this;
}

View File

@@ -15,8 +15,15 @@
*/
package org.springframework.batch.core.partition.support;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.JobExecution;
@@ -27,12 +34,6 @@ import org.springframework.batch.core.partition.StepExecutionSplitter;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.Assert.assertEquals;
/**
@@ -73,7 +74,7 @@ public class PartitionStepTests {
StepExecution stepExecution = jobExecution.createStepExecution("foo");
jobRepository.add(stepExecution);
step.execute(stepExecution);
// one master and two workers
// one manager and two workers
assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
}
@@ -98,7 +99,7 @@ public class PartitionStepTests {
StepExecution stepExecution = jobExecution.createStepExecution("foo");
jobRepository.add(stepExecution);
step.execute(stepExecution);
// one master and two workers
// one manager and two workers
assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
assertEquals(BatchStatus.FAILED, stepExecution.getStatus());
}
@@ -146,7 +147,7 @@ public class PartitionStepTests {
stepExecution = jobExecution.createStepExecution("foo");
jobRepository.add(stepExecution);
step.execute(stepExecution);
// one master and two workers
// one manager and two workers
assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
}
@@ -171,7 +172,7 @@ public class PartitionStepTests {
StepExecution stepExecution = jobExecution.createStepExecution("foo");
jobRepository.add(stepExecution);
step.execute(stepExecution);
// one master and two workers
// one manager and two workers
assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
assertEquals(BatchStatus.STOPPED, stepExecution.getStatus());
}