org.apache.hadoop.hbase.master.cleaner
Class LogCleaner

java.lang.Object
  extended by org.apache.hadoop.hbase.util.HasThread
      extended by org.apache.hadoop.hbase.Chore
          extended by org.apache.hadoop.hbase.master.cleaner.CleanerChore<BaseLogCleanerDelegate>
              extended by org.apache.hadoop.hbase.master.cleaner.LogCleaner
All Implemented Interfaces:
Runnable

@InterfaceAudience.Private
public class LogCleaner
extends CleanerChore<BaseLogCleanerDelegate>

This Chore, every time it runs, will attempt to delete the HLogs in the old logs folder. The HLog is only deleted if none of the cleaner delegates says otherwise.

See Also:
BaseLogCleanerDelegate

Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.master.cleaner.CleanerChore
cleanersChain
 
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
protected  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.master.cleaner.CleanerChore
chore, cleanup
 
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

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 run
s - the stopper
conf - configuration to use
fs - handle to the FS
oldLogDir - the path to the archived logs
Method Detail

validate

protected boolean validate(org.apache.hadoop.fs.Path file)
Description copied from class: CleanerChore
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.

Specified by:
validate in class CleanerChore<BaseLogCleanerDelegate>
Parameters:
file - full Path of the file to be checked
Returns:
true if the file is valid, false otherwise


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.