org.apache.hadoop.hbase.master
Class LogsCleaner

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.hadoop.hbase.Chore
          extended by org.apache.hadoop.hbase.master.LogsCleaner
All Implemented Interfaces:
Runnable

public class LogsCleaner
extends Chore

This Chore, everytime it runs, will clear the logs in the old logs folder that are deletable for each log cleaner in the chain, in order to limit the number of deletes it sends, will only delete maximum 20 in a single run.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.Chore
stop
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LogsCleaner(int p, AtomicBoolean 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.
 
Methods inherited from class org.apache.hadoop.hbase.Chore
initialChore, run, sleep, triggerNow
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogsCleaner

public LogsCleaner(int p,
                   AtomicBoolean 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 run
s - the stopper boolean
conf - configuration to use
fs - handle to the FS
oldLogDir - the path to the archived logs
Method Detail

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 LogCleanerDelegate
conf -
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


Copyright © 2010 Apache Software Foundation. All Rights Reserved.