Class AbstractKeyDeletingService

java.lang.Object
org.apache.hadoop.hdds.utils.BackgroundService
org.apache.hadoop.ozone.om.service.AbstractKeyDeletingService
All Implemented Interfaces:
org.apache.hadoop.ozone.lock.BootstrapStateHandler
Direct Known Subclasses:
DirectoryDeletingService, KeyDeletingService, SnapshotDeletingService

public abstract class AbstractKeyDeletingService extends org.apache.hadoop.hdds.utils.BackgroundService implements org.apache.hadoop.ozone.lock.BootstrapStateHandler
Abstracts common code from KeyDeletingService and DirectoryDeletingService which is now used by SnapshotDeletingService as well.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.hadoop.hdds.utils.BackgroundService

    org.apache.hadoop.hdds.utils.BackgroundService.PeriodicalTask

    Nested classes/interfaces inherited from interface org.apache.hadoop.ozone.lock.BootstrapStateHandler

    org.apache.hadoop.ozone.lock.BootstrapStateHandler.Lock
  • Field Summary

    Fields inherited from class org.apache.hadoop.hdds.utils.BackgroundService

    LOG
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractKeyDeletingService(String serviceName, long interval, TimeUnit unit, int threadPoolSize, long serviceTimeout, OzoneManager ozoneManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.ozone.lock.BootstrapStateHandler.Lock
     
     
     
    Returns the number of times this Background service has run.
    protected boolean
    isBufferLimitCrossed(int maxLimit, int cLimit, int increment)
     
    void
    Resume the service if suspended.
    protected org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse
    submitRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest)
     
    protected void
    submitSetSnapshotRequests(List<org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.SetSnapshotPropertyRequest> setSnapshotPropertyRequests)
    Submits SetSnapsnapshotPropertyRequest to OM.
    void
    Suspend the service.

    Methods inherited from class org.apache.hadoop.hdds.utils.BackgroundService

    execTaskCompletion, getExecutorService, getFuture, getIntervalMillis, getTasks, getThreadCount, runPeriodicalTaskNow, setInterval, setPoolSize, setServiceTimeoutInNanos, shutdown, start

    Methods inherited from class java.lang.Object

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

    • AbstractKeyDeletingService

      public AbstractKeyDeletingService(String serviceName, long interval, TimeUnit unit, int threadPoolSize, long serviceTimeout, OzoneManager ozoneManager)
  • Method Details

    • submitRequest

      protected org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse submitRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • suspend

      public void suspend() throws ExecutionException, InterruptedException
      Suspend the service.
      Throws:
      ExecutionException
      InterruptedException
    • resume

      public void resume()
      Resume the service if suspended.
    • isBufferLimitCrossed

      protected boolean isBufferLimitCrossed(int maxLimit, int cLimit, int increment)
    • getOzoneManager

      public OzoneManager getOzoneManager()
    • getRunCount

      public AtomicLong getRunCount()
      Returns the number of times this Background service has run.
      Returns:
      Long, run count.
    • getCallId

      public AtomicLong getCallId()
    • getBootstrapStateLock

      public org.apache.hadoop.ozone.lock.BootstrapStateHandler.Lock getBootstrapStateLock()
      Specified by:
      getBootstrapStateLock in interface org.apache.hadoop.ozone.lock.BootstrapStateHandler
    • submitSetSnapshotRequests

      protected void submitSetSnapshotRequests(List<org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.SetSnapshotPropertyRequest> setSnapshotPropertyRequests)
      Submits SetSnapsnapshotPropertyRequest to OM.
      Parameters:
      setSnapshotPropertyRequests - request to be sent to OM