Class ContainerLaunchContext
ContainerLaunchContext represents all of the information
needed by the NodeManager to launch a container.
It includes details such as:
ContainerIdof the container.Resourceallocated to the container.- User to whom the container is allocated.
- Security tokens (if security is enabled).
-
LocalResourcenecessary for running the container such as binaries, jar, shared-objects, side-files etc. - Optional, application-specific binary service data.
- Environment variables for the launched process.
- Command to launch the container.
- Retry strategy when container exits with failure.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Map<ApplicationAccessType,String> Get theApplicationACLs for the application.Get the list of commands for launching the container.abstract ContainerRetryContextGet theContainerRetryContextto relaunch container.Get environment variables for the container.abstract Map<String,LocalResource> GetLocalResourcerequired by the container.abstract Map<String,ByteBuffer> Get application-specific binary service data.abstract ByteBufferGet all the tokens needed by this container.abstract ByteBufferGet the configuration used by RM to renew tokens.static ContainerLaunchContextnewInstance(Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls) static ContainerLaunchContextnewInstance(Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls, ContainerRetryContext containerRetryContext) abstract voidSet theApplicationACLs for the application.abstract voidsetCommands(List<String> commands) Add the list of commands for launching the container.abstract voidsetContainerRetryContext(ContainerRetryContext containerRetryContext) Set theContainerRetryContextto relaunch container.abstract voidsetEnvironment(Map<String, String> environment) Add environment variables for the container.abstract voidsetLocalResources(Map<String, LocalResource> localResources) SetLocalResourcerequired by the container.abstract voidsetServiceData(Map<String, ByteBuffer> serviceData) Set application-specific binary service data.abstract voidsetTokens(ByteBuffer tokens) Set security tokens needed by this container.abstract voidsetTokensConf(ByteBuffer tokensConf) Set the configuration used by RM to renew the tokens.
-
Constructor Details
-
ContainerLaunchContext
public ContainerLaunchContext()
-
-
Method Details
-
newInstance
@Public @Stable public static ContainerLaunchContext newInstance(Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls) -
newInstance
@Public @Unstable public static ContainerLaunchContext newInstance(Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls, ContainerRetryContext containerRetryContext) -
getTokens
Get all the tokens needed by this container. It may include file-system tokens, ApplicationMaster related tokens if this container is an ApplicationMaster or framework level tokens needed by this container to communicate to various services in a secure manner.- Returns:
- tokens needed by this container.
-
setTokens
Set security tokens needed by this container.- Parameters:
tokens- security tokens
-
getTokensConf
Get the configuration used by RM to renew tokens.- Returns:
- The configuration used by RM to renew the tokens.
-
setTokensConf
Set the configuration used by RM to renew the tokens.- Parameters:
tokensConf- The configuration used by RM to renew the tokens
-
getLocalResources
GetLocalResourcerequired by the container.- Returns:
- all
LocalResourcerequired by the container
-
setLocalResources
SetLocalResourcerequired by the container. All pre-existing Map entries are cleared before adding the new Map- Parameters:
localResources-LocalResourcerequired by the container
-
getServiceData
Get application-specific binary service data. This is a map keyed by the name of each
AuxiliaryServicethat is configured on a NodeManager and value correspond to the application specific data targeted for the keyedAuxiliaryService.This will be used to initialize this application on the specific
AuxiliaryServicerunning on the NodeManager by callingAuxiliaryService.initializeApplication(ApplicationInitializationContext)- Returns:
- application-specific binary service data
-
setServiceData
Set application-specific binary service data. This is a map keyed by the name of each
AuxiliaryServicethat is configured on a NodeManager and value correspond to the application specific data targeted for the keyedAuxiliaryService. All pre-existing Map entries are preserved.- Parameters:
serviceData- application-specific binary service data
-
getEnvironment
Get environment variables for the container.- Returns:
- environment variables for the container
-
setEnvironment
Add environment variables for the container. All pre-existing Map entries are cleared before adding the new Map- Parameters:
environment- environment variables for the container
-
getCommands
Get the list of commands for launching the container.- Returns:
- the list of commands for launching the container
-
setCommands
Add the list of commands for launching the container. All pre-existing List entries are cleared before adding the new List- Parameters:
commands- the list of commands for launching the container
-
getApplicationACLs
Get theApplicationACLs for the application.- Returns:
- all the
ApplicationACLs
-
setApplicationACLs
Set theApplicationACLs for the application. All pre-existing Map entries are cleared before adding the new Map- Parameters:
acls-ApplicationACLs for the application
-
getContainerRetryContext
Get theContainerRetryContextto relaunch container.- Returns:
ContainerRetryContextto relaunch container.
-
setContainerRetryContext
@Public @Unstable public abstract void setContainerRetryContext(ContainerRetryContext containerRetryContext) Set theContainerRetryContextto relaunch container.- Parameters:
containerRetryContext-ContainerRetryContextto relaunch container.
-