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
ResourcePlugin
initialize
in interface ResourcePlugin
context
- NM Contextorg.apache.hadoop.yarn.exceptions.YarnException
- when any issue occurspublic ResourceHandler createResourceHandler(Context context, CGroupsHandler cGroupsHandler, PrivilegedOperationExecutor privilegedOperationExecutor)
ResourcePlugin
ResourceHandler
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 ResourcePlugin
context
- NodeManager context.cGroupsHandler
- CGroupsHandlerprivilegedOperationExecutor
- Privileged Operation Executor.public NodeResourceUpdaterPlugin getNodeResourceHandlerInstance()
ResourcePlugin
NodeResourceUpdaterPlugin
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 ResourcePlugin
public void cleanup() throws org.apache.hadoop.yarn.exceptions.YarnException
ResourcePlugin
NodeManager
stopscleanup
in interface ResourcePlugin
org.apache.hadoop.yarn.exceptions.YarnException
- if any issue occurspublic DockerCommandPlugin getDockerCommandPluginInstance()
ResourcePlugin
DockerCommandPlugin
. This will be invoked by
DockerLinuxContainerRuntime
when execute docker commands such as
run/stop/pull, etc.getDockerCommandPluginInstance
in interface ResourcePlugin
public NMResourceInfo getNMResourceInfo() throws org.apache.hadoop.yarn.exceptions.YarnException
ResourcePlugin
getNMResourceInfo
in interface ResourcePlugin
GpuDeviceInformation
org.apache.hadoop.yarn.exceptions.YarnException
- when any issue occursCopyright © 2008–2023 Apache Software Foundation. All rights reserved.