public abstract class AbstractEventingAppmaster extends AbstractServicesAppmaster implements org.springframework.context.ApplicationListener<AbstractYarnEvent>
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.
| Constructor and Description |
|---|
AbstractEventingAppmaster() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Map<org.apache.hadoop.yarn.api.records.Container,ContainerRegisterInfo> |
getRegisteredContainers() |
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. |
protected void |
onInit()
Global application master instance specific
ApplicationAttemptId
is build during this init method. |
protected boolean |
shutdownContainers()
Shutdown containers.
|
getAllocator, getLauncher, getMonitor, setAllocator, setLauncher, setMonitoraddAppmasterStateListener, doStop, finishAppmaster, getApplicationAttemptId, getAppmasterClientService, getAppmasterService, getAppmasterTrackService, getCmTemplate, getCommands, getCommands, getConfiguration, getContainerAssign, getContainerShutdown, getEnvironment, getEnvironment, getParameters, getResourceLocalizer, getTemplate, notifyCompleted, registerAppmaster, setCommands, setCommands, setCommands, setCommands, setConfiguration, setContainerAssign, setEnvironment, setEnvironment, setFinalApplicationStatus, setParameters, setResourceLocalizer, setTemplateafterPropertiesSet, doStart, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stopprotected void onInit()
throws java.lang.Exception
AbstractAppmasterApplicationAttemptId
is build during this init method.onInit in class AbstractAppmasterjava.lang.Exception - exceptionLifecycleObjectSupport.onInit()public void onApplicationEvent(AbstractYarnEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<AbstractYarnEvent>protected void onContainerAllocated(org.apache.hadoop.yarn.api.records.Container container)
ContainerAllocationEvent is received as an
application event. Wrapped Container is passed to a method.container - the containerprotected void onContainerLaunched(org.apache.hadoop.yarn.api.records.Container container)
ContainerLaunchedEvent is received as an
application event. Wrapped Container is passed to a method.container - the containerprotected void onContainerLaunchRequestFailed(org.apache.hadoop.yarn.api.records.Container container)
ContainerLaunchRequestFailedEvent is received as an
application event. Wrapped Container is passed to a method.container - the containerprotected void onContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerStatus status)
ContainerCompletedEvent is received as an
application event. Wrapped ContainerStatus is passed to a method.status - the container statusprotected boolean shutdownContainers()
AbstractAppmastershutdownContainers in class AbstractAppmasterprotected java.util.Map<org.apache.hadoop.yarn.api.records.Container,ContainerRegisterInfo> getRegisteredContainers()