@InterfaceAudience.Private public class CompactSplit extends Object implements CompactionRequester, PropagatingConfigurationObserver
Modifier and Type | Class and Description |
---|---|
private static class |
CompactSplit.AggregatingCompleteTracker |
protected static interface |
CompactSplit.CompactionCompleteTracker |
private class |
CompactSplit.CompactionRunner |
private static class |
CompactSplit.Rejection
Cleanup class to use when rejecting a compaction request from the queue.
|
Constructor and Description |
---|
CompactSplit(org.apache.hadoop.conf.Configuration conf) |
CompactSplit(HRegionServer server) |
Modifier and Type | Method and Description |
---|---|
void |
clearLongCompactionsQueue() |
void |
clearShortCompactionsQueue() |
private void |
createCompactionExecutors() |
private void |
createSplitExcecutors() |
void |
deregisterChildren(ConfigurationManager manager)
Needs to be called to deregister the children from the manager.
|
String |
dumpQueue() |
int |
getCompactionQueueSize()
Returns the current size of the queue containing regions that are processed.
|
ThroughputController |
getCompactionThroughputController() |
private CompactSplit.CompactionCompleteTracker |
getCompleteTracker(CompactionLifeCycleTracker tracker,
IntSupplier numberOfStores) |
int |
getLargeCompactionQueueSize() |
protected int |
getLargeCompactionThreadNum() |
(package private) ThreadPoolExecutor |
getLongCompactions()
Returns the longCompactions thread pool executor
|
int |
getRegionSplitLimit()
Returns the regionSplitLimit
|
(package private) ThreadPoolExecutor |
getShortCompactions()
Returns the shortCompactions thread pool executor
|
int |
getSmallCompactionQueueSize() |
protected int |
getSmallCompactionThreadNum() |
int |
getSplitQueueSize() |
protected int |
getSplitThreadNum() |
private String |
getStoreNameForUnderCompaction(HStore store) |
private void |
interrupt() |
(package private) void |
interruptIfNecessary()
Only interrupt once it's done with a run through the work loop.
|
boolean |
isCompactionsEnabled() |
boolean |
isUnderCompaction(HStore s)
Check if this store is under compaction
|
(package private) void |
join() |
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration newConf)
This method would be called by the
ConfigurationManager object when the
Configuration object is reloaded from disk. |
void |
registerChildren(ConfigurationManager manager)
Needs to be called to register the children to the manager.
|
private void |
reInitializeCompactionsExecutors() |
void |
requestCompaction(HRegion region,
HStore store,
String why,
int priority,
CompactionLifeCycleTracker tracker,
User user)
Request compaction on the given store.
|
void |
requestCompaction(HRegion region,
String why,
int priority,
CompactionLifeCycleTracker tracker,
User user)
Request compaction on all the stores of the given region.
|
protected void |
requestCompactionInternal(HRegion region,
HStore store,
String why,
int priority,
boolean selectNow,
CompactionLifeCycleTracker tracker,
CompactSplit.CompactionCompleteTracker completeTracker,
User user) |
private void |
requestCompactionInternal(HRegion region,
String why,
int priority,
boolean selectNow,
CompactionLifeCycleTracker tracker,
CompactSplit.CompactionCompleteTracker completeTracker,
User user) |
boolean |
requestSplit(Region r) |
private void |
requestSplit(Region r,
byte[] midKey) |
private void |
requestSplit(Region r,
byte[] midKey,
User user) |
void |
requestSystemCompaction(HRegion region,
HStore store,
String why) |
void |
requestSystemCompaction(HRegion region,
HStore store,
String why,
boolean giveUpIfRequestedOrCompacting)
Request system compaction on the given store.
|
void |
requestSystemCompaction(HRegion region,
String why) |
private Optional<CompactionContext> |
selectCompaction(HRegion region,
HStore store,
int priority,
CompactionLifeCycleTracker tracker,
CompactSplit.CompactionCompleteTracker completeTracker,
User user) |
void |
setCompactionsEnabled(boolean compactionsEnabled) |
private boolean |
shouldSplitRegion() |
(package private) void |
shutdownLongCompactions()
Shutdown the long compaction thread pool.
|
void |
switchCompaction(boolean onOrOff)
on/off compaction
|
String |
toString() |
private void |
waitFor(ThreadPoolExecutor t,
String name) |
private static final org.slf4j.Logger LOG
public static final String LARGE_COMPACTION_THREADS
public static final int LARGE_COMPACTION_THREADS_DEFAULT
public static final String SMALL_COMPACTION_THREADS
public static final int SMALL_COMPACTION_THREADS_DEFAULT
public static final String SPLIT_THREADS
public static final int SPLIT_THREADS_DEFAULT
public static final String REGION_SERVER_REGION_SPLIT_LIMIT
public static final int DEFAULT_REGION_SERVER_REGION_SPLIT_LIMIT
public static final String HBASE_REGION_SERVER_ENABLE_COMPACTION
private final HRegionServer server
private final org.apache.hadoop.conf.Configuration conf
private volatile ThreadPoolExecutor longCompactions
private volatile ThreadPoolExecutor shortCompactions
private volatile ThreadPoolExecutor splits
private volatile ThroughputController compactionThroughputController
private volatile Set<String> underCompactionStores
private volatile boolean compactionsEnabled
private int regionSplitLimit
private static final CompactSplit.CompactionCompleteTracker DUMMY_COMPLETE_TRACKER
private static final Comparator<Runnable> COMPARATOR
CompactSplit(HRegionServer server)
public CompactSplit(org.apache.hadoop.conf.Configuration conf)
private void createSplitExcecutors()
private void createCompactionExecutors()
public boolean requestSplit(Region r)
private void requestSplit(Region r, byte[] midKey)
private void requestSplit(Region r, byte[] midKey, User user)
private void interrupt()
private void reInitializeCompactionsExecutors()
private CompactSplit.CompactionCompleteTracker getCompleteTracker(CompactionLifeCycleTracker tracker, IntSupplier numberOfStores)
public void requestCompaction(HRegion region, String why, int priority, CompactionLifeCycleTracker tracker, User user) throws IOException
CompactionRequester
requestCompaction
in interface CompactionRequester
IOException
public void requestCompaction(HRegion region, HStore store, String why, int priority, CompactionLifeCycleTracker tracker, User user) throws IOException
CompactionRequester
requestCompaction
in interface CompactionRequester
IOException
public void switchCompaction(boolean onOrOff)
CompactionRequester
switchCompaction
in interface CompactionRequester
private void requestCompactionInternal(HRegion region, String why, int priority, boolean selectNow, CompactionLifeCycleTracker tracker, CompactSplit.CompactionCompleteTracker completeTracker, User user) throws IOException
IOException
protected void requestCompactionInternal(HRegion region, HStore store, String why, int priority, boolean selectNow, CompactionLifeCycleTracker tracker, CompactSplit.CompactionCompleteTracker completeTracker, User user) throws IOException
IOException
public void requestSystemCompaction(HRegion region, String why) throws IOException
IOException
public void requestSystemCompaction(HRegion region, HStore store, String why) throws IOException
IOException
public void requestSystemCompaction(HRegion region, HStore store, String why, boolean giveUpIfRequestedOrCompacting) throws IOException
CompactionRequester
requestSystemCompaction
in interface CompactionRequester
IOException
private Optional<CompactionContext> selectCompaction(HRegion region, HStore store, int priority, CompactionLifeCycleTracker tracker, CompactSplit.CompactionCompleteTracker completeTracker, User user) throws IOException
IOException
void interruptIfNecessary()
private void waitFor(ThreadPoolExecutor t, String name)
void join()
public int getCompactionQueueSize()
public int getLargeCompactionQueueSize()
public int getSmallCompactionQueueSize()
public int getSplitQueueSize()
private boolean shouldSplitRegion()
public int getRegionSplitLimit()
public boolean isUnderCompaction(HStore s)
public void onConfigurationChange(org.apache.hadoop.conf.Configuration newConf)
ConfigurationManager
object when the
Configuration
object is reloaded from disk.onConfigurationChange
in interface ConfigurationObserver
protected int getSmallCompactionThreadNum()
protected int getLargeCompactionThreadNum()
protected int getSplitThreadNum()
public void registerChildren(ConfigurationManager manager)
registerChildren
in interface PropagatingConfigurationObserver
manager
- : to register topublic void deregisterChildren(ConfigurationManager manager)
deregisterChildren
in interface PropagatingConfigurationObserver
manager
- : to deregister frompublic ThroughputController getCompactionThroughputController()
void shutdownLongCompactions()
public void clearLongCompactionsQueue()
public void clearShortCompactionsQueue()
public boolean isCompactionsEnabled()
public void setCompactionsEnabled(boolean compactionsEnabled)
ThreadPoolExecutor getLongCompactions()
ThreadPoolExecutor getShortCompactions()
private String getStoreNameForUnderCompaction(HStore store)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.