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

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<BaseHFileCleanerDelegate>
              extended by org.apache.hadoop.hbase.master.cleaner.HFileCleaner
All Implemented Interfaces:
Runnable

@InterfaceAudience.Private
public class HFileCleaner
extends CleanerChore<BaseHFileCleanerDelegate>

This Chore, every time it runs, will clear the HFiles in the hfile archive folder that are deletable for each HFile cleaner in the chain.


Field Summary
static String MASTER_HFILE_CLEANER_PLUGINS
           
 
Fields inherited from class org.apache.hadoop.hbase.master.cleaner.CleanerChore
cleanersChain
 
Fields inherited from class org.apache.hadoop.hbase.Chore
stopper
 
Constructor Summary
HFileCleaner(int period, Stoppable stopper, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path directory)
           
 
Method Summary
 List<BaseHFileCleanerDelegate> getDelegatesForTesting()
          Exposed for TESTING!
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
 

Field Detail

MASTER_HFILE_CLEANER_PLUGINS

public static final String MASTER_HFILE_CLEANER_PLUGINS
See Also:
Constant Field Values
Constructor Detail

HFileCleaner

public HFileCleaner(int period,
                    Stoppable stopper,
                    org.apache.hadoop.conf.Configuration conf,
                    org.apache.hadoop.fs.FileSystem fs,
                    org.apache.hadoop.fs.Path directory)
Parameters:
period - the period of time to sleep between each run
stopper - the stopper
conf - configuration to use
fs - handle to the FS
directory - directory to be cleaned
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<BaseHFileCleanerDelegate>
Parameters:
file - full Path of the file to be checked
Returns:
true if the file is valid, false otherwise

getDelegatesForTesting

public List<BaseHFileCleanerDelegate> getDelegatesForTesting()
Exposed for TESTING!



Copyright © 2015 The Apache Software Foundation. All rights reserved.