T - Cleaner delegate class that is dynamically loaded from configuration@InterfaceAudience.Private public abstract class CleanerChore<T extends FileCleanerDelegate> extends ScheduledChore implements ConfigurationObserver
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CHORE_POOL_SIZE
If it is an integer and >= 1, it would be the size;
if 0.0 < size <= 1.0, size would be available processors * size.
|
protected List<T> |
cleanersChain |
protected org.apache.hadoop.fs.FileSystem |
fs |
protected Map<String,Object> |
params |
| 构造器和说明 |
|---|
CleanerChore(String name,
int sleepPeriod,
Stoppable s,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldFileDir,
String confKey) |
CleanerChore(String name,
int sleepPeriod,
Stoppable s,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldFileDir,
String confKey,
Map<String,Object> params) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
chore() |
void |
cleanup() |
protected int |
deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
Delete the given files
|
boolean |
getEnabled() |
static void |
initChorePool(org.apache.hadoop.conf.Configuration conf) |
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
This method would be called by the
ConfigurationManager
object when the Configuration object is reloaded from disk. |
Boolean |
runCleaner() |
boolean |
setEnabled(boolean enabled) |
static void |
shutDownChorePool() |
protected abstract boolean |
validate(org.apache.hadoop.fs.Path file)
Validate the file to see if it even belongs in the directory.
|
cancel, cancel, choreForTesting, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, toString, triggerNowpublic static final String CHORE_POOL_SIZE
protected final org.apache.hadoop.fs.FileSystem fs
protected List<T extends FileCleanerDelegate> cleanersChain
public CleanerChore(String name, int sleepPeriod, Stoppable s, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path oldFileDir, String confKey)
public CleanerChore(String name, int sleepPeriod, Stoppable s, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path oldFileDir, String confKey, Map<String,Object> params)
name - name of the chore being runsleepPeriod - the period of time to sleep between each runs - the stopperconf - configuration to usefs - handle to the FSoldFileDir - the path to the archived filesconfKey - configuration key for the classes to instantiateparams - members could be used in cleanerpublic static void initChorePool(org.apache.hadoop.conf.Configuration conf)
public static void shutDownChorePool()
protected abstract boolean validate(org.apache.hadoop.fs.Path file)
file - full Path of the file to be checkedpublic void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
ConfigurationObserverConfigurationManager
object when the Configuration object is reloaded from disk.onConfigurationChange 在接口中 ConfigurationObserverprotected void chore()
chore 在类中 ScheduledChorepublic Boolean runCleaner()
protected int deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
filesToDelete - files to deletepublic void cleanup()
cleanup 在类中 ScheduledChorepublic boolean setEnabled(boolean enabled)
enabled - public boolean getEnabled()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.