public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
BaseLogCleanerDelegate| Modifier and Type | Field and Description |
|---|---|
static int |
OLD_WALS_CLEANER_DEFAULT_SIZE |
static java.lang.String |
OLD_WALS_CLEANER_SIZE |
CHORE_POOL_SIZE, cleanersChain, fs, params| Constructor and Description |
|---|
LogCleaner(int period,
Stoppable stopper,
Configuration conf,
FileSystem fs,
Path oldLogDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(boolean mayInterruptIfRunning) |
void |
cleanup() |
protected int |
deleteFiles(java.lang.Iterable<FileStatus> filesToDelete)
Delete the given files
|
void |
onConfigurationChange(Configuration conf)
This method would be called by the
ConfigurationManager
object when the Configuration object is reloaded from disk. |
protected boolean |
validate(Path file)
Validate the file to see if it even belongs in the directory.
|
chore, getEnabled, runCleaner, setEnabledpublic static final java.lang.String OLD_WALS_CLEANER_SIZE
public static final int OLD_WALS_CLEANER_DEFAULT_SIZE
public LogCleaner(int period,
Stoppable stopper,
Configuration conf,
FileSystem fs,
Path oldLogDir)
period - the period of time to sleep between each runstopper - the stopperconf - configuration to usefs - handle to the FSoldLogDir - the path to the archived logsprotected boolean validate(Path file)
CleanerChorevalidate in class CleanerChore<BaseLogCleanerDelegate>file - full Path of the file to be checkedpublic void onConfigurationChange(Configuration conf)
ConfigurationObserverConfigurationManager
object when the Configuration object is reloaded from disk.onConfigurationChange in interface ConfigurationObserveronConfigurationChange in class CleanerChore<BaseLogCleanerDelegate>protected int deleteFiles(java.lang.Iterable<FileStatus> filesToDelete)
CleanerChoredeleteFiles in class CleanerChore<BaseLogCleanerDelegate>filesToDelete - files to deletepublic void cleanup()
cleanup in class CleanerChore<BaseLogCleanerDelegate>public void cancel(boolean mayInterruptIfRunning)