org.apache.hadoop.yarn.api.records
Class ContainerLaunchContext

java.lang.Object
  extended by org.apache.hadoop.yarn.api.records.ContainerLaunchContext

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class ContainerLaunchContext
extends Object

ContainerLaunchContext represents all of the information needed by the NodeManager to launch a container.

It includes details such as:

See Also:
ContainerManagementProtocol.startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest)

Constructor Summary
ContainerLaunchContext()
           
 
Method Summary
abstract  Map<ApplicationAccessType,String> getApplicationACLs()
          Get the ApplicationACLs for the application.
abstract  List<String> getCommands()
          Get the list of commands for launching the container.
abstract  Map<String,String> getEnvironment()
          Get environment variables for the container.
abstract  Map<String,LocalResource> getLocalResources()
          Get LocalResource required by the container.
abstract  Map<String,ByteBuffer> getServiceData()
           Get application-specific binary service data.
abstract  ByteBuffer getTokens()
          Get all the tokens needed by this container.
static ContainerLaunchContext newInstance(Map<String,LocalResource> localResources, Map<String,String> environment, List<String> commands, Map<String,ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType,String> acls)
           
abstract  void setApplicationACLs(Map<ApplicationAccessType,String> acls)
          Set the ApplicationACLs for the application.
abstract  void setCommands(List<String> commands)
          Add the list of commands for launching the container.
abstract  void setEnvironment(Map<String,String> environment)
          Add environment variables for the container.
abstract  void setLocalResources(Map<String,LocalResource> localResources)
          Set LocalResource required by the container.
abstract  void setServiceData(Map<String,ByteBuffer> serviceData)
           Set application-specific binary service data.
abstract  void setTokens(ByteBuffer tokens)
          Set security tokens needed by this container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerLaunchContext

public ContainerLaunchContext()
Method Detail

newInstance

@InterfaceAudience.Public
@InterfaceStability.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)

getTokens

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract ByteBuffer 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

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setTokens(ByteBuffer tokens)
Set security tokens needed by this container.

Parameters:
tokens - security tokens

getLocalResources

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Map<String,LocalResource> getLocalResources()
Get LocalResource required by the container.

Returns:
all LocalResource required by the container

setLocalResources

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setLocalResources(Map<String,LocalResource> localResources)
Set LocalResource required by the container. All pre-existing Map entries are cleared before adding the new Map

Parameters:
localResources - LocalResource required by the container

getServiceData

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Map<String,ByteBuffer> getServiceData()

Get application-specific binary service data. This is a map keyed by the name of each AuxiliaryService that is configured on a NodeManager and value correspond to the application specific data targeted for the keyed AuxiliaryService.

This will be used to initialize this application on the specific AuxiliaryService running on the NodeManager by calling AuxiliaryService.initializeApplication(ApplicationInitializationContext)

Returns:
application-specific binary service data

setServiceData

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setServiceData(Map<String,ByteBuffer> serviceData)

Set application-specific binary service data. This is a map keyed by the name of each AuxiliaryService that is configured on a NodeManager and value correspond to the application specific data targeted for the keyed AuxiliaryService. All pre-existing Map entries are preserved.

Parameters:
serviceData - application-specific binary service data

getEnvironment

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Map<String,String> getEnvironment()
Get environment variables for the container.

Returns:
environment variables for the container

setEnvironment

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setEnvironment(Map<String,String> environment)
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

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract List<String> getCommands()
Get the list of commands for launching the container.

Returns:
the list of commands for launching the container

setCommands

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setCommands(List<String> commands)
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

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Map<ApplicationAccessType,String> getApplicationACLs()
Get the ApplicationACLs for the application.

Returns:
all the ApplicationACLs

setApplicationACLs

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setApplicationACLs(Map<ApplicationAccessType,String> acls)
Set the ApplicationACLs for the application. All pre-existing Map entries are cleared before adding the new Map

Parameters:
acls - ApplicationACLs for the application


Copyright © 2013 Apache Software Foundation. All Rights Reserved.