public class NECVEPlugin extends Object implements DevicePlugin, DevicePluginScheduler
Constructor and Description |
---|
NECVEPlugin() |
Modifier and Type | Method and Description |
---|---|
Set<Device> |
allocateDevices(Set<Device> availableDevices,
int count,
Map<String,String> env)
Called when allocating devices.
|
Set<Device> |
getDevices()
Called when update node resource.
|
DeviceRegisterRequest |
getRegisterRequestInfo()
Called first when device plugin framework wants to register.
|
DeviceRuntimeSpec |
onDevicesAllocated(Set<Device> set,
YarnRuntimeType yarnRuntimeType)
Asking how these devices should be prepared/used
before/when container launch.
|
void |
onDevicesReleased(Set<Device> releasedDevices)
Called after device released.
|
public NECVEPlugin() throws ResourceHandlerException
ResourceHandlerException
public DeviceRegisterRequest getRegisterRequestInfo()
DevicePlugin
getRegisterRequestInfo
in interface DevicePlugin
DeviceRegisterRequest
public Set<Device> getDevices()
DevicePlugin
getDevices
in interface DevicePlugin
Device
, TreeSet
recommendedpublic DeviceRuntimeSpec onDevicesAllocated(Set<Device> set, YarnRuntimeType yarnRuntimeType)
DevicePlugin
VolumeSpec
to let the
framework to create volume before running container.onDevicesAllocated
in interface DevicePlugin
set
- A set of allocated Device
.yarnRuntimeType
- Indicate which runtime YARN will use
Could be RUNTIME_DEFAULT
or RUNTIME_DOCKER
in DeviceRuntimeSpec
constants. The default means YARN's
non-docker container runtime is used. The docker means YARN's
docker container runtime is used.DeviceRuntimeSpec
description about environment,
VolumeSpec
, MountVolumeSpec
. etcpublic void onDevicesReleased(Set<Device> releasedDevices)
DevicePlugin
onDevicesReleased
in interface DevicePlugin
releasedDevices
- A set of released devicespublic Set<Device> allocateDevices(Set<Device> availableDevices, int count, Map<String,String> env)
DevicePluginScheduler
allocateDevices
in interface DevicePluginScheduler
availableDevices
- Devices allowed to be chosen from.count
- Number of device to be allocated.env
- Environment variables of the container.Device
allocatedCopyright © 2008–2023 Apache Software Foundation. All rights reserved.