Spring for Apache Hadoop

org.springframework.yarn.am
Class AbstractProcessingAppmaster

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.AbstractProcessingAppmaster
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, ContainerLauncherInterceptor
Direct Known Subclasses:
StaticAppmaster

public abstract class AbstractProcessingAppmaster
extends AbstractServicesAppmaster
implements ContainerLauncherInterceptor

Base application master implementation which handles a simple life-cycle scenario of; allocate, launch, monitor.

We can say that the actual implementation of this is very static in terms of what application master can do. Everything needs to be known prior to starting the life-cycle. Implementation should know how many containers will participate the application, what those containers will do and what is the expected outcome from a container execution.

Author:
Janne Valkealahti

Constructor Summary
AbstractProcessingAppmaster()
           
 
Method Summary
protected  void onContainerAllocated(org.apache.hadoop.yarn.api.records.Container container)
          Called when container has been allocated.
protected  void onContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerStatus status)
          Called when container has been completed.
protected  void onInit()
          Global application master instance specific ApplicationAttemptId is build during this init method.
 org.apache.hadoop.yarn.api.records.ContainerLaunchContext preLaunch(org.apache.hadoop.yarn.api.records.ContainerLaunchContext context)
          Invoked before the ContainerLaunchContext is used to launch the container.
 
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
 

Constructor Detail

AbstractProcessingAppmaster

public AbstractProcessingAppmaster()
Method Detail

onInit

protected void onInit()
               throws java.lang.Exception
Description copied from class: AbstractAppmaster
Global application master instance specific ApplicationAttemptId is build during this init method.

Overrides:
onInit in class AbstractAppmaster
Throws:
java.lang.Exception
See Also:
LifecycleObjectSupport.onInit()

preLaunch

public org.apache.hadoop.yarn.api.records.ContainerLaunchContext preLaunch(org.apache.hadoop.yarn.api.records.ContainerLaunchContext context)
Description copied from interface: ContainerLauncherInterceptor
Invoked before the ContainerLaunchContext is used to launch the container.

Specified by:
preLaunch in interface ContainerLauncherInterceptor
Parameters:
context - the ContainerLaunchContext
Returns:
Unchanged or modified ContainerLaunchContext

onContainerAllocated

protected void onContainerAllocated(org.apache.hadoop.yarn.api.records.Container container)
Called when container has been allocated. Default implementation is not doing anything.

Parameters:
container - the container

onContainerCompleted

protected void onContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerStatus status)
Called when container has been completed. Default implementation is not doing anything.

Parameters:
status - the status

Spring for Apache Hadoop