类 AbstractPartitionHandler
- java.lang.Object
- org.springframework.batch.core.partition.support.AbstractPartitionHandler
- 所有已实现的接口:
PartitionHandler
- 直接已知子类:
TaskExecutorPartitionHandler
public abstract class AbstractPartitionHandler extends java.lang.Object implements PartitionHandler
BasePartitionHandler
implementation providing common base features. Subclasses are expected to implement only thedoHandle(org.springframework.batch.core.StepExecution, java.util.Set)
method which returns with the result of the execution(s) or an exception if the step failed to process.- 作者:
- Sebastien Gerard, Dave Syer
构造器概要
构造器 构造器 说明 AbstractPartitionHandler()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract java.util.Set<StepExecution>
doHandle(StepExecution masterStepExecution, java.util.Set<StepExecution> partitionStepExecutions)
Executes the specifiedStepExecution
instances and returns an updated view of them.int
getGridSize()
Returns the number of step executions.java.util.Collection<StepExecution>
handle(StepExecutionSplitter stepSplitter, StepExecution masterStepExecution)
Main entry point forPartitionHandler
interface.void
setGridSize(int gridSize)
Passed to theStepExecutionSplitter
in thehandle(StepExecutionSplitter, StepExecution)
method, instructing it how manyStepExecution
instances are required, ideally.
构造器详细资料
AbstractPartitionHandler
public AbstractPartitionHandler()
方法详细资料
doHandle
protected abstract java.util.Set<StepExecution> doHandle(StepExecution masterStepExecution, java.util.Set<StepExecution> partitionStepExecutions) throws java.lang.Exception
Executes the specifiedStepExecution
instances and returns an updated view of them. Throws anException
if anything goes wrong.- 参数:
masterStepExecution
- the whole partition executionpartitionStepExecutions
- theStepExecution
instances to execute- 返回:
- an updated view of these completed
StepExecution
instances - 抛出:
java.lang.Exception
- if anything goes wrong. This allows implementations to be liberal and rely on the caller to translate an exception into a step failure as necessary.
handle
public java.util.Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution masterStepExecution) throws java.lang.Exception
从接口复制的说明:PartitionHandler
Main entry point forPartitionHandler
interface. The splitter creates all the executions that need to be farmed out, along with their input parameters (in the form of theirExecutionContext
). The master step execution is used to identify the partition and group together the results logically.- 指定者:
handle
在接口中PartitionHandler
- 参数:
stepSplitter
- a strategy for generating a collection ofStepExecution
instancesmasterStepExecution
- the master step execution for the whole partition- 返回:
- a collection of completed
StepExecution
instances - 抛出:
java.lang.Exception
- if anything goes wrong. This allows implementations to be liberal and rely on the caller to translate an exception into a step failure as necessary.- 另请参阅:
PartitionHandler.handle(StepExecutionSplitter, StepExecution)
getGridSize
public int getGridSize()
Returns the number of step executions.- 返回:
- the number of step executions
setGridSize
public void setGridSize(int gridSize)
Passed to theStepExecutionSplitter
in thehandle(StepExecutionSplitter, StepExecution)
method, instructing it how manyStepExecution
instances are required, ideally. TheStepExecutionSplitter
is allowed to ignore the grid size in the case of a restart, since the input data partitions must be preserved.- 参数:
gridSize
- the number of step executions that will be created