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:36:37 UTC

svn commit: r1085195 - in /hbase/trunk: 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:36:36 2011
New Revision: 1085195

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

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

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1085195&r1=1085194&r2=1085195&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Mar 24 23:36:36 2011
@@ -186,7 +186,6 @@ Release 0.90.2 - Unreleased
    HBASE-3497  TableMapReduceUtil.initTableReducerJob broken due to setConf 
                method in TableOutputFormat
 
-
   IMPROVEMENTS
    HBASE-3542  MultiGet methods in Thrift
    HBASE-3586  Improve the selection of regions to balance (Ted Yu via Andrew
@@ -206,6 +205,7 @@ Release 0.90.2 - Unreleased
    HBASE-3596  [replication] Wait a few seconds before transferring queues
    HBASE-3600  Update our jruby to 1.6.0
    HBASE-3640  [replication] Transferring queues shouldn't be done inline with RS startup
+   HBASE-3658  Alert when heap is over committed (Subbu M Iyer via Stack)
 
 Release 0.90.1 - February 9th, 2011
 

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java?rev=1085195&r1=1085194&r2=1085195&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java Thu Mar 24 23:36:36 2011
@@ -70,11 +70,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/trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1085195&r1=1085194&r2=1085195&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/HConstants.java Thu Mar 24 23:36:36 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.
   }