HBASE-13008 Better default for hbase.regionserver.regionSplitLimit parameter (Srikanth Srungarapu)

This commit is contained in:
Andrew Purtell 2015-02-12 10:13:38 -08:00
parent 02759f2d8c
commit fc2e849cd3
2 changed files with 19 additions and 2 deletions

View File

@ -333,6 +333,15 @@ possible configurations would overwhelm and obscure the important.
DelimitedKeyPrefixRegionSplitPolicy, KeyPrefixRegionSplitPolicy etc.
</description>
</property>
<property>
<name>hbase.regionserver.regionSplitLimit</name>
<value>1000</value>
<description>
Limit for the number of regions after which no more region splitting should take place.
This is not hard limit for the number of regions but acts as a guideline for the regionserver
to stop splitting after a certain limit. Default is set to 1000.
</description>
</property>
<!--ZooKeeper configuration-->
<property>

View File

@ -75,6 +75,10 @@ public class CompactSplitThread implements CompactionRequestor, PropagatingConfi
// Configuration keys for merge threads
public final static String MERGE_THREADS = "hbase.regionserver.thread.merge";
public final static int MERGE_THREADS_DEFAULT = 1;
public static final String REGION_SERVER_REGION_SPLIT_LIMIT =
"hbase.regionserver.regionSplitLimit";
public static final int DEFAULT_REGION_SERVER_REGION_SPLIT_LIMIT= 1000;
private final HRegionServer server;
private final Configuration conf;
@ -98,8 +102,8 @@ public class CompactSplitThread implements CompactionRequestor, PropagatingConfi
super();
this.server = server;
this.conf = server.getConfiguration();
this.regionSplitLimit = conf.getInt("hbase.regionserver.regionSplitLimit",
Integer.MAX_VALUE);
this.regionSplitLimit = conf.getInt(REGION_SERVER_REGION_SPLIT_LIMIT,
DEFAULT_REGION_SERVER_REGION_SPLIT_LIMIT);
int largeThreads = Math.max(1, conf.getInt(
LARGE_COMPACTION_THREADS, LARGE_COMPACTION_THREADS_DEFAULT));
@ -427,6 +431,10 @@ public class CompactSplitThread implements CompactionRequestor, PropagatingConfi
}
private boolean shouldSplitRegion() {
if(server.getNumberOfOnlineRegions() > 0.9*regionSplitLimit) {
LOG.warn("Total number of regions is approaching the upper limit " + regionSplitLimit + ". "
+ "Please consider taking a look at http://hbase.apache.org/book.html#ops.regionmgt");
}
return (regionSplitLimit > server.getNumberOfOnlineRegions());
}