public class DeviceResourceHandlerImpl extends Object implements ResourceHandler
bootstrap
Assign devices for a container in preStart
Restore statue in reacquireContainer
Recycle devices from container in postComplete
Modifier and Type | Field and Description |
---|---|
static String |
ALLOWED_DEVICES_CLI_OPTION |
static String |
CONTAINER_ID_CLI_OPTION |
static String |
EXCLUDED_DEVICES_CLI_OPTION |
Constructor and Description |
---|
DeviceResourceHandlerImpl(String resName,
DevicePluginAdapter devPluginAdapter,
DeviceMappingManager devMappingManager,
CGroupsHandler cgHandler,
PrivilegedOperationExecutor operation,
Context ctx) |
DeviceResourceHandlerImpl(String resName,
DevicePluginAdapter devPluginAdapter,
DeviceMappingManager devMappingManager,
CGroupsHandler cgHandler,
PrivilegedOperationExecutor operation,
Context ctx,
ShellWrapper shell) |
Modifier and Type | Method and Description |
---|---|
List<PrivilegedOperation> |
bootstrap(org.apache.hadoop.conf.Configuration configuration)
Bootstrap resource susbsystem.
|
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.deviceframework.DeviceResourceHandlerImpl.DeviceType |
getDeviceType(Device device) |
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.deviceframework.DeviceResourceHandlerImpl.DeviceType |
getDeviceTypeFromDeviceNumber(int major,
int minor)
Get the device type used for cgroups value set.
|
List<PrivilegedOperation> |
postComplete(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Perform any tasks necessary after container completion.
|
List<PrivilegedOperation> |
preStart(Container container)
Prepare a resource environment for container launch
|
List<PrivilegedOperation> |
reacquireContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Require state for container that was already launched
|
List<PrivilegedOperation> |
teardown()
Teardown environment for resource subsystem if requested.
|
String |
toString() |
List<PrivilegedOperation> |
updateContainer(Container container)
Update state for container that was already launched
|
public static final String EXCLUDED_DEVICES_CLI_OPTION
public static final String ALLOWED_DEVICES_CLI_OPTION
public static final String CONTAINER_ID_CLI_OPTION
public DeviceResourceHandlerImpl(String resName, DevicePluginAdapter devPluginAdapter, DeviceMappingManager devMappingManager, CGroupsHandler cgHandler, PrivilegedOperationExecutor operation, Context ctx)
@VisibleForTesting public DeviceResourceHandlerImpl(String resName, DevicePluginAdapter devPluginAdapter, DeviceMappingManager devMappingManager, CGroupsHandler cgHandler, PrivilegedOperationExecutor operation, Context ctx, ShellWrapper shell)
public List<PrivilegedOperation> bootstrap(org.apache.hadoop.conf.Configuration configuration) throws ResourceHandlerException
ResourceHandler
bootstrap
in interface ResourceHandler
ResourceHandlerException
public List<PrivilegedOperation> preStart(Container container) throws ResourceHandlerException
ResourceHandler
preStart
in interface ResourceHandler
container
- Container being launchedResourceHandlerException
public List<PrivilegedOperation> reacquireContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws ResourceHandlerException
ResourceHandler
reacquireContainer
in interface ResourceHandler
containerId
- id of the container being reacquired.ResourceHandlerException
public List<PrivilegedOperation> updateContainer(Container container) throws ResourceHandlerException
ResourceHandler
updateContainer
in interface ResourceHandler
container
- the container being updated.ResourceHandlerException
public List<PrivilegedOperation> postComplete(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws ResourceHandlerException
ResourceHandler
postComplete
in interface ResourceHandler
containerId
- of the container that was completed.ResourceHandlerException
public List<PrivilegedOperation> teardown() throws ResourceHandlerException
ResourceHandler
teardown
in interface ResourceHandler
ResourceHandlerException
public org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.deviceframework.DeviceResourceHandlerImpl.DeviceType getDeviceType(Device device)
public org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.deviceframework.DeviceResourceHandlerImpl.DeviceType getDeviceTypeFromDeviceNumber(int major, int minor)
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.