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
FieldsModifier and TypeFieldDescription(package private) TableHFileArchiveTrackerprivate org.apache.hadoop.fs.FileSystemprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisFileDeletable(org.apache.hadoop.fs.FileStatus fStat) Should the master delete the file or keep it?voidsetConf(org.apache.hadoop.conf.Configuration config) voidStop this service.Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseHFileCleanerDelegate
isStoppedMethods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseFileCleanerDelegate
getDeletableFiles, initMethods inherited from class org.apache.hadoop.hbase.BaseConfigurable
getConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConfMethods 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:BaseFileCleanerDelegateShould the master delete the file or keep it?This method can be called concurrently by multiple threads. Implementations must be thread safe.
- Specified by:
isFileDeletablein classBaseFileCleanerDelegate- Parameters:
fStat- file status of the file to check- Returns:
- true if the file is deletable, false if not
-
setConf
- Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable- Overrides:
setConfin classBaseConfigurable
-
stop
Description copied from interface:StoppableStop this service. Implementers should favor logging errors over throwing RuntimeExceptions.- Specified by:
stopin interfaceStoppable- Overrides:
stopin classBaseHFileCleanerDelegate- Parameters:
reason- Why we're stopping.
-