|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.util.HasThread
org.apache.hadoop.hbase.Chore
org.apache.hadoop.hbase.master.cleaner.CleanerChore<T>
T
- Cleaner delegate class that is dynamically loaded from configurationpublic abstract class CleanerChore<T extends FileCleanerDelegate>
Abstract Cleaner that uses a chain of delegates to clean a directory of files
Field Summary |
---|
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 | |
---|---|
boolean |
checkAndDeleteDirectory(org.apache.hadoop.fs.Path toCheck)
Attempt to delete a directory and all files under that directory. |
protected void |
chore()
Look for chores. |
void |
cleanup()
Called when the chore has completed, allowing subclasses to cleanup any extra overhead |
T |
newFileCleaner(String className,
org.apache.hadoop.conf.Configuration conf)
A utility method to create new instances of LogCleanerDelegate based on the class name of the LogCleanerDelegate. |
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.Chore |
---|
choreForTesting, initialChore, run, sleep, triggerNow |
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 |
Constructor Detail |
---|
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)
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 instantiateMethod Detail |
---|
protected abstract boolean validate(org.apache.hadoop.fs.Path file)
file
- full Path
of the file to be checked
public T newFileCleaner(String className, org.apache.hadoop.conf.Configuration conf)
className
- fully qualified class name of the LogCleanerDelegateconf
-
protected void chore()
Chore
chore
in class Chore
public boolean checkAndDeleteDirectory(org.apache.hadoop.fs.Path toCheck) throws IOException
If new children files are added between checks of the directory, the directory will not be deleted.
toCheck
- directory to check
IOException
- if there is an unexpected filesystem errorpublic void cleanup()
Chore
cleanup
in class Chore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |