@InterfaceAudience.Private public class HFileCleaner extends CleanerChore<BaseHFileCleanerDelegate>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HFILE_DELETE_THROTTLE_THRESHOLD |
static int |
DEFAULT_LARGE_HFILE_DELETE_THREAD_NUMBER |
static int |
DEFAULT_LARGE_HFILE_QUEUE_INIT_SIZE |
static int |
DEFAULT_SMALL_HFILE_DELETE_THREAD_NUMBER |
static int |
DEFAULT_SMALL_HFILE_QUEUE_INIT_SIZE |
static String |
HFILE_DELETE_THREAD_CHECK_INTERVAL_MSEC |
static String |
HFILE_DELETE_THREAD_TIMEOUT_MSEC |
static String |
HFILE_DELETE_THROTTLE_THRESHOLD |
static String |
LARGE_HFILE_DELETE_THREAD_NUMBER |
static String |
LARGE_HFILE_QUEUE_INIT_SIZE |
static String |
MASTER_HFILE_CLEANER_PLUGINS |
static String |
SMALL_HFILE_DELETE_THREAD_NUMBER |
static String |
SMALL_HFILE_QUEUE_INIT_SIZE |
CHORE_POOL_SIZE, cleanersChain, fs, params
Constructor and Description |
---|
HFileCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory) |
HFileCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory,
Map<String,Object> params) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(boolean mayInterruptIfRunning) |
void |
cleanup()
Override to run cleanup tasks when the Chore encounters an error and must stop running
|
protected void |
consumerLoop(BlockingQueue<org.apache.hadoop.hbase.master.cleaner.HFileCleaner.HFileDeleteTask> queue) |
int |
deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
Delete the given files
|
List<Thread> |
getCleanerThreads() |
List<BaseHFileCleanerDelegate> |
getDelegatesForTesting()
Exposed for TESTING!
|
long |
getLargeQueueInitSize() |
long |
getNumOfDeletedLargeFiles() |
long |
getNumOfDeletedSmallFiles() |
long |
getSmallQueueInitSize() |
long |
getThrottlePoint() |
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
This method would be called by the
ConfigurationManager
object when the Configuration object is reloaded from disk. |
protected boolean |
validate(org.apache.hadoop.fs.Path file)
Validate the file to see if it even belongs in the directory.
|
chore, getEnabled, initChorePool, runCleaner, setEnabled, shutDownChorePool
cancel, choreForTesting, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, toString, triggerNow
public static final String MASTER_HFILE_CLEANER_PLUGINS
public static final String HFILE_DELETE_THROTTLE_THRESHOLD
public static final int DEFAULT_HFILE_DELETE_THROTTLE_THRESHOLD
public static final String LARGE_HFILE_QUEUE_INIT_SIZE
public static final int DEFAULT_LARGE_HFILE_QUEUE_INIT_SIZE
public static final String SMALL_HFILE_QUEUE_INIT_SIZE
public static final int DEFAULT_SMALL_HFILE_QUEUE_INIT_SIZE
public static final String LARGE_HFILE_DELETE_THREAD_NUMBER
public static final int DEFAULT_LARGE_HFILE_DELETE_THREAD_NUMBER
public static final String SMALL_HFILE_DELETE_THREAD_NUMBER
public static final int DEFAULT_SMALL_HFILE_DELETE_THREAD_NUMBER
public static final String HFILE_DELETE_THREAD_TIMEOUT_MSEC
public static final String HFILE_DELETE_THREAD_CHECK_INTERVAL_MSEC
public HFileCleaner(int period, Stoppable stopper, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path directory)
public HFileCleaner(int period, Stoppable stopper, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path directory, Map<String,Object> params)
period
- the period of time to sleep between each runstopper
- the stopperconf
- configuration to usefs
- handle to the FSdirectory
- directory to be cleanedparams
- params could be used in subclass of BaseHFileCleanerDelegateprotected boolean validate(org.apache.hadoop.fs.Path file)
CleanerChore
validate
in class CleanerChore<BaseHFileCleanerDelegate>
file
- full Path
of the file to be checkedpublic List<BaseHFileCleanerDelegate> getDelegatesForTesting()
public int deleteFiles(Iterable<org.apache.hadoop.fs.FileStatus> filesToDelete)
CleanerChore
deleteFiles
in class CleanerChore<BaseHFileCleanerDelegate>
filesToDelete
- files to deletepublic void cleanup()
ScheduledChore
cleanup
in class CleanerChore<BaseHFileCleanerDelegate>
protected void consumerLoop(BlockingQueue<org.apache.hadoop.hbase.master.cleaner.HFileCleaner.HFileDeleteTask> queue)
public long getNumOfDeletedLargeFiles()
public long getNumOfDeletedSmallFiles()
public long getLargeQueueInitSize()
public long getSmallQueueInitSize()
public long getThrottlePoint()
public void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
ConfigurationObserver
ConfigurationManager
object when the Configuration
object is reloaded from disk.onConfigurationChange
in interface ConfigurationObserver
onConfigurationChange
in class CleanerChore<BaseHFileCleanerDelegate>
public void cancel(boolean mayInterruptIfRunning)
cancel
in class ScheduledChore
Copyright © 2007–2019 Cloudera. All rights reserved.