public abstract class AbstractAppmaster extends LifecycleObjectSupport
Constructor and Description |
---|
AbstractAppmaster() |
Modifier and Type | Method and Description |
---|---|
void |
addAppmasterStateListener(AppmasterStateListener listener)
Adds the appmaster state listener.
|
protected void |
doStop()
Subclasses may implement this method with the stop behavior.
|
protected org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse |
finishAppmaster()
Finish appmaster by sending request to resource manager.
|
protected org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
getApplicationAttemptId()
Gets the application attempt id.
|
protected AppmasterService |
getAppmasterClientService()
Gets a client facing
AppmasterService set to this instance. |
protected AppmasterService |
getAppmasterService()
Gets a
AppmasterService set to this instance. |
protected AppmasterTrackService |
getAppmasterTrackService()
Gets a
AppmasterTrackService set to this instance. |
protected AppmasterCmOperations |
getCmTemplate(org.apache.hadoop.yarn.api.records.Container container)
Creates an
AppmasterCmOperations template. |
java.util.List<java.lang.String> |
getCommands()
Gets the commands.
|
java.util.List<java.lang.String> |
getCommands(java.lang.String id)
Gets the commands.
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Gets the Yarn configuration.
|
ContainerAssign<java.lang.Object> |
getContainerAssign()
Gets the container assign.
|
protected ContainerShutdown |
getContainerShutdown()
Gets a
ContainerShutdown set to this instance. |
java.util.Map<java.lang.String,java.lang.String> |
getEnvironment()
Gets the environment variables.
|
java.util.Map<java.lang.String,java.lang.String> |
getEnvironment(java.lang.String id) |
java.util.Properties |
getParameters()
Gets the parameters.
|
ResourceLocalizer |
getResourceLocalizer()
Gets the resource localizer.
|
AppmasterRmOperations |
getTemplate()
Gets the
AppmasterRmOperations template. |
protected void |
notifyCompleted()
Notify completed state to appmaster state listeners.
|
protected void |
onInit()
Global application master instance specific
ApplicationAttemptId
is build during this init method. |
protected org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse |
registerAppmaster()
Register appmaster.
|
void |
setCommands(java.util.List<java.lang.String> commands)
Sets the commands.
|
void |
setCommands(java.lang.String[] commands)
Sets the commands.
|
void |
setCommands(java.lang.String id,
java.util.List<java.lang.String> commands)
Sets the commands with an identifier.
|
void |
setCommands(java.lang.String id,
java.lang.String[] commands)
Sets the commands with an identifier.
|
void |
setConfiguration(org.apache.hadoop.conf.Configuration configuration)
Sets the Yarn configuration.
|
void |
setContainerAssign(ContainerAssign<java.lang.Object> containerAssign)
Sets the container assign.
|
void |
setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Sets the environment variables.
|
void |
setEnvironment(java.lang.String id,
java.util.Map<java.lang.String,java.lang.String> environment) |
protected void |
setFinalApplicationStatus(org.apache.hadoop.yarn.api.records.FinalApplicationStatus finalApplicationStatus)
Sets the final application status.
|
void |
setParameters(java.util.Properties parameters)
Sets the parameters.
|
void |
setResourceLocalizer(ResourceLocalizer resourceLocalizer)
Sets the resource localizer.
|
void |
setTemplate(AppmasterRmOperations template)
Sets the
AppmasterRmOperations template. |
protected boolean |
shutdownContainers()
Shutdown containers.
|
afterPropertiesSet, doStart, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stop
protected void onInit() throws java.lang.Exception
ApplicationAttemptId
is build during this init method.onInit
in class LifecycleObjectSupport
java.lang.Exception
- exceptionLifecycleObjectSupport.onInit()
protected void doStop()
LifecycleObjectSupport
LifecycleObjectSupport.lifecycleLock
.doStop
in class LifecycleObjectSupport
public AppmasterRmOperations getTemplate()
AppmasterRmOperations
template.AppmasterRmOperations
templatepublic void setTemplate(AppmasterRmOperations template)
AppmasterRmOperations
template.template
- the new AppmasterRmOperations
templatepublic java.util.Map<java.lang.String,java.lang.String> getEnvironment()
public java.util.Map<java.lang.String,java.lang.String> getEnvironment(java.lang.String id)
public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
environment
- the environment variablespublic void setEnvironment(java.lang.String id, java.util.Map<java.lang.String,java.lang.String> environment)
public java.util.Properties getParameters()
public void setParameters(java.util.Properties parameters)
parameters
- the new parameterspublic org.apache.hadoop.conf.Configuration getConfiguration()
public void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
configuration
- the new Yarn configurationpublic java.util.List<java.lang.String> getCommands()
public java.util.List<java.lang.String> getCommands(java.lang.String id)
id
- the commands identifierpublic void setCommands(java.util.List<java.lang.String> commands)
commands
- the new commandspublic void setCommands(java.lang.String id, java.util.List<java.lang.String> commands)
id
- the commands identifiercommands
- the new commandspublic void setCommands(java.lang.String[] commands)
commands
- the new commandspublic void setCommands(java.lang.String id, java.lang.String[] commands)
id
- the commands identifiercommands
- the new commandsprotected org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()
public void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
resourceLocalizer
- the new resource localizerpublic ResourceLocalizer getResourceLocalizer()
public void addAppmasterStateListener(AppmasterStateListener listener)
listener
- the listenerpublic ContainerAssign<java.lang.Object> getContainerAssign()
public void setContainerAssign(ContainerAssign<java.lang.Object> containerAssign)
containerAssign
- the new container assignprotected void setFinalApplicationStatus(org.apache.hadoop.yarn.api.records.FinalApplicationStatus finalApplicationStatus)
finalApplicationStatus
- the new final application statusprotected void notifyCompleted()
protected AppmasterService getAppmasterService()
AppmasterService
set to this instance.AppmasterService
protected AppmasterService getAppmasterClientService()
AppmasterService
set to this instance.AppmasterService
protected ContainerShutdown getContainerShutdown()
ContainerShutdown
set to this instance.ContainerShutdown
protected AppmasterTrackService getAppmasterTrackService()
AppmasterTrackService
set to this instance.AppmasterTrackService
protected org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerAppmaster()
protected org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finishAppmaster()
FinalApplicationStatus.SUCCEEDED
which
can be changed using method setFinalApplicationStatus(FinalApplicationStatus)
.protected AppmasterCmOperations getCmTemplate(org.apache.hadoop.yarn.api.records.Container container)
AppmasterCmOperations
template.container
- the containerprotected boolean shutdownContainers()