T - Cleaner delegate class that is dynamically loaded from configuration@InterfaceAudience.Private public abstract class CleanerChore<T extends FileCleanerDelegate> extends ScheduledChore
| Modifier and Type | Field and Description |
|---|---|
static String |
CHORE_POOL_SIZE
Configures the threadpool used for scanning the archive directory for the HFileCleaner 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 List<String> |
excludeDirs |
protected org.apache.hadoop.fs.FileSystem |
fs |
static String |
LOG_CLEANER_CHORE_DIRECTORY_SORTING
Enable the CleanerChore to sort the subdirectories by consumed space and start the cleaning
with the largest subdirectory.
|
static String |
LOG_CLEANER_CHORE_SIZE
Configures the threadpool used for scanning the Old logs directory for the LogCleaner Follows
the same configuration mechanism as CHORE_POOL_SIZE, but has a default of 1 thread.
|
protected Map<String,Object> |
params |
| Constructor and Description |
|---|
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,
DirScanPool pool) |
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,
DirScanPool pool,
Map<String,Object> params,
List<org.apache.hadoop.fs.Path> excludePaths) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
chore() |
void |
cleanup() |
protected int |
deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
Delete the given files
|
boolean |
getEnabled() |
boolean |
runCleaner() |
boolean |
setEnabled(boolean enabled) |
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, shutdown, shutdown, toString, triggerNowpublic static final String CHORE_POOL_SIZE
public static final String LOG_CLEANER_CHORE_SIZE
public static final String LOG_CLEANER_CHORE_DIRECTORY_SORTING
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, DirScanPool pool)
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, DirScanPool pool, Map<String,Object> params, List<org.apache.hadoop.fs.Path> excludePaths)
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 instantiatepool - the thread pool used to scan directoriesparams - members could be used in cleanerprotected abstract boolean validate(org.apache.hadoop.fs.Path file)
file - full Path of the file to be checkedprotected void chore()
chore in class ScheduledChorepublic boolean runCleaner()
protected int deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
filesToDelete - files to deletepublic void cleanup()
cleanup in class ScheduledChorepublic boolean setEnabled(boolean enabled)
public boolean getEnabled()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.