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
FieldsModifier and TypeFieldDescriptionprivate Connectionprivate static final org.slf4j.Loggerprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleancanDeleteFile(Map<Address, Long> addressToBoundaryTs, org.apache.hadoop.fs.Path path) Iterable<org.apache.hadoop.fs.FileStatus>getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files) Determines which of the given files are safe to deletevoidthis method is used to pass some instance into subclassprivate static booleanisHMasterWAL(org.apache.hadoop.fs.Path path) booleanReturns True ifStoppable.stop(String)has been closed.serverToPreservationBoundaryTs(List<BackupInfo> backups) Calculates the timestamp boundary up to which all backup roots have already included the WAL.voidsetConf(org.apache.hadoop.conf.Configuration config) voidStop this service.Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseLogCleanerDelegate
isFileDeletableMethods 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
-
stopped
-
conn
-
-
Constructor Details
-
BackupLogCleaner
public BackupLogCleaner()
-
-
Method Details
-
init
Description copied from interface:FileCleanerDelegatethis method is used to pass some instance into subclass- Specified by:
initin interfaceFileCleanerDelegate- Overrides:
initin classBaseFileCleanerDelegate
-
serverToPreservationBoundaryTs
private Map<Address,Long> serverToPreservationBoundaryTs(List<BackupInfo> backups) throws IOException Calculates the timestamp boundary up to which all backup roots have already included the WAL. I.e. WALs with a lower (= older) or equal timestamp are no longer needed for future incremental backups.- Throws:
IOException
-
getDeletableFiles
public Iterable<org.apache.hadoop.fs.FileStatus> getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files) Description copied from interface:FileCleanerDelegateDetermines which of the given files are safe to deleteThis method can be called concurrently by multiple threads. Implementations must be thread safe.
- Specified by:
getDeletableFilesin interfaceFileCleanerDelegate- Overrides:
getDeletableFilesin classBaseFileCleanerDelegate- Parameters:
files- files to check for deletion- Returns:
- files that are ok to delete according to this cleaner
-
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.- Parameters:
why- Why we're stopping.
-
isStopped
Description copied from interface:StoppableReturns True ifStoppable.stop(String)has been closed. -
canDeleteFile
protected static boolean canDeleteFile(Map<Address, Long> addressToBoundaryTs, org.apache.hadoop.fs.Path path) -
isHMasterWAL
-