@InterfaceAudience.LimitedPrivate(value="Configuration") @InterfaceStability.Evolving public class SnapshotHFileCleaner extends BaseHFileCleanerDelegate
Modifier and Type | Field and Description |
---|---|
private SnapshotFileCache |
cache
File cache for HFiles in the completed and currently running snapshots
|
private static long |
DEFAULT_HFILE_CACHE_REFRESH_PERIOD
Refresh cache, by default, every 5 minutes
|
static 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)
|
private static org.slf4j.Logger |
LOG |
private MasterServices |
master |
Constructor and Description |
---|
SnapshotHFileCleaner() |
Modifier and Type | Method and Description |
---|---|
Iterable<org.apache.hadoop.fs.FileStatus> |
getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files)
Determines which of the given files are safe to delete
|
SnapshotFileCache |
getFileCacheForTesting()
Exposed for Testing!
|
void |
init(Map<String,Object> params)
this method is used to pass some instance into subclass
|
protected boolean |
isFileDeletable(org.apache.hadoop.fs.FileStatus fStat)
Should the master delete the file or keep it?
|
boolean |
isStopped()
Returns True if
Stoppable.stop(String) has been closed. |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
stop(String why)
Stop this service.
|
getConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEmptyDirDeletable, preClean
private static final org.slf4j.Logger LOG
public static final String HFILE_CACHE_REFRESH_PERIOD_CONF_KEY
private static final long DEFAULT_HFILE_CACHE_REFRESH_PERIOD
private SnapshotFileCache cache
private MasterServices master
public SnapshotHFileCleaner()
public Iterable<org.apache.hadoop.fs.FileStatus> getDeletableFiles(Iterable<org.apache.hadoop.fs.FileStatus> files)
FileCleanerDelegate
getDeletableFiles
in interface FileCleanerDelegate
getDeletableFiles
in class BaseFileCleanerDelegate
files
- files to check for deletionpublic void init(Map<String,Object> params)
FileCleanerDelegate
init
in interface FileCleanerDelegate
init
in class BaseFileCleanerDelegate
protected boolean isFileDeletable(org.apache.hadoop.fs.FileStatus fStat)
BaseFileCleanerDelegate
isFileDeletable
in class BaseFileCleanerDelegate
fStat
- file status of the file to checkpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
setConf
in class BaseConfigurable
public void stop(String why)
Stoppable
stop
in interface Stoppable
stop
in class BaseHFileCleanerDelegate
why
- Why we're stopping.public boolean isStopped()
Stoppable
Stoppable.stop(String)
has been closed.isStopped
in interface Stoppable
isStopped
in class BaseHFileCleanerDelegate
public SnapshotFileCache getFileCacheForTesting()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.