Package org.apache.hadoop.hbase.backup
Class BackupHFileCleaner
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.BackupHFileCleaner
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,Abortable,FileCleanerDelegate,Stoppable
@LimitedPrivate("Configuration")
public class BackupHFileCleaner
extends BaseHFileCleanerDelegate
implements Abortable
File cleaner that prevents deletion of HFiles that are still required by future incremental
backups.
Bulk loaded HFiles that are needed by future updates are stored in the backup system table.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate Connectionprivate static final org.slf4j.Loggerprivate longprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAbort the server or client.Iterable<org.apache.hadoop.fs.FileStatus>getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files) Determines which of the given files are safe to deletebooleanCheck if the server or client was aborted.booleanisFileDeletable(org.apache.hadoop.fs.FileStatus fStat) Should the master delete the file or keep it?booleanReturns True ifStoppable.stop(String)has been closed.voidWill be called after cleaner run.voidsetConf(org.apache.hadoop.conf.Configuration config) voidStop this service.Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseFileCleanerDelegate
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, preClean
-
Field Details
-
LOG
-
stopped
-
aborted
-
connection
-
previousCleaningCompletionTimestamp
-
-
Constructor Details
-
BackupHFileCleaner
public BackupHFileCleaner()
-
-
Method Details
-
postClean
Description copied from interface:FileCleanerDelegateWill be called after cleaner run.- Specified by:
postCleanin interfaceFileCleanerDelegate
-
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
-
fetchFullyBackedUpTables
- Throws:
IOException
-
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:
why- Why we're stopping.
-
isStopped
Description copied from interface:StoppableReturns True ifStoppable.stop(String)has been closed.- Specified by:
isStoppedin interfaceStoppable- Overrides:
isStoppedin classBaseHFileCleanerDelegate
-
abort
Description copied from interface:AbortableAbort the server or client. -
isAborted
Description copied from interface:AbortableCheck if the server or client was aborted.
-