Skip to content

Commit 08c4cb1

Browse files
committed
Move core partitioning APIs under org.springframework.batch.core.partition
Resolves #4849
1 parent 9eafb31 commit 08c4cb1

File tree

24 files changed

+54
-39
lines changed

24 files changed

+54
-39
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
import org.springframework.batch.core.job.flow.Flow;
3636
import org.springframework.batch.core.launch.JobLauncher;
3737
import org.springframework.batch.core.partition.PartitionHandler;
38-
import org.springframework.batch.core.partition.support.Partitioner;
39-
import org.springframework.batch.core.partition.support.StepExecutionAggregator;
38+
import org.springframework.batch.core.partition.Partitioner;
39+
import org.springframework.batch.core.partition.StepExecutionAggregator;
4040
import org.springframework.batch.core.repository.JobRepository;
4141
import org.springframework.batch.core.step.AbstractStep;
4242
import org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder;
@@ -61,7 +61,6 @@
6161
import org.springframework.batch.item.ItemWriter;
6262
import org.springframework.batch.repeat.CompletionPolicy;
6363
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
64-
import org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate;
6564
import org.springframework.beans.factory.BeanNameAware;
6665
import org.springframework.beans.factory.FactoryBean;
6766
import org.springframework.classify.BinaryExceptionClassifier;
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2009 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.batch.core.partition.support;
17+
package org.springframework.batch.core.partition;
18+
19+
import org.springframework.batch.core.partition.support.SimplePartitioner;
1820

1921
import java.util.Collection;
2022

@@ -33,6 +35,7 @@
3335
* </p>
3436
*
3537
* @author Dave Syer
38+
* @author Mahmoud Ben Hassine
3639
* @since 2.1.3
3740
*
3841
*/
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2022 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,14 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.batch.core.partition.support;
17+
package org.springframework.batch.core.partition;
1818

1919
import org.springframework.batch.core.BatchStatus;
2020
import org.springframework.batch.core.JobExecutionException;
2121
import org.springframework.batch.core.Step;
2222
import org.springframework.batch.core.StepExecution;
23-
import org.springframework.batch.core.partition.PartitionHandler;
24-
import org.springframework.batch.core.partition.StepExecutionSplitter;
23+
import org.springframework.batch.core.partition.support.DefaultStepExecutionAggregator;
2524
import org.springframework.batch.core.step.AbstractStep;
2625
import org.springframework.batch.item.ExecutionContext;
2726
import org.springframework.util.Assert;
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2022 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.batch.core.partition.support;
17+
package org.springframework.batch.core.partition;
1818

1919
import java.util.Map;
2020

@@ -28,6 +28,7 @@
2828
*
2929
* @author Dave Syer
3030
* @author Taeik Lim
31+
* @author Mahmoud Ben Hassine
3132
* @since 2.0
3233
*/
3334
@FunctionalInterface
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2022 the original author or authors.
2+
* Copyright 2008-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,18 +13,19 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.batch.core.partition.support;
16+
package org.springframework.batch.core.partition;
1717

1818
import java.util.Collection;
1919

2020
import org.springframework.batch.core.StepExecution;
2121

2222
/**
23-
* Strategy for a aggregating step executions, usually when they are the result of
23+
* Strategy for aggregating step executions, usually when they are the result of
2424
* partitioned or remote execution.
2525
*
2626
* @author Dave Syer
2727
* @author Taeik Lim
28+
* @author Mahmoud Ben Hassine
2829
* @since 2.1
2930
*
3031
*/

spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.springframework.batch.core.BatchStatus;
2020
import org.springframework.batch.core.ExitStatus;
2121
import org.springframework.batch.core.StepExecution;
22+
import org.springframework.batch.core.partition.StepExecutionAggregator;
2223
import org.springframework.util.Assert;
2324

2425
import java.util.Collection;

spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/MultiResourcePartitioner.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.HashMap;
2121
import java.util.Map;
2222

23+
import org.springframework.batch.core.partition.Partitioner;
2324
import org.springframework.batch.item.ExecutionContext;
2425
import org.springframework.core.io.Resource;
2526
import org.springframework.util.Assert;

spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import org.springframework.batch.core.JobExecution;
2525
import org.springframework.batch.core.StepExecution;
26+
import org.springframework.batch.core.partition.StepExecutionAggregator;
2627
import org.springframework.batch.core.repository.explore.JobExplorer;
2728
import org.springframework.beans.factory.InitializingBean;
2829
import org.springframework.util.Assert;

spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimplePartitioner.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22+
import org.springframework.batch.core.partition.Partitioner;
2223
import org.springframework.batch.item.ExecutionContext;
2324

2425
/**

spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import org.springframework.batch.core.JobInstance;
3030
import org.springframework.batch.core.Step;
3131
import org.springframework.batch.core.StepExecution;
32+
import org.springframework.batch.core.partition.PartitionNameProvider;
33+
import org.springframework.batch.core.partition.Partitioner;
3234
import org.springframework.batch.core.partition.StepExecutionSplitter;
3335
import org.springframework.batch.core.repository.JobRepository;
3436
import org.springframework.batch.item.ExecutionContext;

spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/PartitionStepBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import org.springframework.batch.core.Step;
1919
import org.springframework.batch.core.partition.PartitionHandler;
2020
import org.springframework.batch.core.partition.StepExecutionSplitter;
21-
import org.springframework.batch.core.partition.support.PartitionStep;
22-
import org.springframework.batch.core.partition.support.Partitioner;
21+
import org.springframework.batch.core.partition.PartitionStep;
22+
import org.springframework.batch.core.partition.Partitioner;
2323
import org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter;
24-
import org.springframework.batch.core.partition.support.StepExecutionAggregator;
24+
import org.springframework.batch.core.partition.StepExecutionAggregator;
2525
import org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler;
2626
import org.springframework.core.task.SyncTaskExecutor;
2727
import org.springframework.core.task.TaskExecutor;

spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/StepBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.springframework.batch.core.Job;
1919
import org.springframework.batch.core.Step;
2020
import org.springframework.batch.core.job.flow.Flow;
21-
import org.springframework.batch.core.partition.support.Partitioner;
21+
import org.springframework.batch.core.partition.Partitioner;
2222
import org.springframework.batch.core.repository.JobRepository;
2323
import org.springframework.batch.core.step.tasklet.Tasklet;
2424
import org.springframework.batch.repeat.CompletionPolicy;

spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch.xsd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@
549549
</xsd:documentation>
550550
<xsd:appinfo>
551551
<tool:annotation kind="ref">
552-
<tool:expected-type type="org.springframework.batch.core.partition.support.StepExecutionAggregator" />
552+
<tool:expected-type type="org.springframework.batch.core.partition.StepExecutionAggregator" />
553553
</tool:annotation>
554554
</xsd:appinfo>
555555
</xsd:annotation>
@@ -561,7 +561,7 @@
561561
</xsd:documentation>
562562
<xsd:appinfo>
563563
<tool:annotation kind="ref">
564-
<tool:expected-type type="org.springframework.batch.core.partition.support.Partitioner" />
564+
<tool:expected-type type="org.springframework.batch.core.partition.Partitioner" />
565565
</tool:annotation>
566566
</xsd:appinfo>
567567
</xsd:annotation>

spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/PartitionStepParserTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2023 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,8 +34,8 @@
3434
import org.springframework.batch.core.StepExecution;
3535
import org.springframework.batch.core.partition.PartitionHandler;
3636
import org.springframework.batch.core.partition.StepExecutionSplitter;
37-
import org.springframework.batch.core.partition.support.PartitionStep;
38-
import org.springframework.batch.core.partition.support.StepExecutionAggregator;
37+
import org.springframework.batch.core.partition.PartitionStep;
38+
import org.springframework.batch.core.partition.StepExecutionAggregator;
3939
import org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler;
4040
import org.springframework.batch.core.repository.JobRepository;
4141
import org.springframework.batch.core.step.tasklet.TaskletStep;

spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBeanTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.springframework.batch.core.job.flow.FlowStep;
2929
import org.springframework.batch.core.job.flow.support.SimpleFlow;
3030
import org.springframework.batch.core.partition.PartitionHandler;
31-
import org.springframework.batch.core.partition.support.PartitionStep;
31+
import org.springframework.batch.core.partition.PartitionStep;
3232
import org.springframework.batch.core.partition.support.SimplePartitioner;
3333
import org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler;
3434
import org.springframework.batch.core.step.JobRepositorySupport;
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2023 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.batch.core.partition.support;
16+
package org.springframework.batch.core.partition;
1717

1818
import java.time.LocalDateTime;
1919
import java.util.Arrays;
@@ -29,6 +29,9 @@
2929
import org.springframework.batch.core.JobExecution;
3030
import org.springframework.batch.core.JobParameters;
3131
import org.springframework.batch.core.StepExecution;
32+
import org.springframework.batch.core.partition.support.DefaultStepExecutionAggregator;
33+
import org.springframework.batch.core.partition.support.SimplePartitioner;
34+
import org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter;
3235
import org.springframework.batch.core.repository.JobRepository;
3336
import org.springframework.batch.core.repository.support.JdbcJobRepositoryFactoryBean;
3437
import org.springframework.jdbc.support.JdbcTransactionManager;

spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregatorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
import org.springframework.batch.core.ExitStatus;
2121
import org.springframework.batch.core.JobExecution;
2222
import org.springframework.batch.core.StepExecution;
23+
import org.springframework.batch.core.partition.StepExecutionAggregator;
2324

2425
import java.util.Arrays;
2526
import java.util.Collections;

spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2023 the original author or authors.
2+
* Copyright 2008-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,6 +32,8 @@
3232
import org.springframework.batch.core.JobParameters;
3333
import org.springframework.batch.core.Step;
3434
import org.springframework.batch.core.StepExecution;
35+
import org.springframework.batch.core.partition.PartitionNameProvider;
36+
import org.springframework.batch.core.partition.Partitioner;
3537
import org.springframework.batch.core.repository.JobRepository;
3638
import org.springframework.batch.core.repository.support.JdbcJobRepositoryFactoryBean;
3739
import org.springframework.batch.core.step.tasklet.TaskletStep;

spring-batch-core/src/test/resources/org/springframework/batch/core/partition/launch-context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<bean id="job1" parent="simpleJob">
99
<property name="steps">
1010
<bean name="step1:manager"
11-
class="org.springframework.batch.core.partition.support.PartitionStep">
11+
class="org.springframework.batch.core.partition.PartitionStep">
1212
<property name="partitionHandler">
1313
<bean
1414
class="org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler">

spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import org.springframework.batch.core.repository.explore.JobExplorer;
2222
import org.springframework.batch.core.partition.PartitionHandler;
2323
import org.springframework.batch.core.partition.StepExecutionSplitter;
24-
import org.springframework.batch.core.partition.support.Partitioner;
25-
import org.springframework.batch.core.partition.support.StepExecutionAggregator;
24+
import org.springframework.batch.core.partition.Partitioner;
25+
import org.springframework.batch.core.partition.StepExecutionAggregator;
2626
import org.springframework.batch.core.repository.JobRepository;
2727
import org.springframework.batch.core.step.builder.PartitionStepBuilder;
2828
import org.springframework.batch.core.step.builder.StepBuilder;

spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.springframework.batch.core.StepExecutionListener;
2525
import org.springframework.batch.core.repository.explore.JobExplorer;
2626
import org.springframework.batch.core.job.flow.Flow;
27-
import org.springframework.batch.core.partition.support.Partitioner;
27+
import org.springframework.batch.core.partition.Partitioner;
2828
import org.springframework.batch.core.repository.JobRepository;
2929
import org.springframework.batch.core.step.StepLocator;
3030
import org.springframework.batch.core.step.builder.FlowStepBuilder;

spring-batch-integration/src/test/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilderTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2022 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
2424
import org.springframework.batch.core.Step;
2525
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
2626
import org.springframework.batch.core.partition.PartitionHandler;
27-
import org.springframework.batch.core.partition.support.Partitioner;
28-
import org.springframework.batch.core.partition.support.StepExecutionAggregator;
27+
import org.springframework.batch.core.partition.Partitioner;
28+
import org.springframework.batch.core.partition.StepExecutionAggregator;
2929
import org.springframework.batch.core.repository.JobRepository;
3030
import org.springframework.beans.factory.annotation.Autowired;
3131
import org.springframework.context.annotation.Bean;

spring-batch-samples/src/main/java/org/springframework/batch/samples/common/ColumnRangePartitioner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2014 the original author or authors.
2+
* Copyright 2009-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020

2121
import javax.sql.DataSource;
2222

23-
import org.springframework.batch.core.partition.support.Partitioner;
23+
import org.springframework.batch.core.partition.Partitioner;
2424
import org.springframework.batch.item.ExecutionContext;
2525
import org.springframework.jdbc.core.JdbcOperations;
2626
import org.springframework.jdbc.core.JdbcTemplate;

spring-batch-samples/src/main/java/org/springframework/batch/samples/loom/JobConfigurationForRunningPartitionedStepsWithVirtualThreads.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
2323
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
2424
import org.springframework.batch.core.configuration.annotation.StepScope;
2525
import org.springframework.batch.core.job.builder.JobBuilder;
26-
import org.springframework.batch.core.partition.support.Partitioner;
26+
import org.springframework.batch.core.partition.Partitioner;
2727
import org.springframework.batch.core.repository.JobRepository;
2828
import org.springframework.batch.core.step.builder.StepBuilder;
2929
import org.springframework.batch.core.step.tasklet.Tasklet;

0 commit comments

Comments
 (0)