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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Start to supervise on a volume.
    org.apache.hadoop.yarn.api.CsiAdaptorProtocol
    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.
     
    void
    registerCsiDriverAdaptor(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 void
    serviceInit(org.apache.hadoop.conf.Configuration conf)
     
    protected void
     
    protected void
     

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VolumeManagerImpl

      public VolumeManagerImpl()
  • Method Details

    • getAdaptorByDriverName

      public org.apache.hadoop.yarn.api.CsiAdaptorProtocol getAdaptorByDriverName(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.
      Specified by:
      getAdaptorByDriverName in interface VolumeManager
      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: VolumeManager
      Register a csi-driver-adaptor to the volume manager.
      Specified by:
      registerCsiDriverAdaptor in interface VolumeManager
      Parameters:
      driverName - driver name.
      client - csi adaptor protocol client.
    • serviceInit

      protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
      Overrides:
      serviceInit in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • serviceStart

      protected void serviceStart() throws Exception
      Overrides:
      serviceStart in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • serviceStop

      protected void serviceStop() throws Exception
      Overrides:
      serviceStop in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • getVolumeStates

      public VolumeStates getVolumeStates()
      Specified by:
      getVolumeStates in interface VolumeManager
      Returns:
      all known volumes and their states.
    • addOrGetVolume

      public Volume addOrGetVolume(Volume volume)
      Description copied from interface: VolumeManager
      Start to supervise on a volume.
      Specified by:
      addOrGetVolume in interface VolumeManager
      Parameters:
      volume - volume.
      Returns:
      the volume being managed by the manager.
    • schedule

      public ScheduledFuture<VolumeProvisioningResults> schedule(VolumeProvisioningTask volumeProvisioningTask, int delaySecond)
      Description copied from interface: VolumeManager
      Execute volume provisioning tasks as backend threads.
      Specified by:
      schedule in interface VolumeManager
      Parameters:
      volumeProvisioningTask - A provisioning task encapsulates all the logic required by a storage system to provision a volume.
      delaySecond - delay Second.
      Returns:
      ScheduledFuture.