You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/03/25 00:37:26 UTC

svn commit: r1085196 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java src/main/java/org/apache/hadoop/hbase/HConstants.java

Author: stack
Date: Thu Mar 24 23:37:26 2011
New Revision: 1085196

URL: http://svn.apache.org/viewvc?rev=1085196&view=rev
Log:
HBASE-3658 Alert when heap is over committed

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HConstants.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1085196&r1=1085195&r2=1085196&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Thu Mar 24 23:37:26 2011
@@ -65,7 +65,7 @@ Release 0.90.2 - Unreleased
    HBASE-3542  MultiGet methods in Thrift
    HBASE-3586  Improve the selection of regions to balance (Ted Yu via Andrew
                Purtell)  
-   HBASE-3603  Remove -XX:+HeapDumpOnOutOfMemoryError autodump of heap option
+   HBASE-3602  Remove -XX:+HeapDumpOnOutOfMemoryError autodump of heap option
                on OOME
    HBASE-3285  Hlog recovery takes too much time
    HBASE-3623  Allow non-XML representable separator characters in the
@@ -82,6 +82,7 @@ Release 0.90.2 - Unreleased
    HBASE-3653  Parallelize Server Requests on HBase Client
    HBASE-3640  [replication] Transferring queues shouldn't be done inline with RS startup
    HBASE-3683  NMapInputFormat should use a different config param for number of maps
+   HBASE-3658  Alert when heap is over committed (Subbu M Iyer via Stack)
 
 
 Release 0.90.1 - February 9th, 2011

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java?rev=1085196&r1=1085195&r2=1085196&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java Thu Mar 24 23:37:26 2011
@@ -69,11 +69,25 @@ public class HBaseConfiguration extends 
     }
   }
 
+  private static void checkForClusterFreeMemoryLimit(Configuration conf) {
+      float globalMemstoreLimit = conf.getFloat("hbase.regionserver.global.memstore.upperLimit", 0.4f);
+      float blockCacheUpperLimit = conf.getFloat("hfile.block.cache.size", 0.2f);
+      if (1.0f - (globalMemstoreLimit + blockCacheUpperLimit)
+              < HConstants.HBASE_CLUSTER_MINIMUM_MEMORY_THRESHOLD) {
+          throw new RuntimeException(
+        "Current heap configuration for MemStore and BlockCache exceeds the threshold required for " +
+                "successful cluster operation. The combined value cannot exceed 0.8. Please check " +
+                "the settings for hbase.regionserver.global.memstore.upperLimit and" +
+                " hfile.block.cache.size in your configuration.");
+      }
+  }
+
   public static Configuration addHbaseResources(Configuration conf) {
     conf.addResource("hbase-default.xml");
     conf.addResource("hbase-site.xml");
 
     checkDefaultsVersion(conf);
+    checkForClusterFreeMemoryLimit(conf);
     return conf;
   }
 

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1085196&r1=1085195&r2=1085196&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/HConstants.java Thu Mar 24 23:37:26 2011
@@ -364,6 +364,11 @@ public final class HConstants {
   public static final String HBASE_MASTER_LOGCLEANER_PLUGINS =
       "hbase.master.logcleaner.plugins";
 
+   /*
+    * Minimum percentage of free heap necessary for a successful cluster startup.
+    */
+  public static final float HBASE_CLUSTER_MINIMUM_MEMORY_THRESHOLD = 0.2f;
+
   private HConstants() {
     // Can't be instantiated with this ctor.
   }