Class NumaResourceAllocator
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.numa.NumaResourceAllocator
NUMA Resources Allocator reads the NUMA topology and assigns NUMA nodes to
the containers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocateNumaNodes(Container container) Allocates the available NUMA nodes for the requested containerId with resource in a round robin fashion.executeNGetCmdOutput(org.apache.hadoop.conf.Configuration conf) voidinit(org.apache.hadoop.conf.Configuration conf) voidrecoverNumaResource(org.apache.hadoop.yarn.api.records.ContainerId containerId) Recovers assigned numa resources.voidreleaseNumaResource(org.apache.hadoop.yarn.api.records.ContainerId containerId) Release assigned NUMA resources for the container.
-
Constructor Details
-
NumaResourceAllocator
-
-
Method Details
-
init
public void init(org.apache.hadoop.conf.Configuration conf) throws org.apache.hadoop.yarn.exceptions.YarnException - Throws:
org.apache.hadoop.yarn.exceptions.YarnException
-
executeNGetCmdOutput
@VisibleForTesting public String executeNGetCmdOutput(org.apache.hadoop.conf.Configuration conf) throws org.apache.hadoop.yarn.exceptions.YarnException - Throws:
org.apache.hadoop.yarn.exceptions.YarnException
-
allocateNumaNodes
public NumaResourceAllocation allocateNumaNodes(Container container) throws ResourceHandlerException Allocates the available NUMA nodes for the requested containerId with resource in a round robin fashion.- Parameters:
container- the container to allocate NUMA resources- Returns:
- the assigned NUMA Node info or null if resources not available.
- Throws:
ResourceHandlerException- when failed to store NUMA resources
-
releaseNumaResource
public void releaseNumaResource(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws ResourceHandlerException Release assigned NUMA resources for the container.- Parameters:
containerId- the container ID- Throws:
ResourceHandlerException- when failed to release numa resource
-
recoverNumaResource
public void recoverNumaResource(org.apache.hadoop.yarn.api.records.ContainerId containerId) Recovers assigned numa resources.- Parameters:
containerId- the container ID to recover resources
-