public abstract class AbstractContainerClusterAppmaster extends AbstractEventingAppmaster implements ContainerClusterAppmaster
ContainerClusterAppmaster
.Constructor and Description |
---|
AbstractContainerClusterAppmaster() |
Modifier and Type | Method and Description |
---|---|
ContainerCluster |
createContainerCluster(java.lang.String clusterId,
ProjectionData projectionData) |
ContainerCluster |
createContainerCluster(java.lang.String clusterId,
java.lang.String clusterDef,
ProjectionData projectionData,
java.util.Map<java.lang.String,java.lang.Object> extraProperties) |
void |
destroyContainerCluster(java.lang.String id) |
protected Grid |
doCreateGrid() |
protected ProjectedGrid |
doCreateProjectedGrid(Grid grid) |
protected void |
doStart()
Subclasses may implement this method with the start behavior.
|
protected void |
doStop()
Subclasses may implement this method with the stop behavior.
|
java.util.Map<java.lang.String,ContainerCluster> |
getContainerClusters() |
protected void |
handleSatisfyStateData(ContainerCluster cluster,
SatisfyStateData satisfyData) |
protected void |
killContainer(org.apache.hadoop.yarn.api.records.Container container) |
void |
modifyContainerCluster(java.lang.String id,
ProjectionData data) |
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 java.util.List<java.lang.String> |
onContainerLaunchCommands(org.apache.hadoop.yarn.api.records.Container container,
ContainerCluster cluster,
java.util.List<java.lang.String> commands)
Called when a container is launched for sub classes to do
a final modifications in these commands.
|
protected void |
onContainerLaunched(org.apache.hadoop.yarn.api.records.Container container)
Invoked when
ContainerLaunchedEvent is received as an
application event. |
protected void |
onInit()
Global application master instance specific
ApplicationAttemptId
is build during this init method. |
void |
setGridProjectionFactoryLocator(GridProjectionFactoryLocator gridProjectionFactoryLocator)
Sets the
GridProjectionFactoryLocator used to find factories
which are creating an instances of GridProjection s. |
void |
setProjectionDataRegistry(ProjectionDataRegistry projectionDataRegistry) |
void |
setStateMachineFactory(org.springframework.statemachine.config.StateMachineFactory<ClusterState,ClusterEvent> stateMachineFactory) |
void |
startContainerCluster(java.lang.String id) |
void |
stopContainerCluster(java.lang.String id) |
void |
submitApplication()
Submit and run application.
|
getRegisteredContainers, onApplicationEvent, onContainerLaunchRequestFailed, shutdownContainers
getAllocator, getLauncher, getMonitor, setAllocator, setLauncher, setMonitor
addAppmasterStateListener, 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, setTemplate
afterPropertiesSet, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAppmasterStateListener, setEnvironment, setParameters
protected void onInit() throws java.lang.Exception
AbstractAppmaster
ApplicationAttemptId
is build during this init method.onInit
in class AbstractEventingAppmaster
java.lang.Exception
- exceptionLifecycleObjectSupport.onInit()
protected void doStart()
LifecycleObjectSupport
LifecycleObjectSupport.lifecycleLock
.doStart
in class LifecycleObjectSupport
protected void doStop()
LifecycleObjectSupport
LifecycleObjectSupport.lifecycleLock
.doStop
in class AbstractAppmaster
public void submitApplication()
YarnAppmaster
submitApplication
in interface YarnAppmaster
protected void onContainerAllocated(org.apache.hadoop.yarn.api.records.Container container)
AbstractEventingAppmaster
ContainerAllocationEvent
is received as an
application event. Wrapped Container
is passed to a method.onContainerAllocated
in class AbstractEventingAppmaster
container
- the containerprotected void onContainerLaunched(org.apache.hadoop.yarn.api.records.Container container)
AbstractEventingAppmaster
ContainerLaunchedEvent
is received as an
application event. Wrapped Container
is passed to a method.onContainerLaunched
in class AbstractEventingAppmaster
container
- the containerprotected void onContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerStatus status)
AbstractEventingAppmaster
ContainerCompletedEvent
is received as an
application event. Wrapped ContainerStatus
is passed to a method.onContainerCompleted
in class AbstractEventingAppmaster
status
- the container statuspublic java.util.Map<java.lang.String,ContainerCluster> getContainerClusters()
getContainerClusters
in interface ContainerClusterAppmaster
public ContainerCluster createContainerCluster(java.lang.String clusterId, ProjectionData projectionData)
createContainerCluster
in interface ContainerClusterAppmaster
public ContainerCluster createContainerCluster(java.lang.String clusterId, java.lang.String clusterDef, ProjectionData projectionData, java.util.Map<java.lang.String,java.lang.Object> extraProperties)
createContainerCluster
in interface ContainerClusterAppmaster
public void startContainerCluster(java.lang.String id)
startContainerCluster
in interface ContainerClusterAppmaster
public void stopContainerCluster(java.lang.String id)
stopContainerCluster
in interface ContainerClusterAppmaster
public void destroyContainerCluster(java.lang.String id)
destroyContainerCluster
in interface ContainerClusterAppmaster
public void modifyContainerCluster(java.lang.String id, ProjectionData data)
modifyContainerCluster
in interface ContainerClusterAppmaster
@Autowired public void setStateMachineFactory(org.springframework.statemachine.config.StateMachineFactory<ClusterState,ClusterEvent> stateMachineFactory)
@Autowired public void setGridProjectionFactoryLocator(GridProjectionFactoryLocator gridProjectionFactoryLocator)
GridProjectionFactoryLocator
used to find factories
which are creating an instances of GridProjection
s.gridProjectionFactoryLocator
- the grid projection factory locator@Autowired(required=false) public void setProjectionDataRegistry(ProjectionDataRegistry projectionDataRegistry)
protected Grid doCreateGrid()
protected ProjectedGrid doCreateProjectedGrid(Grid grid)
protected void handleSatisfyStateData(ContainerCluster cluster, SatisfyStateData satisfyData)
protected void killContainer(org.apache.hadoop.yarn.api.records.Container container)
protected java.util.List<java.lang.String> onContainerLaunchCommands(org.apache.hadoop.yarn.api.records.Container container, ContainerCluster cluster, java.util.List<java.lang.String> commands)
container
- the containercluster
- the clustercommands
- the original commands