java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.numa.NumaResourceAllocator

public class NumaResourceAllocator extends Object
NUMA Resources Allocator reads the NUMA topology and assigns NUMA nodes to the containers.
  • Constructor Details

    • NumaResourceAllocator

      public NumaResourceAllocator(Context context)
  • 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