Class VolumeManagerImpl
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.resourcemanager.volume.csi.VolumeManagerImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service,VolumeManager
public class VolumeManagerImpl
extends org.apache.hadoop.service.AbstractService
implements VolumeManager
A service manages all volumes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOrGetVolume(Volume volume) Start to supervise on a volume.org.apache.hadoop.yarn.api.CsiAdaptorProtocolgetAdaptorByDriverName(String driverName) Returns a CsiAdaptorProtocol client by the given driver name, returns null if no adaptor is found for the driver, that means the driver has not registered to the volume manager yet enhance not valid.voidregisterCsiDriverAdaptor(String driverName, org.apache.hadoop.yarn.api.CsiAdaptorProtocol client) Register a csi-driver-adaptor to the volume manager.schedule(VolumeProvisioningTask volumeProvisioningTask, int delaySecond) Execute volume provisioning tasks as backend threads.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
VolumeManagerImpl
public VolumeManagerImpl()
-
-
Method Details
-
getAdaptorByDriverName
Returns a CsiAdaptorProtocol client by the given driver name, returns null if no adaptor is found for the driver, that means the driver has not registered to the volume manager yet enhance not valid.- Specified by:
getAdaptorByDriverNamein interfaceVolumeManager- Parameters:
driverName- the name of the driver- Returns:
- CsiAdaptorProtocol client or null if driver not registered
-
registerCsiDriverAdaptor
@VisibleForTesting public void registerCsiDriverAdaptor(String driverName, org.apache.hadoop.yarn.api.CsiAdaptorProtocol client) Description copied from interface:VolumeManagerRegister a csi-driver-adaptor to the volume manager.- Specified by:
registerCsiDriverAdaptorin interfaceVolumeManager- Parameters:
driverName- driver name.client- csi adaptor protocol client.
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getVolumeStates
- Specified by:
getVolumeStatesin interfaceVolumeManager- Returns:
- all known volumes and their states.
-
addOrGetVolume
Description copied from interface:VolumeManagerStart to supervise on a volume.- Specified by:
addOrGetVolumein interfaceVolumeManager- Parameters:
volume- volume.- Returns:
- the volume being managed by the manager.
-
schedule
public ScheduledFuture<VolumeProvisioningResults> schedule(VolumeProvisioningTask volumeProvisioningTask, int delaySecond) Description copied from interface:VolumeManagerExecute volume provisioning tasks as backend threads.- Specified by:
schedulein interfaceVolumeManager- Parameters:
volumeProvisioningTask- A provisioning task encapsulates all the logic required by a storage system to provision a volume.delaySecond- delay Second.- Returns:
- ScheduledFuture.
-