Class CompactedHFilesDischarger
java.lang.Object
org.apache.hadoop.hbase.ScheduledChore
org.apache.hadoop.hbase.regionserver.CompactedHFilesDischarger
- All Implemented Interfaces:
Runnable
A chore service that periodically cleans up the compacted files when there are no active readers
using those compacted files and also helps in clearing the block cache of these compacted file
entries.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private RegionServerServices
private boolean
-
Constructor Summary
ConstructorDescriptionCompactedHFilesDischarger
(int period, Stoppable stopper, RegionServerServices regionServerServices) CompactedHFilesDischarger
(int period, Stoppable stopper, RegionServerServices regionServerServices, boolean useExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
chore()
The task to execute on each scheduled execution of the Choreboolean
setUseExecutor
(boolean useExecutor) CompactedHFilesDischarger runs asynchronously by default using the hosting RegionServer's Executor.Methods inherited from class org.apache.hadoop.hbase.ScheduledChore
cancel, cancel, choreForTesting, cleanup, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, shutdown, shutdown, toString, triggerNow
-
Field Details
-
LOG
-
regionServerServices
-
useExecutor
-
-
Constructor Details
-
CompactedHFilesDischarger
public CompactedHFilesDischarger(int period, Stoppable stopper, RegionServerServices regionServerServices) - Parameters:
period
- the period of time to sleep between each runstopper
- the stopperregionServerServices
- the region server that starts this chore
-
CompactedHFilesDischarger
public CompactedHFilesDischarger(int period, Stoppable stopper, RegionServerServices regionServerServices, boolean useExecutor) - Parameters:
period
- the period of time to sleep between each runstopper
- the stopperregionServerServices
- the region server that starts this choreuseExecutor
- true if to use the region server's executor service, false otherwise
-
-
Method Details
-
setUseExecutor
CompactedHFilesDischarger runs asynchronously by default using the hosting RegionServer's Executor. In tests it can be useful to force a synchronous cleanup. Use this method to set no-executor before you call run.- Returns:
- The old setting for
useExecutor
-
chore
Description copied from class:ScheduledChore
The task to execute on each scheduled execution of the Chore- Specified by:
chore
in classScheduledChore
-