Class PartitionStep
java.lang.Object
org.springframework.batch.core.step.AbstractStep
org.springframework.batch.core.partition.PartitionStep
- All Implemented Interfaces:
Step, StoppableStep, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
Implementation of
Step which partitions the execution and spreads the load
using a PartitionHandler.- Since:
- 2.0
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Field Summary
Fields inherited from class AbstractStep
observationRegistryFields inherited from interface Step
STEP_TYPE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionPartitionStep(JobRepository jobRepository) Create a new instance of aPartitionStepwith the given job repository. -
Method Summary
Modifier and TypeMethodDescriptionvoidAssert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top superclass.protected voiddoExecute(StepExecution stepExecution) Delegate execution to thePartitionHandlerprovided.protected PartitionHandlerprotected StepExecutionSplittervoidsetPartitionHandler(PartitionHandler partitionHandler) APartitionHandlerwhich can send out step executions for remote processing and bring back the results.voidsetStepExecutionAggregator(StepExecutionAggregator stepExecutionAggregator) AStepExecutionAggregatorthat can aggregate step executions when they come back from the handler.voidsetStepExecutionSplitter(StepExecutionSplitter stepExecutionSplitter) Public setter for mandatory propertyStepExecutionSplitter.Methods inherited from class AbstractStep
close, doExecutionRegistration, doExecutionRelease, execute, getCompositeListener, getJobRepository, getName, getStartLimit, isAllowStartIfComplete, open, registerStepExecutionListener, setAllowStartIfComplete, setBeanName, setJobRepository, setName, setObservationRegistry, setStartLimit, setStepExecutionListeners, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface StoppableStep
stop
-
Constructor Details
-
PartitionStep
Create a new instance of aPartitionStepwith the given job repository.- Parameters:
jobRepository- the job repository to use. Must not be null.- Since:
- 6.0
-
-
Method Details
-
setPartitionHandler
APartitionHandlerwhich can send out step executions for remote processing and bring back the results.- Parameters:
partitionHandler- thePartitionHandlerto set
-
setStepExecutionAggregator
AStepExecutionAggregatorthat can aggregate step executions when they come back from the handler. Defaults to aDefaultStepExecutionAggregator.- Parameters:
stepExecutionAggregator- theStepExecutionAggregatorto set
-
setStepExecutionSplitter
Public setter for mandatory propertyStepExecutionSplitter.- Parameters:
stepExecutionSplitter- theStepExecutionSplitterto set
-
afterPropertiesSet
Assert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top superclass.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractStep- Throws:
Exception- See Also:
-
doExecute
Delegate execution to thePartitionHandlerprovided. TheStepExecutionpassed 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 thePartitionHandler. The individual step executions and their input parameters (throughExecutionContext) for the partition elements are provided by theStepExecutionSplitter.- Specified by:
doExecutein classAbstractStep- Parameters:
stepExecution- the manager step execution for the partition- Throws:
Exception- checked exception thrown by implementation- See Also:
-
getStepExecutionSplitter
-
getPartitionHandler
-