hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [3/4] hbase git commit: HBASE-13008 Better default for hbase.regionserver.regionSplitLimit parameter (Srikanth Srungarapu)
Date Thu, 12 Feb 2015 19:00:32 GMT
HBASE-13008 Better default for hbase.regionserver.regionSplitLimit parameter (Srikanth Srungarapu)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bdb938ba
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bdb938ba
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bdb938ba

Branch: refs/heads/branch-1.0
Commit: bdb938ba21d9e2a0ef083f8c764b81763f344ab3
Parents: 497a604
Author: Andrew Purtell <apurtell@apache.org>
Authored: Thu Feb 12 10:13:38 2015 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Thu Feb 12 10:17:27 2015 -0800

----------------------------------------------------------------------
 hbase-common/src/main/resources/hbase-default.xml       |  9 +++++++++
 .../hadoop/hbase/regionserver/CompactSplitThread.java   | 12 ++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bdb938ba/hbase-common/src/main/resources/hbase-default.xml
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/resources/hbase-default.xml b/hbase-common/src/main/resources/hbase-default.xml
index 10f6232..c0f3f9a 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -330,6 +330,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>

http://git-wip-us.apache.org/repos/asf/hbase/blob/bdb938ba/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
index ea9f971..d070fe7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
@@ -72,6 +72,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;
@@ -93,8 +97,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));
@@ -418,6 +422,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());
   }
 


Mime
View raw message