org.apache.hadoop.hbase.master.snapshot
Class SnapshotHFileCleaner
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.master.snapshot.SnapshotHFileCleaner
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable, FileCleanerDelegate, Stoppable
@InterfaceAudience.LimitedPrivate(value="Configuration")
@InterfaceStability.Evolving
public class SnapshotHFileCleaner
- extends BaseHFileCleanerDelegate
Implementation of a file cleaner that checks if a hfile is still used by snapshots of HBase
tables.
| 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 |
HFILE_CACHE_REFRESH_PERIOD_CONF_KEY
public static final String HFILE_CACHE_REFRESH_PERIOD_CONF_KEY
- Conf key for the frequency to attempt to refresh the cache of hfiles currently used in
snapshots (ms)
- See Also:
- Constant Field Values
SnapshotHFileCleaner
public SnapshotHFileCleaner()
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 interface FileCleanerDelegate- Overrides:
getDeletableFiles in class BaseFileCleanerDelegate
- Parameters:
files - files to check for deletion
- Returns:
- files that are ok to delete according to this cleaner
isFileDeletable
protected boolean isFileDeletable(org.apache.hadoop.fs.FileStatus fStat)
- Description copied from class:
BaseFileCleanerDelegate
- Should the master delete the file or keep it?
- Specified by:
isFileDeletable in class BaseFileCleanerDelegate
- Parameters:
fStat - file status of the file to check
- Returns:
- true if the file is deletable, false if not
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf)
- Specified by:
setConf in interface org.apache.hadoop.conf.Configurable- Overrides:
setConf in class BaseConfigurable
stop
public void stop(String why)
- Specified by:
stop in interface Stoppable- Overrides:
stop in class BaseHFileCleanerDelegate
isStopped
public boolean isStopped()
- Specified by:
isStopped in interface Stoppable- Overrides:
isStopped in class BaseHFileCleanerDelegate
getFileCacheForTesting
public SnapshotFileCache getFileCacheForTesting()
- Exposed for Testing!
- Returns:
- the cache of all hfiles
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.