diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/PartitionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/PartitionHandler.java index b25325bbc..889736589 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/PartitionHandler.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/PartitionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 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. @@ -30,6 +30,7 @@ import org.springframework.batch.item.ExecutionContext; * caller. * * @author Dave Syer + * @author Mahmoud Ben Hassine * @since 2.0 */ public interface PartitionHandler { @@ -38,12 +39,12 @@ public interface PartitionHandler { * Main entry point for {@link PartitionHandler} interface. The splitter * creates all the executions that need to be farmed out, along with their * input parameters (in the form of their {@link ExecutionContext}). The - * master step execution is used to identify the partition and group + * manager step execution is used to identify the partition and group * together the results logically. * * @param stepSplitter a strategy for generating a collection of * {@link StepExecution} instances - * @param stepExecution the master step execution for the whole partition + * @param stepExecution the manager step execution for the whole partition * @return a collection of completed {@link StepExecution} instances * @throws Exception if anything goes wrong. This allows implementations to * be liberal and rely on the caller to translate an exception into a step diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java index b461e2508..819e53906 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 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. @@ -31,6 +31,7 @@ import org.springframework.batch.core.partition.StepExecutionSplitter; * * @author Sebastien Gerard * @author Dave Syer + * @author Mahmoud Ben Hassine */ public abstract class AbstractPartitionHandler implements PartitionHandler { @@ -40,14 +41,14 @@ public abstract class AbstractPartitionHandler implements PartitionHandler { * Executes the specified {@link StepExecution} instances and returns an updated * view of them. Throws an {@link Exception} if anything goes wrong. * - * @param masterStepExecution the whole partition execution + * @param managerStepExecution the whole partition execution * @param partitionStepExecutions the {@link StepExecution} instances to execute * @return an updated view of these completed {@link StepExecution} instances * @throws Exception if anything goes wrong. This allows implementations to * be liberal and rely on the caller to translate an exception into a step * failure as necessary. */ - protected abstract Set doHandle(StepExecution masterStepExecution, + protected abstract Set doHandle(StepExecution managerStepExecution, Set partitionStepExecutions) throws Exception; /** @@ -55,10 +56,10 @@ public abstract class AbstractPartitionHandler implements PartitionHandler { */ @Override public Collection handle(final StepExecutionSplitter stepSplitter, - final StepExecution masterStepExecution) throws Exception { - final Set stepExecutions = stepSplitter.split(masterStepExecution, gridSize); + final StepExecution managerStepExecution) throws Exception { + final Set stepExecutions = stepSplitter.split(managerStepExecution, gridSize); - return doHandle(masterStepExecution, stepExecutions); + return doHandle(managerStepExecution, stepExecutions); } /** diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java index 118a3e4a2..d86fe2783 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 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. @@ -33,6 +33,7 @@ import java.util.Collection; * load using a {@link PartitionHandler}. * * @author Dave Syer + * @author Mahmoud Ben Hassine * @since 2.0 */ public class PartitionStep extends AbstractStep { @@ -87,14 +88,14 @@ public class PartitionStep extends AbstractStep { /** * 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, summarising 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/resources/org/springframework/batch/core/configuration/xml/spring-batch-3.0.xsd b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-3.0.xsd index 1f0932960..3857e2796 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-3.0.xsd +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-3.0.xsd @@ -544,7 +544,7 @@ + Reference to a StepExecutionAggregator that will be used to merge the partition results back into the manager StepExecution]]> diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/RestartIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/RestartIntegrationTests.java index 6f32ae18e..0d40ab6fd 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/RestartIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/RestartIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 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,6 +37,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Dave Syer + * @author Mahmoud Ben Hassine * */ @ContextConfiguration(locations = "launch-context.xml") @@ -74,7 +75,7 @@ public class RestartIntegrationTests { ExampleItemReader.fail = true; JobParameters jobParameters = new JobParametersBuilder().addString("restart", "yes").toJobParameters(); - int beforeMaster = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:master'", Integer.class); + int beforeManager = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:manager'", Integer.class); int beforePartition = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME like 'step1:partition%'", Integer.class); ExampleItemWriter.clear(); @@ -88,11 +89,11 @@ public class RestartIntegrationTests { // Only 4 because the others were processed in the first attempt assertEquals(4, ExampleItemWriter.getItems().size()); - int afterMaster = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:master'", Integer.class); + int afterManager = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:manager'", Integer.class); int afterPartition = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME like 'step1:partition%'", Integer.class); // Two attempts - assertEquals(2, afterMaster-beforeMaster); + assertEquals(2, afterManager-beforeManager); // One failure and two successes assertEquals(3, afterPartition-beforePartition); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/VanillaIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/VanillaIntegrationTests.java index d502ab797..f062dcc0a 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/VanillaIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/VanillaIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 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. @@ -32,6 +32,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Dave Syer + * @author Mahmoud Ben Hassine * */ @ContextConfiguration(locations="launch-context.xml") @@ -58,12 +59,12 @@ public class VanillaIntegrationTests { @Test public void testLaunchJob() throws Exception { - int beforeMaster = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:master'", Integer.class); + int beforeManager = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:manager'", Integer.class); int beforePartition = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME like 'step1:partition%'", Integer.class); assertNotNull(jobLauncher.run(job, new JobParameters())); - int afterMaster = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:master'", Integer.class); + int afterManager = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME='step1:manager'", Integer.class); int afterPartition = jdbcTemplate.queryForObject("SELECT COUNT(*) from BATCH_STEP_EXECUTION where STEP_NAME like 'step1:partition%'", Integer.class); - assertEquals(1, afterMaster-beforeMaster); + assertEquals(1, afterManager-beforeManager); // Should be same as grid size in step splitter assertEquals(2, afterPartition-beforePartition); } diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/partition/launch-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/partition/launch-context.xml index 9ad0c22eb..390be7d28 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/partition/launch-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/partition/launch-context.xml @@ -11,7 +11,7 @@ - implements FactoryBean implements FactoryBean { 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 { } /** - * 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 { } /** - * 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 { } /** - * 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 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 bac0462b6..9af4324f3 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 @@ -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 handle(StepExecutionSplitter stepExecutionSplitter, - final StepExecution masterStepExecution) throws Exception { + final StepExecution managerStepExecution) throws Exception { - final Set split = stepExecutionSplitter.split(masterStepExecution, gridSize); + final Set 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 pollReplies(final StepExecution masterStepExecution, final Set split) throws Exception { + private Collection pollReplies(final StepExecution managerStepExecution, final Set split) throws Exception { final Collection result = new ArrayList<>(split.size()); Callable> callback = new Callable>() { @@ -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); diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java index 4a8936104..d2a45ffd6 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java @@ -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: * *
    - *
  • listens to {@link StepExecutionRequest}s coming from the master + *
  • listens to {@link StepExecutionRequest}s coming from the manager * on the input channel
  • *
  • 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 - *
  • replies to the master on the output channel (when the master step is + *
  • 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)
  • *
* @@ -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(); } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTests.java index ba147720a..1b32e1db1 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandlerTests.java @@ -48,6 +48,7 @@ import static org.mockito.Mockito.when; * * @author Will Schipp * @author Michael Minella + * @author Mahmoud Ben Hassine * */ public class MessageChannelPartitionHandlerTests { @@ -59,11 +60,11 @@ public class MessageChannelPartitionHandlerTests { //execute with no default set messageChannelPartitionHandler = new MessageChannelPartitionHandler(); //mock - StepExecution masterStepExecution = mock(StepExecution.class); + StepExecution managerStepExecution = mock(StepExecution.class); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); //execute - Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); + Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution); //verify assertTrue(executions.isEmpty()); } @@ -74,7 +75,7 @@ public class MessageChannelPartitionHandlerTests { //execute with no default set messageChannelPartitionHandler = new MessageChannelPartitionHandler(); //mock - StepExecution masterStepExecution = mock(StepExecution.class); + StepExecution managerStepExecution = mock(StepExecution.class); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); MessagingTemplate operations = mock(MessagingTemplate.class); Message message = mock(Message.class); @@ -88,7 +89,7 @@ public class MessageChannelPartitionHandlerTests { messageChannelPartitionHandler.setMessagingOperations(operations); //execute - Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); + Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution); //verify assertNotNull(executions); assertTrue(executions.isEmpty()); @@ -100,7 +101,7 @@ public class MessageChannelPartitionHandlerTests { //execute with no default set messageChannelPartitionHandler = new MessageChannelPartitionHandler(); //mock - StepExecution masterStepExecution = mock(StepExecution.class); + StepExecution managerStepExecution = mock(StepExecution.class); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); MessagingTemplate operations = mock(MessagingTemplate.class); Message message = mock(Message.class); @@ -116,7 +117,7 @@ public class MessageChannelPartitionHandlerTests { messageChannelPartitionHandler.setReplyChannel(replyChannel); //execute - Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); + Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution); //verify assertNotNull(executions); assertTrue(executions.isEmpty()); @@ -129,7 +130,7 @@ public class MessageChannelPartitionHandlerTests { //execute with no default set messageChannelPartitionHandler = new MessageChannelPartitionHandler(); //mock - StepExecution masterStepExecution = mock(StepExecution.class); + StepExecution managerStepExecution = mock(StepExecution.class); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); MessagingTemplate operations = mock(MessagingTemplate.class); Message message = mock(Message.class); @@ -142,7 +143,7 @@ public class MessageChannelPartitionHandlerTests { messageChannelPartitionHandler.setMessagingOperations(operations); //execute - messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); + messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution); } @Test @@ -151,7 +152,7 @@ public class MessageChannelPartitionHandlerTests { messageChannelPartitionHandler = new MessageChannelPartitionHandler(); //mock JobExecution jobExecution = new JobExecution(5L, new JobParameters()); - StepExecution masterStepExecution = new StepExecution("step1", jobExecution, 1L); + StepExecution managerStepExecution = new StepExecution("step1", jobExecution, 1L); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); MessagingTemplate operations = mock(MessagingTemplate.class); JobExplorer jobExplorer = mock(JobExplorer.class); @@ -179,7 +180,7 @@ public class MessageChannelPartitionHandlerTests { messageChannelPartitionHandler.afterPropertiesSet(); //execute - Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); + Collection executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution); //verify assertNotNull(executions); assertEquals(3, executions.size()); @@ -197,7 +198,7 @@ public class MessageChannelPartitionHandlerTests { messageChannelPartitionHandler = new MessageChannelPartitionHandler(); //mock JobExecution jobExecution = new JobExecution(5L, new JobParameters()); - StepExecution masterStepExecution = new StepExecution("step1", jobExecution, 1L); + StepExecution managerStepExecution = new StepExecution("step1", jobExecution, 1L); StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class); MessagingTemplate operations = mock(MessagingTemplate.class); JobExplorer jobExplorer = mock(JobExplorer.class); @@ -223,6 +224,6 @@ public class MessageChannelPartitionHandlerTests { messageChannelPartitionHandler.afterPropertiesSet(); //execute - messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution); + messageChannelPartitionHandler.handle(stepExecutionSplitter, managerStepExecution); } } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/RemotePartitioningMasterStepBuilderTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilderTests.java similarity index 95% rename from spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/RemotePartitioningMasterStepBuilderTests.java rename to spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilderTests.java index 3e6d2281a..c08b9faaf 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/RemotePartitioningMasterStepBuilderTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilderTests.java @@ -46,8 +46,8 @@ import static org.springframework.test.util.ReflectionTestUtils.getField; * @author Mahmoud Ben Hassine */ @RunWith(SpringRunner.class) -@ContextConfiguration(classes = {RemotePartitioningMasterStepBuilderTests.BatchConfiguration.class}) -public class RemotePartitioningMasterStepBuilderTests { +@ContextConfiguration(classes = {RemotePartitioningManagerStepBuilderTests.BatchConfiguration.class}) +public class RemotePartitioningManagerStepBuilderTests { @Autowired private JobRepository jobRepository; @@ -151,7 +151,7 @@ public class RemotePartitioningMasterStepBuilderTests { } @Test - public void testMasterStepCreationWhenPollingRepository() { + public void testManagerStepCreationWhenPollingRepository() { // given int gridSize = 5; int startLimit = 3; @@ -162,7 +162,7 @@ public class RemotePartitioningMasterStepBuilderTests { StepExecutionAggregator stepExecutionAggregator = (result, executions) -> { }; // when - Step step = new RemotePartitioningManagerStepBuilder("masterStep") + Step step = new RemotePartitioningManagerStepBuilder("managerStep") .repository(jobRepository) .outputChannel(outputChannel) .partitioner("workerStep", partitioner) @@ -196,7 +196,7 @@ public class RemotePartitioningMasterStepBuilderTests { } @Test - public void testMasterStepCreationWhenAggregatingReplies() { + public void testManagerStepCreationWhenAggregatingReplies() { // given int gridSize = 5; int startLimit = 3; @@ -205,7 +205,7 @@ public class RemotePartitioningMasterStepBuilderTests { StepExecutionAggregator stepExecutionAggregator = (result, executions) -> { }; // when - Step step = new RemotePartitioningManagerStepBuilder("masterStep") + Step step = new RemotePartitioningManagerStepBuilder("managerStep") .repository(jobRepository) .outputChannel(outputChannel) .partitioner("workerStep", partitioner) diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingIdAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingIdAttrTests.xml index b7e92bc00..d977fe0a9 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingIdAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingIdAttrTests.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingMessageTemplateAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingMessageTemplateAttrTests.xml index ccf1bd943..0d349d5c9 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingMessageTemplateAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingMessageTemplateAttrTests.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingReplyChannelAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingReplyChannelAttrTests.xml index 82d102e6e..6187eebc2 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingReplyChannelAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingReplyChannelAttrTests.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingStepAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingStepAttrTests.xml index fa17d9c8b..be4f74893 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingStepAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserMissingStepAttrTests.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml index f7d3fb94a..8dacd1876 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingMasterParserTests.xml @@ -11,7 +11,7 @@ http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd"> @@ -37,7 +37,7 @@
- + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingIdAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingIdAttrTests.xml index 5b201bfff..e071d2e5a 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingIdAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingIdAttrTests.xml @@ -6,8 +6,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingInputChannelAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingInputChannelAttrTests.xml index bcc5becca..8b5ea7750 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingInputChannelAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingInputChannelAttrTests.xml @@ -6,8 +6,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingItemWriterAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingItemWriterAttrTests.xml index a7af0eef6..b490becd1 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingItemWriterAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingItemWriterAttrTests.xml @@ -6,8 +6,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingOutputChannelAttrTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingOutputChannelAttrTests.xml index 2284e3c84..75b1d89b0 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingOutputChannelAttrTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserMissingOutputChannelAttrTests.xml @@ -6,8 +6,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserNoProcessorTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserNoProcessorTests.xml index 05b96dda5..3c1842e34 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserNoProcessorTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserNoProcessorTests.xml @@ -7,9 +7,9 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserTests.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserTests.xml index f5cd56468..1254a6ed3 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserTests.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/config/xml/RemoteChunkingSlaveParserTests.xml @@ -7,9 +7,9 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/batch-integration - https://www.springframework.org/schema/batch-integration/spring-batch-integration-3.1.xsd"> + https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd"> - diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/JmsIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/JmsIntegrationTests-context.xml index af7f911ff..e885b61b0 100755 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/JmsIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/JmsIntegrationTests-context.xml @@ -54,7 +54,7 @@ - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/PollingIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/PollingIntegrationTests-context.xml index e255e9dce..e4ac22666 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/PollingIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/PollingIntegrationTests-context.xml @@ -35,7 +35,7 @@ - + diff --git a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/VanillaIntegrationTests-context.xml b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/VanillaIntegrationTests-context.xml index 55fb1a444..dddc94ed1 100644 --- a/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/VanillaIntegrationTests-context.xml +++ b/spring-batch-integration/src/test/resources/org/springframework/batch/integration/partition/VanillaIntegrationTests-context.xml @@ -43,7 +43,7 @@ - + diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java index 861557de5..aa7163eda 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2019 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. @@ -102,7 +102,7 @@ public class ManagerConfiguration { } /* - * Configure master step components + * Configure manager step components */ @Bean public ListItemReader itemReader() { diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java index f190cbcca..a99805568 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java @@ -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. @@ -38,9 +38,9 @@ import org.springframework.integration.jms.dsl.Jms; * It uses the {@link RemoteChunkingWorkerBuilder} to configure an * {@link IntegrationFlow} in order to: *
    - *
  • receive requests from the master
  • + *
  • receive requests from the manager
  • *
  • process chunks with the configured item processor and writer
  • - *
  • send replies to the master
  • + *
  • send replies to the manager
  • *
* * @author Mahmoud Ben Hassine @@ -67,7 +67,7 @@ public class WorkerConfiguration { } /* - * Configure inbound flow (requests coming from the master) + * Configure inbound flow (requests coming from the manager) */ @Bean public DirectChannel requests() { @@ -83,7 +83,7 @@ public class WorkerConfiguration { } /* - * Configure outbound flow (replies going to the master) + * Configure outbound flow (replies going to the manager) */ @Bean public DirectChannel replies() { diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java index d7b5adf63..c0b2d9761 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java @@ -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. @@ -37,7 +37,7 @@ import org.springframework.integration.jms.dsl.Jms; /** * This configuration class is for the worker side of the remote partitioning sample. - * Each worker will process a partition sent by the master step. + * Each worker will process a partition sent by the manager step. * * @author Mahmoud Ben Hassine */ @@ -55,7 +55,7 @@ public class WorkerConfiguration { } /* - * Configure inbound flow (requests coming from the master) + * Configure inbound flow (requests coming from the manager) */ @Bean public DirectChannel requests() { diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/RemotePartitioningJobFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/RemotePartitioningJobFunctionalTests.java index d4f83086a..d594cc21c 100644 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/RemotePartitioningJobFunctionalTests.java +++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/RemotePartitioningJobFunctionalTests.java @@ -81,7 +81,7 @@ public abstract class RemotePartitioningJobFunctionalTests { // then Assert.assertEquals(ExitStatus.COMPLETED.getExitCode(), jobExecution.getExitStatus().getExitCode()); - Assert.assertEquals(4, jobExecution.getStepExecutions().size()); // master + 3 workers + Assert.assertEquals(4, jobExecution.getStepExecutions().size()); // manager + 3 workers } @After