Class ReplicationHFileCleaner
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.replication.master.ReplicationHFileCleaner
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,FileCleanerDelegate
,Stoppable
@LimitedPrivate("Configuration")
public class ReplicationHFileCleaner
extends BaseHFileCleanerDelegate
Implementation of a file cleaner that checks if a hfile is still scheduled for replication before
deleting it from hfile archive directory.
-
Field Summary
Modifier and TypeFieldDescriptionprivate Connection
private static final org.slf4j.Logger
private ReplicationQueueStorage
private boolean
private boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIterable<org.apache.hadoop.fs.FileStatus>
getDeletableFiles
(Iterable<org.apache.hadoop.fs.FileStatus> files) Determines which of the given files are safe to deletevoid
this method is used to pass some instance into subclassboolean
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.void
Stop this service.Methods inherited from class org.apache.hadoop.hbase.BaseConfigurable
getConf, setConf
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, setConf
Methods inherited from interface org.apache.hadoop.hbase.master.cleaner.FileCleanerDelegate
isEmptyDirDeletable, postClean, preClean
-
Field Details
-
LOG
-
conn
-
rqs
-
stopped
-
-
Constructor Details
-
ReplicationHFileCleaner
public ReplicationHFileCleaner()
-
-
Method Details
-
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
-
init
Description copied from interface:FileCleanerDelegate
this method is used to pass some instance into subclass- Specified by:
init
in interfaceFileCleanerDelegate
- Overrides:
init
in classBaseFileCleanerDelegate
-
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
-
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
-