|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.partition.support.SimpleStepExecutionSplitter
public class SimpleStepExecutionSplitter
Generic implementation of StepExecutionSplitter that delegates to a
Partitioner to generate ExecutionContext instances. Takes
care of restartability and identifying the step executions from previous runs
of the same job. The generated StepExecution instances have names
that identify them uniquely in the partition. The name is constructed from a
base (name of the target step) plus a suffix taken from the
Partitioner identifiers, separated by a colon, e.g.
{step1:partition0, step1:partition1, ...}.
| Constructor Summary | |
|---|---|
SimpleStepExecutionSplitter()
Default constructor for convenience in configuration. |
|
SimpleStepExecutionSplitter(JobRepository jobRepository,
boolean allowStartIfComplete,
java.lang.String stepName,
Partitioner partitioner)
Construct a SimpleStepExecutionSplitter from its mandatory
properties. |
|
SimpleStepExecutionSplitter(JobRepository jobRepository,
Step step,
Partitioner partitioner)
Deprecated. use SimpleStepExecutionSplitter(JobRepository, boolean, String, Partitioner) instead |
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
Check mandatory properties (step name, job repository and partitioner). |
java.lang.String |
getStepName()
The name of the step configuration that will be executed remotely. |
void |
setAllowStartIfComplete(boolean allowStartIfComplete)
Flag to indicate that the partition target step is allowed to start if an execution is complete. |
void |
setJobRepository(JobRepository jobRepository)
The job repository that will be used to manage the persistence of the delegate step executions. |
void |
setPartitioner(Partitioner partitioner)
The Partitioner that will be used to generate step execution meta
data for the target step. |
void |
setStepName(java.lang.String stepName)
The name of the target step that will be executed across the partitions. |
java.util.Set<StepExecution> |
split(StepExecution stepExecution,
int gridSize)
Partition the provided StepExecution into a set of parallel
executable instances with the same parent JobExecution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleStepExecutionSplitter()
public SimpleStepExecutionSplitter(JobRepository jobRepository,
boolean allowStartIfComplete,
java.lang.String stepName,
Partitioner partitioner)
SimpleStepExecutionSplitter from its mandatory
properties.
jobRepository - the JobRepositoryallowStartIfComplete - flag specifying preferences on restartstepName - the target step namepartitioner - a Partitioner to use for generating input
parameters
@Deprecated
public SimpleStepExecutionSplitter(JobRepository jobRepository,
Step step,
Partitioner partitioner)
SimpleStepExecutionSplitter(JobRepository, boolean, String, Partitioner) instead
SimpleStepExecutionSplitter from its mandatory
properties.
jobRepository - the JobRepositorystep - the target step (a local version of it), used to extract the
name and allowStartIfComplete flagspartitioner - a Partitioner to use for generating input
parameters| Method Detail |
|---|
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.ExceptionInitializingBean.afterPropertiesSet()public void setAllowStartIfComplete(boolean allowStartIfComplete)
allowStartIfComplete - the value to setStep.isAllowStartIfComplete()public void setJobRepository(JobRepository jobRepository)
jobRepository - the JobRepository to setpublic void setPartitioner(Partitioner partitioner)
Partitioner that will be used to generate step execution meta
data for the target step.
partitioner - the partitioner to setpublic void setStepName(java.lang.String stepName)
stepName - the step name to setpublic java.lang.String getStepName()
StepExecutionSplitter
getStepName in interface StepExecutionSplitterStepExecutionSplitter.getStepName()
public java.util.Set<StepExecution> split(StepExecution stepExecution,
int gridSize)
throws JobExecutionException
StepExecutionSplitterStepExecution into a set of parallel
executable instances with the same parent JobExecution. The grid
size will be treated as a hint for the size of the collection to be
returned. It may or may not correspond to the physical size of an
execution grid.StepExecutionSplitter should expect
it to reconstitute the state of the last failed execution and only return
those executions that need to be restarted. Thus the grid size hint will
be ignored on a restart.
split in interface StepExecutionSplitterstepExecution - the StepExecution to be partitioned.gridSize - a hint for the splitter if the size of the grid is known
StepExecution instances for remote processing
JobExecutionException - if the split cannot be madeStepExecutionSplitter.split(StepExecution, int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||