public class GpuResourcePlugin extends Object implements ResourcePlugin
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_REPEATED_ERROR_ALLOWED |
| Constructor and Description |
|---|
GpuResourcePlugin(GpuNodeResourceUpdateHandler resourceDiscoverHandler,
GpuDiscoverer gpuDiscoverer) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Do cleanup of the plugin, this will be invoked when
NodeManager stops |
ResourceHandler |
createResourceHandler(Context context,
CGroupsHandler cGroupsHandler,
PrivilegedOperationExecutor privilegedOperationExecutor)
Plugin needs to return
ResourceHandler when any special isolation
required for the resource type. |
DockerCommandPlugin |
getDockerCommandPluginInstance()
Plugin need to get
DockerCommandPlugin. |
NMResourceInfo |
getNMResourceInfo()
Get resource information from this plugin.
|
NodeResourceUpdaterPlugin |
getNodeResourceHandlerInstance()
Plugin needs to return
NodeResourceUpdaterPlugin when any discovery
mechanism required for the resource type. |
void |
initialize(Context context)
Initialize the plugin, this will be invoked during NM startup.
|
String |
toString() |
public static final int MAX_REPEATED_ERROR_ALLOWED
public GpuResourcePlugin(GpuNodeResourceUpdateHandler resourceDiscoverHandler, GpuDiscoverer gpuDiscoverer)
public void initialize(Context context) throws org.apache.hadoop.yarn.exceptions.YarnException
ResourcePlugininitialize in interface ResourcePlugincontext - NM Contextorg.apache.hadoop.yarn.exceptions.YarnException - when any issue occurspublic ResourceHandler createResourceHandler(Context context, CGroupsHandler cGroupsHandler, PrivilegedOperationExecutor privilegedOperationExecutor)
ResourcePluginResourceHandler when any special isolation
required for the resource type. This will be added to
ResourceHandlerChain during NodeManager startup. When no special
isolation need, return null.createResourceHandler in interface ResourcePlugincontext - NodeManager context.cGroupsHandler - CGroupsHandlerprivilegedOperationExecutor - Privileged Operation Executor.public NodeResourceUpdaterPlugin getNodeResourceHandlerInstance()
ResourcePluginNodeResourceUpdaterPlugin when any discovery
mechanism required for the resource type. For example, if we want to set
resource-value during NM registration or send update during NM-RM heartbeat
We can implement a NodeResourceUpdaterPlugin and update fields of
NodeHeartbeatRequest
or RegisterNodeManagerRequest
This will be invoked during every node status update or node registration,
please avoid creating new instance every time.getNodeResourceHandlerInstance in interface ResourcePluginpublic void cleanup()
throws org.apache.hadoop.yarn.exceptions.YarnException
ResourcePluginNodeManager stopscleanup in interface ResourcePluginorg.apache.hadoop.yarn.exceptions.YarnException - if any issue occurspublic DockerCommandPlugin getDockerCommandPluginInstance()
ResourcePluginDockerCommandPlugin. This will be invoked by
DockerLinuxContainerRuntime when execute docker commands such as
run/stop/pull, etc.getDockerCommandPluginInstance in interface ResourcePluginpublic NMResourceInfo getNMResourceInfo() throws org.apache.hadoop.yarn.exceptions.YarnException
ResourcePlugingetNMResourceInfo in interface ResourcePluginGpuDeviceInformationorg.apache.hadoop.yarn.exceptions.YarnException - when any issue occursCopyright © 2008–2024 Apache Software Foundation. All rights reserved.