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

java.lang.Object
  extended by org.apache.hadoop.yarn.api.records.Container
All Implemented Interfaces:
Comparable<Container>

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class Container
extends Object
implements Comparable<Container>

Container represents an allocated resource in the cluster.

The ResourceManager is the sole authority to allocate any Container to applications. The allocated Container is always on a single node and has a unique ContainerId. It has a specific amount of Resource allocated.

It includes details such as:

Typically, an ApplicationMaster receives the Container from the ResourceManager during resource-negotiation and then talks to the NodeManager to start/stop containers.

See Also:
ApplicationMasterProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest), ContainerManagementProtocol.startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest), ContainerManagementProtocol.stopContainers(org.apache.hadoop.yarn.api.protocolrecords.StopContainersRequest)

Constructor Summary
Container()
           
 
Method Summary
abstract  Token getContainerToken()
          Get the ContainerToken for the container.
abstract  ContainerId getId()
          Get the globally unique identifier for the container.
abstract  String getNodeHttpAddress()
          Get the http uri of the node on which the container is allocated.
abstract  NodeId getNodeId()
          Get the identifier of the node on which the container is allocated.
abstract  Priority getPriority()
          Get the Priority at which the Container was allocated.
abstract  Resource getResource()
          Get the Resource allocated to the container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Container

public Container()
Method Detail

getId

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract ContainerId getId()
Get the globally unique identifier for the container.

Returns:
globally unique identifier for the container

getNodeId

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract NodeId getNodeId()
Get the identifier of the node on which the container is allocated.

Returns:
identifier of the node on which the container is allocated

getNodeHttpAddress

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract String getNodeHttpAddress()
Get the http uri of the node on which the container is allocated.

Returns:
http uri of the node on which the container is allocated

getResource

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Resource getResource()
Get the Resource allocated to the container.

Returns:
Resource allocated to the container

getPriority

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Priority getPriority()
Get the Priority at which the Container was allocated.

Returns:
Priority at which the Container was allocated

getContainerToken

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Token getContainerToken()
Get the ContainerToken for the container.

ContainerToken is the security token used by the framework to verify authenticity of any Container.

The ResourceManager, on container allocation provides a secure token which is verified by the NodeManager on container launch.

Applications do not need to care about ContainerToken, they are transparently handled by the framework - the allocated Container includes the ContainerToken.

Returns:
ContainerToken for the container
See Also:
ApplicationMasterProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest), ContainerManagementProtocol.startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest)


Copyright © 2013 Apache Software Foundation. All Rights Reserved.