@InterfaceAudience.Private public class CompactSplit extends Object implements CompactionRequester, PropagatingConfigurationObserver
| Modifier and Type | Class and Description |
|---|---|
private static class |
CompactSplit.AggregatingCompleteTracker |
private 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.
|
| Modifier and Type | Field and Description |
|---|---|
private boolean |
compactionsEnabled |
private ThroughputController |
compactionThroughputController |
private static Comparator<Runnable> |
COMPARATOR |
private org.apache.hadoop.conf.Configuration |
conf |
static int |
DEFAULT_REGION_SERVER_REGION_SPLIT_LIMIT |
private static CompactSplit.CompactionCompleteTracker |
DUMMY_COMPLETE_TRACKER |
static String |
HBASE_REGION_SERVER_ENABLE_COMPACTION |
static String |
LARGE_COMPACTION_THREADS |
static int |
LARGE_COMPACTION_THREADS_DEFAULT |
private static org.slf4j.Logger |
LOG |
private ThreadPoolExecutor |
longCompactions |
static String |
REGION_SERVER_REGION_SPLIT_LIMIT |
private int |
regionSplitLimit
Splitting should not take place if the total number of regions exceed this.
|
private HRegionServer |
server |
private ThreadPoolExecutor |
shortCompactions |
static String |
SMALL_COMPACTION_THREADS |
static int |
SMALL_COMPACTION_THREADS_DEFAULT |
static String |
SPLIT_THREADS |
static int |
SPLIT_THREADS_DEFAULT |
private ThreadPoolExecutor |
splits |
| Constructor and Description |
|---|
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() |
int |
getRegionSplitLimit() |
(package private) ThreadPoolExecutor |
getShortCompactions() |
int |
getSmallCompactionQueueSize() |
protected int |
getSmallCompactionThreadNum() |
int |
getSplitQueueSize() |
protected int |
getSplitThreadNum() |
private void |
interrupt() |
(package private) void |
interruptIfNecessary()
Only interrupt once it's done with a run through the work loop.
|
boolean |
isCompactionsEnabled() |
(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.
|
private 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) |
void |
requestSplit(Region r,
byte[] midKey) |
void |
requestSplit(Region r,
byte[] midKey,
User user) |
void |
requestSystemCompaction(HRegion region,
HStore store,
String why) |
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() |
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 boolean compactionsEnabled
private int regionSplitLimit
private static final CompactSplit.CompactionCompleteTracker DUMMY_COMPLETE_TRACKER
private static final Comparator<Runnable> COMPARATOR
CompactSplit(HRegionServer server)
server - private void createSplitExcecutors()
private void createCompactionExecutors()
public boolean requestSplit(Region r)
public void requestSplit(Region r, byte[] midKey)
public 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
CompactionRequesterrequestCompaction in interface CompactionRequesterIOExceptionpublic void requestCompaction(HRegion region, HStore store, String why, int priority, CompactionLifeCycleTracker tracker, User user) throws IOException
CompactionRequesterrequestCompaction in interface CompactionRequesterIOExceptionpublic void switchCompaction(boolean onOrOff)
CompactionRequesterswitchCompaction in interface CompactionRequesterprivate void requestCompactionInternal(HRegion region, String why, int priority, boolean selectNow, CompactionLifeCycleTracker tracker, CompactSplit.CompactionCompleteTracker completeTracker, User user) throws IOException
IOExceptionprivate void requestCompactionInternal(HRegion region, HStore store, String why, int priority, boolean selectNow, CompactionLifeCycleTracker tracker, CompactSplit.CompactionCompleteTracker completeTracker, User user) throws IOException
IOExceptionpublic void requestSystemCompaction(HRegion region, String why) throws IOException
IOExceptionpublic void requestSystemCompaction(HRegion region, HStore store, String why) throws IOException
IOExceptionprivate Optional<CompactionContext> selectCompaction(HRegion region, HStore store, int priority, CompactionLifeCycleTracker tracker, CompactSplit.CompactionCompleteTracker completeTracker, User user) throws IOException
IOExceptionvoid 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 void onConfigurationChange(org.apache.hadoop.conf.Configuration newConf)
ConfigurationManager
object when the Configuration object is reloaded from disk.onConfigurationChange in interface ConfigurationObserverprotected int getSmallCompactionThreadNum()
protected int getLargeCompactionThreadNum()
protected int getSplitThreadNum()
public void registerChildren(ConfigurationManager manager)
registerChildren in interface PropagatingConfigurationObservermanager - : to register topublic void deregisterChildren(ConfigurationManager manager)
deregisterChildren in interface PropagatingConfigurationObservermanager - : 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()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.