@InterfaceAudience.Private public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate> implements ConfigurationObserver
BaseLogCleanerDelegate| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_OLD_WALS_CLEANER_THREAD_SIZE |
static String |
OLD_WALS_CLEANER_THREAD_SIZE |
static String |
OLD_WALS_CLEANER_THREAD_TIMEOUT_MSEC |
CHORE_POOL_SIZE, cleanersChain, excludeDirs, fs, LOG_CLEANER_CHORE_DIRECTORY_SORTING, LOG_CLEANER_CHORE_SIZE, params| Constructor and Description |
|---|
LogCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldLogDir,
DirScanPool pool,
Map<String,Object> params) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(boolean mayInterruptIfRunning) |
void |
cleanup() |
protected int |
deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
Delete the given files
|
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf) |
protected boolean |
validate(org.apache.hadoop.fs.Path file)
Validate the file to see if it even belongs in the directory.
|
chore, getEnabled, runCleaner, setEnabledcancel, choreForTesting, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, shutdown, shutdown, toString, triggerNowpublic static final String OLD_WALS_CLEANER_THREAD_SIZE
public static final int DEFAULT_OLD_WALS_CLEANER_THREAD_SIZE
public static final String OLD_WALS_CLEANER_THREAD_TIMEOUT_MSEC
public LogCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldLogDir,
DirScanPool pool,
Map<String,Object> params)
period - the period of time to sleep between each runstopper - the stopperconf - configuration to usefs - handle to the FSoldLogDir - the path to the archived logspool - the thread pool used to scan directoriesprotected boolean validate(org.apache.hadoop.fs.Path file)
CleanerChorevalidate in class CleanerChore<BaseLogCleanerDelegate>file - full Path of the file to be checkedpublic void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
onConfigurationChange in interface ConfigurationObserverprotected int deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
CleanerChoredeleteFiles in class CleanerChore<BaseLogCleanerDelegate>filesToDelete - files to deletepublic void cleanup()
cleanup in class CleanerChore<BaseLogCleanerDelegate>public void cancel(boolean mayInterruptIfRunning)
cancel in class ScheduledChoreCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.