java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.deviceframework.DeviceMappingManager

public class DeviceMappingManager extends Object
Schedule device resource based on requirements and do book keeping It holds all device type resource and can do scheduling as a default scheduler.
  • Constructor Details

    • DeviceMappingManager

      public DeviceMappingManager(Context context)
  • Method Details

    • getAllAllowedDevices

      @VisibleForTesting public Map<String,Set<Device>> getAllAllowedDevices()
    • getAllUsedDevices

      @VisibleForTesting public Map<String,Map<Device,org.apache.hadoop.yarn.api.records.ContainerId>> getAllUsedDevices()
    • getDevicePluginSchedulers

      @VisibleForTesting public Map<String,DevicePluginScheduler> getDevicePluginSchedulers()
    • getAllocatedDevices

      @VisibleForTesting public Set<Device> getAllocatedDevices(String resourceName, org.apache.hadoop.yarn.api.records.ContainerId cId)
    • addDeviceSet

      public void addDeviceSet(String resourceName, Set<Device> deviceSet)
    • assignDevices

      public org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.deviceframework.DeviceMappingManager.DeviceAllocation assignDevices(String resourceName, Container container) throws ResourceHandlerException
      Throws:
      ResourceHandlerException
    • recoverAssignedDevices

      public void recoverAssignedDevices(String resourceName, org.apache.hadoop.yarn.api.records.ContainerId containerId) throws ResourceHandlerException
      Throws:
      ResourceHandlerException
    • cleanupAssignedDevices

      public void cleanupAssignedDevices(String resourceName, org.apache.hadoop.yarn.api.records.ContainerId containerId)
    • getRequestedDeviceCount

      public static int getRequestedDeviceCount(String resName, org.apache.hadoop.yarn.api.records.Resource requestedResource)
    • getAvailableDevices

      public int getAvailableDevices(String resourceName)
    • addDevicePluginScheduler

      @VisibleForTesting public void addDevicePluginScheduler(String resourceName, DevicePluginScheduler s)