org.apache.hadoop.hbase.master.cleaner
Class CleanerChore<T extends FileCleanerDelegate>
java.lang.Object
org.apache.hadoop.hbase.util.HasThread
org.apache.hadoop.hbase.Chore
org.apache.hadoop.hbase.master.cleaner.CleanerChore<T>
- Type Parameters:
T
- Cleaner delegate class that is dynamically loaded from configuration
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- HFileCleaner, LogCleaner
public abstract class CleanerChore<T extends FileCleanerDelegate>
- extends Chore
Abstract Cleaner that uses a chain of delegates to clean a directory of files
Fields inherited from class org.apache.hadoop.hbase.Chore |
stopper |
Constructor Summary |
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)
|
Method Summary |
protected void |
chore()
Look for chores. |
void |
cleanup()
Called when the chore has completed, allowing subclasses to cleanup any
extra overhead |
protected abstract boolean |
validate(org.apache.hadoop.fs.Path file)
Validate the file to see if it even belongs in the directory. |
Methods inherited from class org.apache.hadoop.hbase.util.HasThread |
getName, getThread, interrupt, isAlive, isInterrupted, join, join, join, setDaemon, setName, setPriority, setUncaughtExceptionHandler, start |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CleanerChore
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)
- Parameters:
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 instantiate
validate
protected abstract boolean validate(org.apache.hadoop.fs.Path file)
- Validate the file to see if it even belongs in the directory. If it is valid, then the file
will go through the cleaner delegates, but otherwise the file is just deleted.
- Parameters:
file
- full Path
of the file to be checked
- Returns:
- true if the file is valid, false otherwise
chore
protected void chore()
- Description copied from class:
Chore
- Look for chores. If any found, do them else just return.
- Specified by:
chore
in class Chore
cleanup
public void cleanup()
- Description copied from class:
Chore
- Called when the chore has completed, allowing subclasses to cleanup any
extra overhead
- Overrides:
cleanup
in class Chore
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.