@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_CHECK_INTERVAL_MSEC |
static String |
OLD_WALS_CLEANER_THREAD_SIZE |
static String |
OLD_WALS_CLEANER_THREAD_TIMEOUT_MSEC |
CHORE_POOL_SIZE, cleanersChain, fs, params| Constructor and Description |
|---|
LogCleaner(int p,
Stoppable s,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldLogDir,
DirScanPool pool) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(boolean mayInterruptIfRunning) |
void |
cleanup()
Override to run cleanup tasks when the Chore encounters an error and must stop running
|
protected int |
deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
Delete the given files
|
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. |
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, 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 static final String OLD_WALS_CLEANER_THREAD_CHECK_INTERVAL_MSEC
public LogCleaner(int p,
Stoppable s,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldLogDir,
DirScanPool pool)
p - the period of time to sleep between each runs - the stopperconf - configuration to usefs - handle to the FSoldLogDir - the path to the archived logsprotected 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)
ConfigurationObserverConfigurationManager
object when the Configuration object is reloaded from disk.onConfigurationChange in interface ConfigurationObserverprotected int deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
CleanerChoredeleteFiles in class CleanerChore<BaseLogCleanerDelegate>filesToDelete - files to deletepublic void cleanup()
ScheduledChorecleanup in class CleanerChore<BaseLogCleanerDelegate>public void cancel(boolean mayInterruptIfRunning)
cancel in class ScheduledChoreCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.