@InterfaceAudience.Private public class HFileCleaner extends CleanerChore<BaseHFileCleanerDelegate> implements ConfigurationObserver
| Modifier and Type | Field and Description |
|---|---|
static String |
CUSTOM_POOL_SIZE |
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_CLEANER_CUSTOM_PATHS
The custom paths for hfile cleaner, subdirectories of archive, e.g.
|
static String |
HFILE_CLEANER_CUSTOM_PATHS_PLUGINS
Configure hfile cleaner classes for the custom paths
|
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, excludeDirs, fs, LOG_CLEANER_CHORE_DIRECTORY_SORTING, LOG_CLEANER_CHORE_SIZE, 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,
DirScanPool pool) |
HFileCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory,
DirScanPool pool,
Map<String,Object> params) |
HFileCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory,
DirScanPool pool,
Map<String,Object> params,
List<org.apache.hadoop.fs.Path> excludePaths) |
HFileCleaner(String name,
int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory,
String confKey,
DirScanPool pool,
Map<String,Object> params,
List<org.apache.hadoop.fs.Path> excludePaths)
For creating customized HFileCleaner.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(boolean mayInterruptIfRunning) |
void |
cleanup() |
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) |
protected boolean |
validate(org.apache.hadoop.fs.Path file)
Validate the file to see if it even belongs in the directory.
|
chore, getEnabled, runCleaner, setEnabledcancel, choreForTesting, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, shutdown, shutdown, toString, triggerNowpublic 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 static final String HFILE_CLEANER_CUSTOM_PATHS
public static final String HFILE_CLEANER_CUSTOM_PATHS_PLUGINS
public static final String CUSTOM_POOL_SIZE
public HFileCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory,
DirScanPool pool)
public HFileCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory,
DirScanPool pool,
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 cleanedpool - the thread pool used to scan directoriesparams - params could be used in subclass of BaseHFileCleanerDelegatepublic HFileCleaner(int period,
Stoppable stopper,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path directory,
DirScanPool pool,
Map<String,Object> params,
List<org.apache.hadoop.fs.Path> excludePaths)
public HFileCleaner(String name, int period, Stoppable stopper, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path directory, String confKey, DirScanPool pool, Map<String,Object> params, List<org.apache.hadoop.fs.Path> excludePaths)
name - name of the chore being runperiod - the period of time to sleep between each runstopper - the stopperconf - configuration to usefs - handle to the FSdirectory - directory to be cleanedconfKey - configuration key for the classes to instantiatepool - the thread pool used to scan directoriesparams - params could be used in subclass of BaseHFileCleanerDelegateprotected boolean validate(org.apache.hadoop.fs.Path file)
CleanerChorevalidate 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)
CleanerChoredeleteFiles in class CleanerChore<BaseHFileCleanerDelegate>filesToDelete - files to deletepublic void cleanup()
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)
onConfigurationChange in interface ConfigurationObserverpublic void cancel(boolean mayInterruptIfRunning)
cancel in class ScheduledChoreCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.