Class PartitionStep
java.lang.Object
org.springframework.batch.core.step.AbstractStep
org.springframework.batch.core.partition.support.PartitionStep
- All Implemented Interfaces:
Step
,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 interface org.springframework.batch.core.Step
STEP_TYPE_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Assert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top superclass.protected void
doExecute
(StepExecution stepExecution) Delegate execution to thePartitionHandler
provided.protected PartitionHandler
protected StepExecutionSplitter
void
setPartitionHandler
(PartitionHandler partitionHandler) APartitionHandler
which can send out step executions for remote processing and bring back the results.void
setStepExecutionAggregator
(StepExecutionAggregator stepExecutionAggregator) AStepExecutionAggregator
that can aggregate step executions when they come back from the handler.void
setStepExecutionSplitter
(StepExecutionSplitter stepExecutionSplitter) Public setter for mandatory propertyStepExecutionSplitter
.Methods inherited from class org.springframework.batch.core.step.AbstractStep
close, doExecutionRegistration, doExecutionRelease, execute, getCompositeListener, getJobRepository, getName, getStartLimit, isAllowStartIfComplete, open, registerStepExecutionListener, setAllowStartIfComplete, setBeanName, setJobRepository, setMeterRegistry, setName, setObservationConvention, setObservationRegistry, setStartLimit, setStepExecutionListeners, toString
-
Constructor Details
-
PartitionStep
public PartitionStep()
-
-
Method Details
-
setPartitionHandler
APartitionHandler
which can send out step executions for remote processing and bring back the results.- Parameters:
partitionHandler
- thePartitionHandler
to set
-
setStepExecutionAggregator
AStepExecutionAggregator
that can aggregate step executions when they come back from the handler. Defaults to aDefaultStepExecutionAggregator
.- Parameters:
stepExecutionAggregator
- theStepExecutionAggregator
to set
-
setStepExecutionSplitter
Public setter for mandatory propertyStepExecutionSplitter
.- Parameters:
stepExecutionSplitter
- theStepExecutionSplitter
to set
-
afterPropertiesSet
Assert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top superclass.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classAbstractStep
- Throws:
Exception
- See Also:
-
doExecute
Delegate execution to thePartitionHandler
provided. TheStepExecution
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 thePartitionHandler
. The individual step executions and their input parameters (throughExecutionContext
) for the partition elements are provided by theStepExecutionSplitter
.- Specified by:
doExecute
in classAbstractStep
- Parameters:
stepExecution
- the manager step execution for the partition- Throws:
Exception
- checked exception thrown by implementation- See Also:
-
getStepExecutionSplitter
-
getPartitionHandler
-