@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:
ContainerId
for the container, which is globally unique.NodeId
of the node on which it is allocated.
Resource
allocated to the container.Priority
at which the container was allocated.Token
of the container, used to securely verify
authenticity of the allocation.
ApplicationMaster
receives the Container
from the ResourceManager
during resource-negotiation and then
talks to the NodeManager
to start/stop containers.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 and Description |
---|
Container() |
Modifier and Type | Method and Description |
---|---|
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. |
int |
getVersion()
Get the version of this container.
|
static Container |
newInstance(ContainerId containerId,
NodeId nodeId,
String nodeHttpAddress,
Resource resource,
Priority priority,
Token containerToken) |
abstract void |
setContainerToken(Token containerToken) |
abstract void |
setId(ContainerId id) |
abstract void |
setNodeHttpAddress(String nodeHttpAddress) |
abstract void |
setNodeId(NodeId nodeId) |
abstract void |
setPriority(Priority priority) |
abstract void |
setResource(Resource resource) |
void |
setVersion(int version)
Set the version of this container.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compareTo
@InterfaceAudience.Private @InterfaceStability.Unstable public static Container newInstance(ContainerId containerId, NodeId nodeId, String nodeHttpAddress, Resource resource, Priority priority, Token containerToken)
@InterfaceAudience.Public @InterfaceStability.Stable public abstract ContainerId getId()
@InterfaceAudience.Private @InterfaceStability.Unstable public abstract void setId(ContainerId id)
@InterfaceAudience.Public @InterfaceStability.Stable public abstract NodeId getNodeId()
@InterfaceAudience.Private @InterfaceStability.Unstable public abstract void setNodeId(NodeId nodeId)
@InterfaceAudience.Public @InterfaceStability.Stable public abstract String getNodeHttpAddress()
@InterfaceAudience.Private @InterfaceStability.Unstable public abstract void setNodeHttpAddress(String nodeHttpAddress)
@InterfaceAudience.Public @InterfaceStability.Stable public abstract Resource getResource()
Resource
allocated to the container.Resource
allocated to the container@InterfaceAudience.Private @InterfaceStability.Unstable public abstract void setResource(Resource resource)
@InterfaceAudience.Public @InterfaceStability.Stable public abstract Priority getPriority()
Priority
at which the Container
was
allocated.Priority
at which the Container
was
allocated@InterfaceAudience.Private @InterfaceStability.Unstable public abstract void setPriority(Priority priority)
@InterfaceAudience.Public @InterfaceStability.Stable public abstract Token getContainerToken()
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
.
ContainerToken
for the containerApplicationMasterProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest)
,
ContainerManagementProtocol.startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest)
@InterfaceAudience.Private @InterfaceStability.Unstable public abstract void setContainerToken(Token containerToken)
@InterfaceAudience.Private @InterfaceStability.Unstable public int getVersion()
@InterfaceAudience.Private @InterfaceStability.Unstable public void setVersion(int version)
version
- of this container.Copyright © 2017 Apache Software Foundation. All Rights Reserved.