@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 |
---|---|
long |
getAllocationRequestId()
Get the optional ID corresponding to the original
ResourceRequest{@link #getAllocationRequestId()} s which is satisfied by
this allocated Container . |
abstract Token |
getContainerToken()
Get the
ContainerToken for the container. |
abstract Map<String,List<Map<String,String>>> |
getExposedPorts()
Get the exposed ports of the node on which the container is allocated.
|
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compareTo
@InterfaceAudience.Public @InterfaceStability.Stable public abstract ContainerId getId()
@InterfaceAudience.Public @InterfaceStability.Stable public abstract NodeId getNodeId()
@InterfaceAudience.Public @InterfaceStability.Stable public abstract String getNodeHttpAddress()
@InterfaceAudience.Public @InterfaceStability.Stable public abstract Map<String,List<Map<String,String>>> getExposedPorts()
@InterfaceAudience.Public @InterfaceStability.Stable public abstract Resource getResource()
Resource
allocated to the container.Resource
allocated to the container@InterfaceAudience.Public @InterfaceStability.Stable public abstract Priority getPriority()
Priority
at which the Container
was
allocated.Priority
at which the Container
was
allocated@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.Public @InterfaceStability.Evolving public long getAllocationRequestId()
ResourceRequest{@link #getAllocationRequestId()}
s which is satisfied by
this allocated Container
.
The scheduler may return multiple AllocateResponse
s corresponding
to the same ID as and when scheduler allocates Container
s.
Applications can continue to completely ignore the returned ID in
the response and use the allocation for any of their outstanding requests.
Copyright © 2023 Apache Software Foundation. All rights reserved.