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

All Superinterfaces:
Comparable<Container>
All Known Implementing Classes:
ContainerPBImpl

@InterfaceAudience.Public
@InterfaceStability.Stable
public interface Container
extends 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 NodManager to start/stop containers.

See Also:
AMRMProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest), ContainerManager.startContainer(org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest), ContainerManager.stopContainer(org.apache.hadoop.yarn.api.protocolrecords.StopContainerRequest)

Method Summary
 ContainerStatus getContainerStatus()
          Get the ContainerStatus of the container.
 ContainerToken getContainerToken()
          Get the ContainerToken for the container.
 ContainerId getId()
          Get the globally unique identifier for the container.
 String getNodeHttpAddress()
          Get the http uri of the node on which the container is allocated.
 NodeId getNodeId()
          Get the identifier of the node on which the container is allocated.
 Priority getPriority()
          Get the Priority at which the Container was allocated.
 Resource getResource()
          Get the Resource allocated to the container.
 ContainerState getState()
          Get the current ContainerState of the container.
 void setContainerStatus(ContainerStatus containerStatus)
           
 void setContainerToken(ContainerToken containerToken)
           
 void setId(ContainerId id)
           
 void setNodeHttpAddress(String nodeHttpAddress)
           
 void setNodeId(NodeId nodeId)
           
 void setPriority(Priority priority)
           
 void setResource(Resource resource)
           
 void setState(ContainerState state)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getId

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

Returns:
globally unique identifier for the container

setId

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setId(ContainerId id)

getNodeId

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

setNodeId

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setNodeId(NodeId nodeId)

getNodeHttpAddress

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

setNodeHttpAddress

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setNodeHttpAddress(String nodeHttpAddress)

getResource

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

Returns:
Resource allocated to the container

setResource

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setResource(Resource resource)

getPriority

Priority getPriority()
Get the Priority at which the Container was allocated.

Returns:
Priority at which the Container was allocated

setPriority

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setPriority(Priority priority)

getState

@InterfaceAudience.Public
@InterfaceStability.Stable
ContainerState getState()
Get the current ContainerState of the container.

Returns:
current ContainerState of the container

setState

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setState(ContainerState state)

getContainerToken

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

Returns:
ContainerToken for the container

setContainerToken

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setContainerToken(ContainerToken containerToken)

getContainerStatus

@InterfaceAudience.Public
@InterfaceStability.Stable
ContainerStatus getContainerStatus()
Get the ContainerStatus of the container.

Returns:
ContainerStatus of the container

setContainerStatus

@InterfaceAudience.Private
@InterfaceStability.Unstable
void setContainerStatus(ContainerStatus containerStatus)


Copyright © 2012 Apache Software Foundation. All Rights Reserved.