org.springframework.batch.core.partition.support

## 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
  Direct Known Subclasses:
    PartitionStep

      public class PartitionStep
      extends AbstractStep

  Implementation of `Step` which partitions the execution and spreads the load using a `PartitionHandler`.
  Since:
    2.0
  Author:
    Dave Syer

- - ### Field Summary

    - ### Fields inherited from interface org.springframework.batch.core.Step

      `STEP_TYPE_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PartitionStep()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterPropertiesSet()` Assert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top superclass.
    `protected void` | `doExecute(StepExecution stepExecution)` Delegate execution to the `PartitionHandler` provided.
    `protected PartitionHandler` | `getPartitionHandler()`
    `protected StepExecutionSplitter` | `getStepExecutionSplitter()`
    `void` | `setPartitionHandler(PartitionHandler partitionHandler)` A `PartitionHandler` which can send out step executions for remote processing and bring back the results.
    `void` | `setStepExecutionAggregator(StepExecutionAggregator stepExecutionAggregator)` A `StepExecutionAggregator` that can aggregate step executions when they come back from the handler.
    `void` | `setStepExecutionSplitter(StepExecutionSplitter stepExecutionSplitter)` Public setter for mandatory property `StepExecutionSplitter`.

    - ### Methods inherited from class org.springframework.batch.core.step.AbstractStep

      `close, doExecutionRegistration, doExecutionRelease, execute, getCompositeListener, getJobRepository, getName, getStartLimit, isAllowStartIfComplete, open, registerStepExecutionListener, setAllowStartIfComplete, setBeanName, setJobRepository, setName, setStartLimit, setStepExecutionListeners, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PartitionStep

          public PartitionStep()

  - ### Method Detail

    - #### setPartitionHandler

          public void setPartitionHandler(PartitionHandler partitionHandler)

      A `PartitionHandler` which can send out step executions for remote processing and bring back the results.
      Parameters:
        `partitionHandler` - the `PartitionHandler` to set

    - #### setStepExecutionAggregator

          public void setStepExecutionAggregator(StepExecutionAggregator stepExecutionAggregator)

      A `StepExecutionAggregator` that can aggregate step executions when they come back from the handler. Defaults to a `DefaultStepExecutionAggregator`.
      Parameters:
        `stepExecutionAggregator` - the `StepExecutionAggregator` to set

    - #### setStepExecutionSplitter

          public void setStepExecutionSplitter(StepExecutionSplitter stepExecutionSplitter)

      Public setter for mandatory property `StepExecutionSplitter`.
      Parameters:
        `stepExecutionSplitter` - the `StepExecutionSplitter` to set

    - #### afterPropertiesSet

          public void afterPropertiesSet()
                                  throws java.lang.Exception

      Assert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top superclass.
      Specified by:
        `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
      Overrides:
        `afterPropertiesSet` in class `AbstractStep`
      Throws:
        `java.lang.Exception`
      See Also:
        `AbstractStep.afterPropertiesSet()`

    - #### doExecute

          protected void doExecute(StepExecution stepExecution)
                            throws java.lang.Exception

      Delegate execution to the `PartitionHandler` provided. The `StepExecution` passed in here becomes the parent or master execution for the partition, summarising the status on exit of the logical grouping of work carried out by the `PartitionHandler`. The individual step executions and their input parameters (through `ExecutionContext`) for the partition elements are provided by the `StepExecutionSplitter`.
      Specified by:
        `doExecute` in class `AbstractStep`
      Parameters:
        `stepExecution` - the master step execution for the partition
      Throws:
        `java.lang.Exception`
      See Also:
        `Step.execute(StepExecution)`

    - #### getStepExecutionSplitter

          protected StepExecutionSplitter getStepExecutionSplitter()

    - #### getPartitionHandler

          protected PartitionHandler getPartitionHandler()