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
ConstructorsConstructorDescriptionOpenKeyCleanupService(long interval, TimeUnit unit, long timeout, OzoneManager ozoneManager, org.apache.hadoop.hdds.conf.ConfigurationSource conf) -
Method Summary
Methods inherited from class org.apache.hadoop.hdds.utils.BackgroundService
execTaskCompletion, getExecutorService, getFuture, getIntervalMillis, getThreadCount, runPeriodicalTaskNow, setInterval, setPoolSize, setServiceTimeoutInNanos, shutdown, start
-
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:
getTasksin classorg.apache.hadoop.hdds.utils.BackgroundService
-