org.springframework.yarn.batch.am
Class AbstractBatchAppmaster

java.lang.Object
  extended by org.springframework.yarn.support.LifecycleObjectSupport
      extended by org.springframework.yarn.am.AbstractAppmaster
          extended by org.springframework.yarn.am.AbstractServicesAppmaster
              extended by org.springframework.yarn.am.AbstractEventingAppmaster
                  extended by org.springframework.yarn.batch.am.AbstractBatchAppmaster
All Implemented Interfaces:
EventListener, Aware, BeanFactoryAware, InitializingBean, ApplicationListener<org.springframework.yarn.event.AbstractYarnEvent>, Lifecycle, Phased, SmartLifecycle, org.springframework.yarn.am.ContainerLauncherInterceptor, org.springframework.yarn.am.YarnAppmaster, BatchYarnAppmaster
Direct Known Subclasses:
BatchAppmaster

public abstract class AbstractBatchAppmaster
extends org.springframework.yarn.am.AbstractEventingAppmaster
implements BatchYarnAppmaster, org.springframework.yarn.am.ContainerLauncherInterceptor

Base application master for running batch jobs.

Author:
Janne Valkealahti

Constructor Summary
AbstractBatchAppmaster()
           
 
Method Summary
 void addPartitionedStepExecutionStateListener(PartitionedStepExecutionStateListener listener)
          Adds the partitioned step execution state listener.
 void addStepSplits(StepExecution masterStepExecution, String remoteStepName, Set<StepExecution> stepExecutions, Map<StepExecution,org.springframework.yarn.am.container.ContainerRequestHint> resourceRequests)
          Adds the step splits.
 List<StepExecution> getStepExecutions()
          Gets the step executions.
 YarnJobLauncher getYarnJobLauncher()
           
protected  void onContainerAllocated(Container container)
           
protected  void onContainerCompleted(ContainerStatus status)
           
protected  void onContainerLaunched(Container container)
           
protected  void onInit()
           
 ContainerLaunchContext preLaunch(Container container, ContainerLaunchContext context)
           
 void setYarnJobLauncher(YarnJobLauncher yarnJobLauncher)
           
 
Methods inherited from class org.springframework.yarn.am.AbstractEventingAppmaster
onApplicationEvent, onContainerLaunchRequestFailed
 
Methods inherited from class org.springframework.yarn.am.AbstractServicesAppmaster
getAllocator, getLauncher, getMonitor, setAllocator, setLauncher, setMonitor
 
Methods inherited from class org.springframework.yarn.am.AbstractAppmaster
addAppmasterStateListener, doStop, finishAppmaster, getApplicationAttemptId, getAppmasterClientService, getAppmasterService, getAppmasterTrackService, getCommands, getConfiguration, getContainerAssign, getEnvironment, getParameters, getResourceLocalizer, getTemplate, notifyCompleted, registerAppmaster, setCommands, setCommands, setConfiguration, setContainerAssign, setEnvironment, setFinalApplicationStatus, setParameters, setResourceLocalizer, setTemplate
 
Methods inherited from class org.springframework.yarn.support.LifecycleObjectSupport
afterPropertiesSet, doStart, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.yarn.am.YarnAppmaster
addAppmasterStateListener, setEnvironment, setParameters, submitApplication
 

Constructor Detail

AbstractBatchAppmaster

public AbstractBatchAppmaster()
Method Detail

onInit

protected void onInit()
               throws Exception
Overrides:
onInit in class org.springframework.yarn.am.AbstractAppmaster
Throws:
Exception

onContainerAllocated

protected void onContainerAllocated(Container container)
Overrides:
onContainerAllocated in class org.springframework.yarn.am.AbstractEventingAppmaster

onContainerLaunched

protected void onContainerLaunched(Container container)
Overrides:
onContainerLaunched in class org.springframework.yarn.am.AbstractEventingAppmaster

onContainerCompleted

protected void onContainerCompleted(ContainerStatus status)
Overrides:
onContainerCompleted in class org.springframework.yarn.am.AbstractEventingAppmaster

preLaunch

public ContainerLaunchContext preLaunch(Container container,
                                        ContainerLaunchContext context)
Specified by:
preLaunch in interface org.springframework.yarn.am.ContainerLauncherInterceptor

setYarnJobLauncher

@Autowired(required=false)
public void setYarnJobLauncher(YarnJobLauncher yarnJobLauncher)

getYarnJobLauncher

public YarnJobLauncher getYarnJobLauncher()

addPartitionedStepExecutionStateListener

public void addPartitionedStepExecutionStateListener(PartitionedStepExecutionStateListener listener)
Adds the partitioned step execution state listener.

Specified by:
addPartitionedStepExecutionStateListener in interface BatchYarnAppmaster
Parameters:
listener - the listener

getStepExecutions

public List<StepExecution> getStepExecutions()
Gets the step executions.

Specified by:
getStepExecutions in interface BatchYarnAppmaster
Returns:
the step executions

addStepSplits

public void addStepSplits(StepExecution masterStepExecution,
                          String remoteStepName,
                          Set<StepExecution> stepExecutions,
                          Map<StepExecution,org.springframework.yarn.am.container.ContainerRequestHint> resourceRequests)
Adds the step splits.

Specified by:
addStepSplits in interface BatchYarnAppmaster
Parameters:
masterStepExecution - the partitioned steps parent step execution
remoteStepName - the remote step name
stepExecutions - the step executions splits
resourceRequests - the request data for step executions