Class BackupLogCleaner
java.lang.Object
org.apache.hadoop.hbase.BaseConfigurable
org.apache.hadoop.hbase.master.cleaner.BaseFileCleanerDelegate
org.apache.hadoop.hbase.master.cleaner.BaseLogCleanerDelegate
org.apache.hadoop.hbase.backup.master.BackupLogCleaner
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,FileCleanerDelegate
,Stoppable
Implementation of a log cleaner that checks if a log is still scheduled for incremental backup
before deleting it when its TTL is over.
-
Field Summary
Modifier and TypeFieldDescriptionprivate Connection
private static final org.slf4j.Logger
private boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIterable<org.apache.hadoop.fs.FileStatus>
getDeletableFiles
(Iterable<org.apache.hadoop.fs.FileStatus> files) Determines which of the given files are safe to deletegetServersToOldestBackupMapping
(List<BackupInfo> backups) void
this method is used to pass some instance into subclassboolean
Returns True ifStoppable.stop(String)
has been closed.void
setConf
(org.apache.hadoop.conf.Configuration config) void
Stop this service.Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseLogCleanerDelegate
isFileDeletable
Methods inherited from class org.apache.hadoop.hbase.BaseConfigurable
getConf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf
Methods inherited from interface org.apache.hadoop.hbase.master.cleaner.FileCleanerDelegate
isEmptyDirDeletable, postClean, preClean
-
Field Details
-
LOG
-
stopped
-
conn
-
-
Constructor Details
-
BackupLogCleaner
public BackupLogCleaner()
-
-
Method Details
-
init
Description copied from interface:FileCleanerDelegate
this method is used to pass some instance into subclass- Specified by:
init
in interfaceFileCleanerDelegate
- Overrides:
init
in classBaseFileCleanerDelegate
-
getServersToOldestBackupMapping
private Map<Address,Long> getServersToOldestBackupMapping(List<BackupInfo> backups) throws IOException - Throws:
IOException
-
getDeletableFiles
public Iterable<org.apache.hadoop.fs.FileStatus> getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files) Description copied from interface:FileCleanerDelegate
Determines which of the given files are safe to delete- Specified by:
getDeletableFiles
in interfaceFileCleanerDelegate
- Overrides:
getDeletableFiles
in classBaseFileCleanerDelegate
- Parameters:
files
- files to check for deletion- Returns:
- files that are ok to delete according to this cleaner
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
- Overrides:
setConf
in classBaseConfigurable
-
stop
Description copied from interface:Stoppable
Stop this service. Implementers should favor logging errors over throwing RuntimeExceptions.- Parameters:
why
- Why we're stopping.
-
isStopped
Description copied from interface:Stoppable
Returns True ifStoppable.stop(String)
has been closed.
-