diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/partition/JsrPartitionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/partition/JsrPartitionHandler.java index 9bcae55ba..8841dfc0f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/partition/JsrPartitionHandler.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/partition/JsrPartitionHandler.java @@ -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 diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/PartitionStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/PartitionStep.java index b4eac0c5e..05654ba69 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/PartitionStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/PartitionStep.java @@ -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) */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java index 7823d7023..16400e1e0 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java @@ -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 doHandle(StepExecution masterStepExecution, + protected Set doHandle(StepExecution managerStepExecution, Set partitionStepExecutions) throws Exception { Assert.notNull(step, "A Step must be provided."); final Set> tasks = new HashSet<>(getGridSize()); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/PartitionStepBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/PartitionStepBuilder.java index 70c3a8fa8..fcf88cc62 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/PartitionStepBuilder.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/PartitionStepBuilder.java @@ -69,12 +69,12 @@ public class PartitionStepBuilder extends StepBuilderHelper { /** - * In a master-slave pattern, the master calls this method paired with + * In a manager-worker pattern, the manager calls this method paired with * {@link #take()} to manage the flow of items. Normally a task is submitted - * for processing in another thread, at which point the master uses this + * for processing in another thread, at which point the manager uses this * method to keep track of the number of expected results. It has the * personality of an counter increment, rather than a work queue, which is * usually managed elsewhere, e.g. by a {@link TaskExecutor}.

@@ -50,7 +50,7 @@ interface ResultQueue { /** * Once it is expecting a result, clients call this method to satisfy the - * expectation. In a master-worker pattern, the workers call this method to + * expectation. In a manager-worker pattern, the workers call this method to * deposit the result of a finished task on the queue for collection. * * @param result the result for later collection. @@ -72,7 +72,7 @@ interface ResultQueue { T take() throws NoSuchElementException, InterruptedException; /** - * Used by master thread to verify that there are results available from + * Used by manager thread to verify that there are results available from * {@link #take()} without possibly having to block and wait. * * @return true if there are no results available @@ -80,7 +80,7 @@ interface ResultQueue { boolean isEmpty(); /** - * Check if any results are expected. Usually used by master thread to drain + * Check if any results are expected. Usually used by manager thread to drain * queue when it is finished. * * @return true if more results are expected, but possibly not yet diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkHandler.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkHandler.java index 0d7141890..c6bbdcabe 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkHandler.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/ChunkHandler.java @@ -18,7 +18,7 @@ package org.springframework.batch.integration.chunk; /** - * Interface for a remote worker in the Remote Chunking pattern. A request comes from a master process containing some + * Interface for a remote worker in the Remote Chunking pattern. A request comes from a manager process containing some * items to be processed. Once the items are done with a response needs to be generated containing a summary of the * result. * diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkHandlerFactoryBean.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkHandlerFactoryBean.java index 139b9867a..bce7a19fa 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkHandlerFactoryBean.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkHandlerFactoryBean.java @@ -40,8 +40,8 @@ import org.springframework.util.ReflectionUtils; * master. The idea is to lift the existing chunk processor out of a Step that works locally, and replace it with a one * that writes chunks into a message channel. The existing step hands its business chunk processing responsibility over * to the handler produced by the factory, which then needs to be set up as a worker on the other end of the channel the - * chunks are being sent to. Once this chunk handler is installed the application is playing the role of both the master - * and the slave listeners in the Remote Chunking pattern for the Step in question. + * chunks are being sent to. Once this chunk handler is installed the application is playing the role of both the manager + * and the worker listeners in the Remote Chunking pattern for the Step in question. * * @author Dave Syer * @author Mahmoud Ben Hassine diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java index a491c10d6..bac0462b6 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java @@ -49,9 +49,9 @@ import org.springframework.util.CollectionUtils; * While a {@link org.springframework.messaging.MessageChannel} is used for sending the requests to the workers, the * worker's responses can be obtained in one of two ways: *
    - *
  • A reply channel - Slaves will respond with messages that will be aggregated via this component.
  • - *
  • Polling the job repository - Since the state of each slave is maintained independently within the job - * repository, we can poll the store to determine the state without the need of the slaves to formally respond.
  • + *
  • A reply channel - Workers will respond with messages that will be aggregated via this component.
  • + *
  • Polling the job repository - Since the state of each worker is maintained independently within the job + * repository, we can poll the store to determine the state without the need of the workers to formally respond.
  • *
* * Note: The reply channel for this is instance based. Sharing this component across @@ -98,7 +98,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler, Initial pollRepositoryForResults = !(dataSource == null && jobExplorer == null); if(pollRepositoryForResults) { - logger.debug("MessageChannelPartitionHandler is configured to poll the job repository for slave results"); + logger.debug("MessageChannelPartitionHandler is configured to poll the job repository for worker results"); } if(dataSource != null && jobExplorer == null) { @@ -134,7 +134,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler, Initial } /** - * How often to poll the job repository for the status of the slaves. + * How often to poll the job repository for the status of the workers. * * @param pollInterval milliseconds between polls, defaults to 10000 (10 seconds). */ diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java index 9151f4f55..56af8c13d 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java @@ -228,8 +228,8 @@ public class RemotePartitioningManagerStepBuilder extends PartitionStepBuilder { } @Override - public RemotePartitioningManagerStepBuilder partitioner(String slaveStepName, Partitioner partitioner) { - super.partitioner(slaveStepName, partitioner); + public RemotePartitioningManagerStepBuilder partitioner(String workerStepName, Partitioner partitioner) { + super.partitioner(workerStepName, partitioner); return this; } diff --git a/spring-batch-samples/README.md b/spring-batch-samples/README.md index 56111c6fa..42291a8ad 100644 --- a/spring-batch-samples/README.md +++ b/spring-batch-samples/README.md @@ -645,13 +645,13 @@ not get shared across threads of execution. ### Remote Partitioning Sample -This sample shows how to configure a remote partitioning job. The master step +This sample shows how to configure a remote partitioning job. The manager step uses a `MessageChannelPartitionHandler` to send partitions to and receive replies from workers. Two examples are shown: -* A master step that polls the job repository to see if all workers have finished +* A manager step that polls the job repository to see if all workers have finished their work -* A master step that aggregates replies from workers to notify work completion +* A manager step that aggregates replies from workers to notify work completion The sample uses an embedded JMS broker and an embedded database for simplicity but any option supported via Spring Integration for communication is technically @@ -659,18 +659,18 @@ acceptable. ### Remote Chunking Sample -This sample shows how to configure a remote chunking job. The master step will +This sample shows how to configure a remote chunking job. The manager step will read numbers from 1 to 6 and send two chunks ({1, 2, 3} and {4, 5, 6}) to workers for processing and writing. This example shows how to use: -* the `RemoteChunkingMasterStepBuilderFactory` to create a master step +* the `RemoteChunkingManagerStepBuilderFactory` to create a manager step * the `RemoteChunkingWorkerBuilder` to configure an integration flow on the worker side. The sample uses an embedded JMS broker as a communication middleware between the -master and workers. The usage of an embedded broker is only for simplicity's sake, -the communication between the master and workers is still done through JMS queues +manager and workers. The usage of an embedded broker is only for simplicity's sake, +the communication between the manager and workers is still done through JMS queues and Spring Integration channels and messages are sent over the wire through a TCP port. ### Quartz Sample