Class FpgaResourcePlugin
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.fpga.FpgaResourcePlugin
- All Implemented Interfaces:
ResourcePlugin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Do cleanup of the plugin, this will be invoked whenNodeManagerstopscreateResourceHandler(Context nmContext, CGroupsHandler cGroupsHandler, PrivilegedOperationExecutor privilegedOperationExecutor) Plugin needs to returnResourceHandlerwhen any special isolation required for the resource type.Plugin need to getDockerCommandPlugin.Get resource information from this plugin.Plugin needs to returnNodeResourceUpdaterPluginwhen any discovery mechanism required for the resource type.voidinitialize(Context context) Initialize the plugin, this will be invoked during NM startup.toString()
-
Constructor Details
-
FpgaResourcePlugin
public FpgaResourcePlugin()
-
-
Method Details
-
initialize
Description copied from interface:ResourcePluginInitialize the plugin, this will be invoked during NM startup.- Specified by:
initializein interfaceResourcePlugin- Parameters:
context- NM Context- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- when any issue occurs
-
createResourceHandler
public ResourceHandler createResourceHandler(Context nmContext, CGroupsHandler cGroupsHandler, PrivilegedOperationExecutor privilegedOperationExecutor) Description copied from interface:ResourcePluginPlugin needs to returnResourceHandlerwhen any special isolation required for the resource type. This will be added toResourceHandlerChainduring NodeManager startup. When no special isolation need, return null.- Specified by:
createResourceHandlerin interfaceResourcePlugin- Parameters:
nmContext- NodeManager context.cGroupsHandler- CGroupsHandlerprivilegedOperationExecutor- Privileged Operation Executor.- Returns:
- ResourceHandler
-
getNodeResourceHandlerInstance
Description copied from interface:ResourcePluginPlugin needs to returnNodeResourceUpdaterPluginwhen 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 aNodeResourceUpdaterPluginand update fields ofNodeHeartbeatRequestorRegisterNodeManagerRequestThis will be invoked during every node status update or node registration, please avoid creating new instance every time.- Specified by:
getNodeResourceHandlerInstancein interfaceResourcePlugin- Returns:
- NodeResourceUpdaterPlugin, could be null when no discovery needed.
-
cleanup
public void cleanup() throws org.apache.hadoop.yarn.exceptions.YarnExceptionDescription copied from interface:ResourcePluginDo cleanup of the plugin, this will be invoked whenNodeManagerstops- Specified by:
cleanupin interfaceResourcePlugin- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if any issue occurs
-
getDockerCommandPluginInstance
Description copied from interface:ResourcePluginPlugin need to getDockerCommandPlugin. This will be invoked byDockerLinuxContainerRuntimewhen execute docker commands such as run/stop/pull, etc.- Specified by:
getDockerCommandPluginInstancein interfaceResourcePlugin- Returns:
- DockerCommandPlugin instance. return null if plugin doesn't have requirement to update docker command.
-
getNMResourceInfo
Description copied from interface:ResourcePluginGet resource information from this plugin.- Specified by:
getNMResourceInfoin interfaceResourcePlugin- Returns:
- NMResourceInfo, an example is
GpuDeviceInformation - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- when any issue occurs
-
toString
-