Spring for Apache Hadoop

org.springframework.yarn.am
Class AbstractEventingAppmaster

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
All Implemented Interfaces:
java.util.EventListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationListener<AbstractYarnEvent>, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
Direct Known Subclasses:
AbstractBatchAppmaster, StaticEventingAppmaster

public abstract class AbstractEventingAppmaster
extends AbstractServicesAppmaster
implements org.springframework.context.ApplicationListener<AbstractYarnEvent>

Base implementation of application master where life-cycle is based on events rather than a static information existing prior the start of an instance.

Life-cycle of this instance is not bound to information or states existing prior the startup of an application master. Containers can be requested and launched on demand and application master is then responsible to know when it's time to bail out and end the application.

Due to complex need of event communication, the actual event system is abstracted order to plug different systems for a need of various use cases.

Author:
Janne Valkealahti

Constructor Summary
AbstractEventingAppmaster()
           
 
Method Summary
 void onApplicationEvent(AbstractYarnEvent event)
           
protected  void onContainerAllocated(org.apache.hadoop.yarn.api.records.Container container)
          Invoked when ContainerAllocationEvent is received as an application event.
protected  void onContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerStatus status)
          Invoked when ContainerCompletedEvent is received as an application event.
protected  void onContainerLaunched(org.apache.hadoop.yarn.api.records.Container container)
          Invoked when ContainerLaunchedEvent is received as an application event.
protected  void onContainerLaunchRequestFailed(org.apache.hadoop.yarn.api.records.Container container)
          Invoked when ContainerLaunchRequestFailedEvent is received as an application event.
 
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, onInit, 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

AbstractEventingAppmaster

public AbstractEventingAppmaster()
Method Detail

onApplicationEvent

public void onApplicationEvent(AbstractYarnEvent event)
Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener<AbstractYarnEvent>

onContainerAllocated

protected void onContainerAllocated(org.apache.hadoop.yarn.api.records.Container container)
Invoked when ContainerAllocationEvent is received as an application event. Wrapped Container is passed to a method.

Parameters:
container - the container

onContainerLaunched

protected void onContainerLaunched(org.apache.hadoop.yarn.api.records.Container container)
Invoked when ContainerLaunchedEvent is received as an application event. Wrapped Container is passed to a method.

Parameters:
container - the container

onContainerLaunchRequestFailed

protected void onContainerLaunchRequestFailed(org.apache.hadoop.yarn.api.records.Container container)
Invoked when ContainerLaunchRequestFailedEvent is received as an application event. Wrapped Container is passed to a method.

Parameters:
container - the container

onContainerCompleted

protected void onContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerStatus status)
Invoked when ContainerCompletedEvent is received as an application event. Wrapped ContainerStatus is passed to a method.

Parameters:
status - the container status

Spring for Apache Hadoop