org.apache.hadoop.hbase.master
Class LogCleaner
java.lang.Object
org.apache.hadoop.hbase.util.HasThread
org.apache.hadoop.hbase.Chore
org.apache.hadoop.hbase.master.LogCleaner
- All Implemented Interfaces:
- Runnable
public class LogCleaner
- extends Chore
This Chore, everytime it runs, will clear the HLogs in the old logs folder
that are deletable for each log cleaner in the chain.
| Fields inherited from class org.apache.hadoop.hbase.Chore |
stopper |
|
Constructor Summary |
LogCleaner(int p,
Stoppable s,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldLogDir)
|
|
Method Summary |
void |
addLogCleaner(LogCleanerDelegate logCleaner)
Add a LogCleanerDelegate to the log cleaner chain. |
protected void |
chore()
Look for chores. |
static LogCleanerDelegate |
newLogCleaner(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. |
void |
run()
|
| 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 |
LogCleaner
public LogCleaner(int p,
Stoppable s,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path oldLogDir)
- Parameters:
p - the period of time to sleep between each runs - the stopperconf - configuration to usefs - handle to the FSoldLogDir - the path to the archived logs
newLogCleaner
public static LogCleanerDelegate newLogCleaner(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.
- Parameters:
className - fully qualified class name of the LogCleanerDelegateconf -
- Returns:
- the new instance
addLogCleaner
public void addLogCleaner(LogCleanerDelegate logCleaner)
- Add a LogCleanerDelegate to the log cleaner chain. A log file is deletable
if it is deletable for each LogCleanerDelegate in the chain.
- Parameters:
logCleaner -
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
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Chore
- See Also:
Thread.run()
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.