Class OpenKeyCleanupService

java.lang.Object
org.apache.hadoop.hdds.utils.BackgroundService
org.apache.hadoop.ozone.om.service.OpenKeyCleanupService

public class OpenKeyCleanupService extends org.apache.hadoop.hdds.utils.BackgroundService
This is the background service to delete hanging open keys. Scan the metadata of om periodically to get the keys with prefix "#open#" and ask scm to delete metadata accordingly, if scm returns success for keys, then clean up those keys.
  • Nested Class Summary

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

    org.apache.hadoop.hdds.utils.BackgroundService.PeriodicalTask
  • Constructor Summary

    Constructors
    Constructor
    Description
    OpenKeyCleanupService(long interval, TimeUnit unit, long timeout, OzoneManager ozoneManager, org.apache.hadoop.hdds.conf.ConfigurationSource conf)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the number of open keys that were submitted for deletion by this service.
    org.apache.hadoop.hdds.utils.BackgroundTaskQueue
     
    void
    Resume the service if suspended (for testing).
    void
    Suspend the service (for testing).

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

    execTaskCompletion, getExecutorService, getFuture, getIntervalMillis, 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

    • OpenKeyCleanupService

      public OpenKeyCleanupService(long interval, TimeUnit unit, long timeout, OzoneManager ozoneManager, org.apache.hadoop.hdds.conf.ConfigurationSource conf)
  • Method Details

    • suspend

      public void suspend()
      Suspend the service (for testing).
    • resume

      public void resume()
      Resume the service if suspended (for testing).
    • getSubmittedOpenKeyCount

      public long getSubmittedOpenKeyCount()
      Returns the number of open keys that were submitted for deletion by this service. If these keys were committed from the open key table between being submitted for deletion and the actual delete operation, they will not be deleted.
      Returns:
      long count.
    • getTasks

      public org.apache.hadoop.hdds.utils.BackgroundTaskQueue getTasks()
      Specified by:
      getTasks in class org.apache.hadoop.hdds.utils.BackgroundService