Spring for Apache Hadoop

org.springframework.yarn.batch.partition
Class StaticBatchPartitionHandler

java.lang.Object
  extended by org.springframework.yarn.batch.partition.AbstractBatchPartitionHandler
      extended by org.springframework.yarn.batch.partition.StaticBatchPartitionHandler
All Implemented Interfaces:
org.springframework.batch.core.partition.PartitionHandler

public class StaticBatchPartitionHandler
extends AbstractBatchPartitionHandler

Implementation of Spring Batch PartitionHandler which does partitioning based on static grid size.

Author:
Janne Valkealahti

Constructor Summary
StaticBatchPartitionHandler(AbstractBatchAppmaster batchAppmaster)
          Instantiates a new static batch partition handler.
StaticBatchPartitionHandler(AbstractBatchAppmaster batchAppmaster, int gridSize)
          Instantiates a new static batch partition handler.
 
Method Summary
protected  java.util.Set<org.springframework.batch.core.StepExecution> createStepExecutionSplits(org.springframework.batch.core.partition.StepExecutionSplitter stepSplitter, org.springframework.batch.core.StepExecution stepExecution)
           
 void setGridSize(int gridSize)
          Passed to the StepExecutionSplitter in the AbstractBatchPartitionHandler.handle(StepExecutionSplitter, StepExecution) method, instructing it how many StepExecution instances are required, ideally.
 
Methods inherited from class org.springframework.yarn.batch.partition.AbstractBatchPartitionHandler
createResourceRequestData, getContainerResolver, getStepName, handle, setContainerResolver, setStepName, waitCompleteState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticBatchPartitionHandler

public StaticBatchPartitionHandler(AbstractBatchAppmaster batchAppmaster)
Instantiates a new static batch partition handler.

Parameters:
batchAppmaster - the batch appmaster

StaticBatchPartitionHandler

public StaticBatchPartitionHandler(AbstractBatchAppmaster batchAppmaster,
                                   int gridSize)
Instantiates a new static batch partition handler.

Parameters:
batchAppmaster - the batch appmaster
gridSize - the grid size
Method Detail

setGridSize

public void setGridSize(int gridSize)
Passed to the StepExecutionSplitter in the AbstractBatchPartitionHandler.handle(StepExecutionSplitter, StepExecution) method, instructing it how many StepExecution instances are required, ideally. The StepExecutionSplitter is allowed to ignore the grid size in the case of a restart, since the input data partitions must be preserved.

Parameters:
gridSize - the number of step executions that will be created

createStepExecutionSplits

protected java.util.Set<org.springframework.batch.core.StepExecution> createStepExecutionSplits(org.springframework.batch.core.partition.StepExecutionSplitter stepSplitter,
                                                                                                org.springframework.batch.core.StepExecution stepExecution)
                                                                                         throws java.lang.Exception
Specified by:
createStepExecutionSplits in class AbstractBatchPartitionHandler
Throws:
java.lang.Exception

Spring for Apache Hadoop