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
Implementation of a file cleaner that checks if an hfile is still referenced by backup before
deleting it from hfile archive directory.
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private boolean
private org.apache.hadoop.conf.Configuration
private Connection
private static final org.slf4j.Logger
private long
private long
private boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Abort 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 deletegetFilenameFromBulkLoad
(Map<byte[], List<org.apache.hadoop.fs.Path>>[] maps) boolean
Check if the server or client was aborted.boolean
isFileDeletable
(org.apache.hadoop.fs.FileStatus fStat) Should the master delete the file or keep it?boolean
Returns True ifStoppable.stop(String)
has been closed.loadHFileRefs
(List<TableName> tableList) (package private) void
setCheckForFullyBackedUpTables
(boolean b) void
setConf
(org.apache.hadoop.conf.Configuration config) void
Stop this service.Methods inherited from class org.apache.hadoop.hbase.master.cleaner.BaseFileCleanerDelegate
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
-
stopped
-
aborted
-
conf
-
connection
-
prevReadFromBackupTbl
-
secondPrevReadFromBackupTbl
-
checkForFullyBackedUpTables
-
fullyBackedUpTables
-
-
Constructor Details
-
BackupHFileCleaner
public BackupHFileCleaner()
-
-
Method Details
-
getFilenameFromBulkLoad
-
loadHFileRefs
- Throws:
IOException
-
setCheckForFullyBackedUpTables
-
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
-
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:
why
- Why we're stopping.
-
isStopped
Description copied from interface:Stoppable
Returns True ifStoppable.stop(String)
has been closed.- Specified by:
isStopped
in interfaceStoppable
- Overrides:
isStopped
in classBaseHFileCleanerDelegate
-
abort
Description copied from interface:Abortable
Abort the server or client. -
isAborted
Description copied from interface:Abortable
Check if the server or client was aborted.
-