T - Cleaner delegate class that is dynamically loaded from configurationpublic abstract class CleanerChore<T extends FileCleanerDelegate> extends ScheduledChore
| Modifier and Type | Field and Description |
|---|---|
protected List<T> |
cleanersChain |
| Constructor and Description |
|---|
CleanerChore(String name,
int sleepPeriod,
Stoppable s,
Configuration conf,
FileSystem fs,
Path oldFileDir,
String confKey) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
chore()
The task to execute on each scheduled execution of the Chore
|
void |
cleanup()
Override to run cleanup tasks when the Chore encounters an error and must stop running
|
protected abstract boolean |
validate(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, triggerNowprotected List<T extends FileCleanerDelegate> cleanersChain
public CleanerChore(String name, int sleepPeriod, Stoppable s, Configuration conf, FileSystem fs, Path oldFileDir, String confKey)
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 instantiateprotected abstract boolean validate(Path file)
file - full Path of the file to be checkedprotected void chore()
ScheduledChorechore in class ScheduledChorepublic void cleanup()
ScheduledChorecleanup in class ScheduledChore