Class LongTermArchivingHFileCleaner
java.lang.Object
org.apache.hadoop.hbase.BaseConfigurable
org.apache.hadoop.hbase.master.cleaner.BaseFileCleanerDelegate
org.apache.hadoop.hbase.master.cleaner.BaseHFileCleanerDelegate
org.apache.hadoop.hbase.backup.example.LongTermArchivingHFileCleaner
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,FileCleanerDelegate
,Stoppable
@LimitedPrivate("Configuration")
public class LongTermArchivingHFileCleaner
extends BaseHFileCleanerDelegate
BaseHFileCleanerDelegate
that only cleans HFiles that don't belong to a table that is
currently being archived.
This only works properly if the
TimeToLiveHFileCleaner
is also enabled (it always
should be), since it may take a little time for the ZK notification to propagate, in which case
we may accidentally delete some files.
-
Field Summary
Modifier and TypeFieldDescription(package private) TableHFileArchiveTracker
private org.apache.hadoop.fs.FileSystem
private static final org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isFileDeletable
(org.apache.hadoop.fs.FileStatus fStat) Should the master delete the file or keep it?void
setConf
(org.apache.hadoop.conf.Configuration config) void
Stop this service.Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseHFileCleanerDelegate
isStopped
Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseFileCleanerDelegate
getDeletableFiles, init
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
-
archiveTracker
-
fs
-
-
Constructor Details
-
LongTermArchivingHFileCleaner
public LongTermArchivingHFileCleaner()
-
-
Method Details
-
isFileDeletable
Description copied from class:BaseFileCleanerDelegate
Should the master delete the file or keep it?- Specified by:
isFileDeletable
in classBaseFileCleanerDelegate
- Parameters:
fStat
- file status of the file to check- Returns:
- true if the file is deletable, false if not
-
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.- Specified by:
stop
in interfaceStoppable
- Overrides:
stop
in classBaseHFileCleanerDelegate
- Parameters:
reason
- Why we're stopping.
-