@InterfaceAudience.Private public class CompactSplitThread extends Object implements CompactionRequestor, PropagatingConfigurationObserver
Modifier and Type | Class and Description |
---|---|
private class |
CompactSplitThread.CompactionRunner |
private static class |
CompactSplitThread.Rejection
Cleanup class to use when rejecting a compaction request from the queue.
|
Modifier and Type | Field and Description |
---|---|
private CompactionThroughputController |
compactionThroughputController |
private org.apache.hadoop.conf.Configuration |
conf |
static int |
DEFAULT_REGION_SERVER_REGION_SPLIT_LIMIT |
static String |
LARGE_COMPACTION_THREADS |
static int |
LARGE_COMPACTION_THREADS_DEFAULT |
private static org.apache.commons.logging.Log |
LOG |
private ThreadPoolExecutor |
longCompactions |
static String |
MERGE_THREADS |
static int |
MERGE_THREADS_DEFAULT |
private ThreadPoolExecutor |
mergePool |
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 |
---|
CompactSplitThread(HRegionServer server) |
private static final org.apache.commons.logging.Log 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 MERGE_THREADS
public static final int MERGE_THREADS_DEFAULT
public static final String REGION_SERVER_REGION_SPLIT_LIMIT
public static final int DEFAULT_REGION_SERVER_REGION_SPLIT_LIMIT
private final HRegionServer server
private final org.apache.hadoop.conf.Configuration conf
private final ThreadPoolExecutor longCompactions
private final ThreadPoolExecutor shortCompactions
private final ThreadPoolExecutor splits
private final ThreadPoolExecutor mergePool
private volatile CompactionThroughputController compactionThroughputController
private int regionSplitLimit
CompactSplitThread(HRegionServer server)
server
- public String dumpQueue()
public void requestRegionsMerge(Region a, Region b, boolean forcible, long masterSystemTime, User user)
public boolean requestSplit(Region r)
public void requestSplit(Region r, byte[] midKey)
public List<CompactionRequest> requestCompaction(Region r, String why) throws IOException
requestCompaction
in interface CompactionRequestor
r
- Region to compactwhy
- Why compaction was requested -- used in debug messagesCompactionRequests
or an empty list if no
compactions were startedIOException
public List<CompactionRequest> requestCompaction(Region r, String why, List<Pair<CompactionRequest,Store>> requests) throws IOException
requestCompaction
in interface CompactionRequestor
r
- Region to compactwhy
- Why compaction was requested -- used in debug messagesrequests
- custom compaction requests. Each compaction must specify the store on which it
is acting. Can be null in which case a compaction will be attempted on all
stores for the region.CompactionRequests
or an empty list if no
compactions were startedIOException
public CompactionRequest requestCompaction(Region r, Store s, String why, CompactionRequest request) throws IOException
requestCompaction
in interface CompactionRequestor
r
- Region to compacts
- Store within region to compactwhy
- Why compaction was requested -- used in debug messagesrequest
- custom compaction request for the Region
and Store
. Custom
request must be null or be constructed with matching region and store.CompactionRequest
or null if no compaction was started.IOException
public List<CompactionRequest> requestCompaction(Region r, String why, int p, List<Pair<CompactionRequest,Store>> requests, User user) throws IOException
requestCompaction
in interface CompactionRequestor
r
- Region to compactwhy
- Why compaction was requested -- used in debug messagesp
- Priority of this compaction. minHeap. <=0 is criticalrequests
- custom compaction requests. Each compaction must specify the store on which it
is acting. Can be null in which case a compaction will be attempted on all
stores for the region.user
- the effective userCompactionRequests
or an empty list if no
compactions were started.IOException
private List<CompactionRequest> requestCompactionInternal(Region r, String why, int p, List<Pair<CompactionRequest,Store>> requests, boolean selectNow, User user) throws IOException
IOException
public CompactionRequest requestCompaction(Region r, Store s, String why, int priority, CompactionRequest request, User user) throws IOException
requestCompaction
in interface CompactionRequestor
r
- Region to compacts
- Store within region to compactwhy
- Why compaction was requested -- used in debug messagespriority
- Priority of this compaction. minHeap. <=0 is criticalrequest
- custom compaction request to run. Store
and Region
for the
request must match the region and store specified here.CompactionRequest
or null if no compaction was startedIOException
public void requestSystemCompaction(Region r, String why) throws IOException
IOException
public void requestSystemCompaction(Region r, Store s, String why) throws IOException
IOException
private CompactionRequest requestCompactionInternal(Region r, Store s, String why, int priority, CompactionRequest request, boolean selectNow, User user) throws IOException
r
- region store belongs tos
- Store to request compaction onwhy
- Why compaction requested -- used in debug messagespriority
- override the default priority (NO_PRIORITY == decide)request
- custom compaction request. Can be null in which case a simple
compaction will be used.IOException
private CompactionContext selectCompaction(Region r, Store s, int priority, CompactionRequest request, 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 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()
protected int getMergeThreadNum()
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 CompactionThroughputController getCompactionThroughputController()
void shutdownLongCompactions()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.