Remove usage of master/slave terminology

This commit is contained in:
Mahmoud Ben Hassine
2021-08-17 21:59:30 +02:00
parent 24152e7a57
commit 36b63ed283
33 changed files with 120 additions and 99 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2018 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ import org.springframework.util.ReflectionUtils;
/**
* Convenient factory bean for a chunk handler that also converts an existing chunk-oriented step into a remote chunk
* master. The idea is to lift the existing chunk processor out of a Step that works locally, and replace it with a one
* manager. 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 manager
@@ -58,7 +58,7 @@ public class RemoteChunkHandlerFactoryBean<T> implements FactoryBean<ChunkHandle
private StepContributionSource stepContributionSource;
/**
* The local step that is to be converted to a remote chunk master.
* The local step that is to be converted to a remote chunk manager.
*
* @param step the step to set
*/
@@ -161,7 +161,7 @@ public class RemoteChunkHandlerFactoryBean<T> implements FactoryBean<ChunkHandle
}
/**
* Replace the chunk processor in the tasklet provided with one that can act as a master in the Remote Chunking
* Replace the chunk processor in the tasklet provided with one that can act as a manager in the Remote Chunking
* pattern.
*
* @param tasklet a ChunkOrientedTasklet

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2018-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ public class RemoteChunkingWorkerBuilder<I, O> {
private MessageChannel outputChannel;
/**
* Set the {@link ItemProcessor} to use to process items sent by the master
* Set the {@link ItemProcessor} to use to process items sent by the manager
* step.
*
* @param itemProcessor to use
@@ -66,7 +66,7 @@ public class RemoteChunkingWorkerBuilder<I, O> {
}
/**
* Set the {@link ItemWriter} to use to write items sent by the master step.
* Set the {@link ItemWriter} to use to write items sent by the manager step.
*
* @param itemWriter to use
* @return this builder instance for fluent chaining
@@ -78,7 +78,7 @@ public class RemoteChunkingWorkerBuilder<I, O> {
}
/**
* Set the input channel on which items sent by the master are received.
* Set the input channel on which items sent by the manager are received.
*
* @param inputChannel the input channel
* @return this builder instance for fluent chaining
@@ -90,7 +90,7 @@ public class RemoteChunkingWorkerBuilder<I, O> {
}
/**
* Set the output channel on which replies will be sent to the master step.
* Set the output channel on which replies will be sent to the manager step.
*
* @param outputChannel the output channel
* @return this builder instance for fluent chaining

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2009-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.integration.partition;
import java.util.ArrayList;
@@ -209,9 +224,9 @@ public class MessageChannelPartitionHandler implements PartitionHandler, Initial
* @see PartitionHandler#handle(StepExecutionSplitter, StepExecution)
*/
public Collection<StepExecution> handle(StepExecutionSplitter stepExecutionSplitter,
final StepExecution masterStepExecution) throws Exception {
final StepExecution managerStepExecution) throws Exception {
final Set<StepExecution> split = stepExecutionSplitter.split(masterStepExecution, gridSize);
final Set<StepExecution> split = stepExecutionSplitter.split(managerStepExecution, gridSize);
if(CollectionUtils.isEmpty(split)) {
return split;
@@ -232,11 +247,11 @@ public class MessageChannelPartitionHandler implements PartitionHandler, Initial
return receiveReplies(replyChannel);
}
else {
return pollReplies(masterStepExecution, split);
return pollReplies(managerStepExecution, split);
}
}
private Collection<StepExecution> pollReplies(final StepExecution masterStepExecution, final Set<StepExecution> split) throws Exception {
private Collection<StepExecution> pollReplies(final StepExecution managerStepExecution, final Set<StepExecution> split) throws Exception {
final Collection<StepExecution> result = new ArrayList<>(split.size());
Callable<Collection<StepExecution>> callback = new Callable<Collection<StepExecution>>() {
@@ -248,7 +263,7 @@ public class MessageChannelPartitionHandler implements PartitionHandler, Initial
if(!result.contains(curStepExecution)) {
StepExecution partitionStepExecution =
jobExplorer.getStepExecution(masterStepExecution.getJobExecutionId(), curStepExecution.getId());
jobExplorer.getStepExecution(managerStepExecution.getJobExecutionId(), curStepExecution.getId());
if(!partitionStepExecution.getStatus().isRunning()) {
result.add(partitionStepExecution);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2018-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,15 +50,15 @@ import org.springframework.util.Assert;
* creates an {@link IntegrationFlow} that:
*
* <ul>
* <li>listens to {@link StepExecutionRequest}s coming from the master
* <li>listens to {@link StepExecutionRequest}s coming from the manager
* on the input channel</li>
* <li>invokes the {@link StepExecutionRequestHandler} to execute the worker
* step for each incoming request. The worker step is located using the provided
* {@link StepLocator}. If no {@link StepLocator} is provided, a {@link BeanFactoryStepLocator}
* configured with the current {@link BeanFactory} will be used
* <li>replies to the master on the output channel (when the master step is
* <li>replies to the manager on the output channel (when the manager step is
* configured to aggregate replies from workers). If no output channel
* is provided, a {@link NullChannel} will be used (assuming the master side
* is provided, a {@link NullChannel} will be used (assuming the manager side
* is configured to poll the job repository for workers status)</li>
* </ul>
*
@@ -85,7 +85,7 @@ public class RemotePartitioningWorkerStepBuilder extends StepBuilder {
}
/**
* Set the input channel on which step execution requests sent by the master
* Set the input channel on which step execution requests sent by the manager
* are received.
* @param inputChannel the input channel
* @return this builder instance for fluent chaining
@@ -97,7 +97,7 @@ public class RemotePartitioningWorkerStepBuilder extends StepBuilder {
}
/**
* Set the output channel on which replies will be sent to the master step.
* Set the output channel on which replies will be sent to the manager step.
* @param outputChannel the input channel
* @return this builder instance for fluent chaining
*/
@@ -235,7 +235,7 @@ public class RemotePartitioningWorkerStepBuilder extends StepBuilder {
if (this.outputChannel == null) {
if (logger.isDebugEnabled()) {
logger.debug("The output channel is set to a NullChannel. " +
"The master step must poll the job repository for workers status.");
"The manager step must poll the job repository for workers status.");
}
this.outputChannel = new NullChannel();
}