Class SimplePartitioner
- java.lang.Object
- org.springframework.batch.core.partition.support.SimplePartitioner
- All Implemented Interfaces:
Partitioner
- Direct Known Subclasses:
BasicPartitioner
public class SimplePartitioner extends java.lang.Object implements Partitioner
Simplest possible implementation ofPartitioner
. Just creates a set of emptyExecutionContext
instances, and labels them as{partition0, partition1, ..., partitionN}
, whereN
is the grid size.- Since:
- 2.0
- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description SimplePartitioner()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,ExecutionContext>
partition(int gridSize)
Create a set of distinctExecutionContext
instances together with a unique identifier for each one.
Method Detail
partition
public java.util.Map<java.lang.String,ExecutionContext> partition(int gridSize)
Description copied from interface:Partitioner
Create a set of distinctExecutionContext
instances together with a unique identifier for each one. The identifiers should be short, mnemonic values, and only have to be unique within the return value (e.g. use an incrementer).- Specified by:
partition
in interfacePartitioner
- Parameters:
gridSize
- the size of the map to return- Returns:
- a map from identifier to input parameters