hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13989 Threshold for combined MemStore and BlockCache percentages is not checked
Date Tue, 30 Jun 2015 00:23:39 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.0 219d95b13 -> 818648db6


HBASE-13989 Threshold for combined MemStore and BlockCache percentages is not checked


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

Branch: refs/heads/branch-1.0
Commit: 818648db617f34b82fd99dfc2ca5ebb25b802af8
Parents: 219d95b
Author: tedyu <yuzhihong@gmail.com>
Authored: Mon Jun 29 17:23:35 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Mon Jun 29 17:23:35 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/HeapMemoryManager.java | 9 +++++----
 .../hadoop/hbase/regionserver/TestHeapMemoryManager.java    | 6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/818648db/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
index d7589d6..1f998c9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
@@ -108,6 +108,7 @@ public class HeapMemoryManager {
   }
 
   private boolean doInit(Configuration conf) {
+    boolean tuningEnabled = true;
     globalMemStorePercent = HeapMemorySizeUtil.getGlobalMemStorePercent(conf, false);
     blockCachePercent = conf.getFloat(HFILE_BLOCK_CACHE_SIZE_KEY,
         HConstants.HFILE_BLOCK_CACHE_SIZE_DEFAULT);
@@ -133,7 +134,7 @@ public class HeapMemoryManager {
     }
     if (globalMemStorePercent == globalMemStorePercentMinRange
         && globalMemStorePercent == globalMemStorePercentMaxRange) {
-      return false;
+      tuningEnabled = false;
     }
     // Initialize max and min range for block cache
     blockCachePercentMinRange = conf.getFloat(BLOCK_CACHE_SIZE_MIN_RANGE_KEY, blockCachePercent);
@@ -152,9 +153,9 @@ public class HeapMemoryManager {
       blockCachePercentMaxRange = blockCachePercent;
       conf.setFloat(BLOCK_CACHE_SIZE_MAX_RANGE_KEY, blockCachePercentMaxRange);
     }
-    if (blockCachePercent == blockCachePercentMinRange
+    if (tuningEnabled && blockCachePercent == blockCachePercentMinRange
         && blockCachePercent == blockCachePercentMaxRange) {
-      return false;
+      tuningEnabled = false;
     }
 
     int gml = (int) (globalMemStorePercentMaxRange * CONVERT_TO_PERCENTAGE);
@@ -180,7 +181,7 @@ public class HeapMemoryManager {
           + globalMemStorePercentMinRange + " and " + BLOCK_CACHE_SIZE_MAX_RANGE_KEY + "
is "
           + blockCachePercentMaxRange);
     }
-    return true;
+    return tuningEnabled;
   }
 
   public void start() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/818648db/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
index 2d63775..a8c43dc 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
@@ -56,8 +56,9 @@ public class TestHeapMemoryManager {
   @Test
   public void testAutoTunerShouldBeOffWhenMaxMinRangesForMemstoreIsNotGiven() throws Exception
{
     Configuration conf = HBaseConfiguration.create();
+    conf.setFloat(HeapMemorySizeUtil.MEMSTORE_SIZE_KEY, 0.02f);
     conf.setFloat(HeapMemoryManager.BLOCK_CACHE_SIZE_MAX_RANGE_KEY, 0.75f);
-    conf.setFloat(HeapMemoryManager.BLOCK_CACHE_SIZE_MIN_RANGE_KEY, 0.05f);
+    conf.setFloat(HeapMemoryManager.BLOCK_CACHE_SIZE_MIN_RANGE_KEY, 0.03f);
     HeapMemoryManager manager = new HeapMemoryManager(new BlockCacheStub(0),
         new MemstoreFlusherStub(0), new RegionServerStub(conf));
     assertFalse(manager.isTunerOn());
@@ -66,8 +67,9 @@ public class TestHeapMemoryManager {
   @Test
   public void testAutoTunerShouldBeOffWhenMaxMinRangesForBlockCacheIsNotGiven() throws Exception
{
     Configuration conf = HBaseConfiguration.create();
+    conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0.02f);
     conf.setFloat(HeapMemoryManager.MEMSTORE_SIZE_MAX_RANGE_KEY, 0.75f);
-    conf.setFloat(HeapMemoryManager.MEMSTORE_SIZE_MIN_RANGE_KEY, 0.05f);
+    conf.setFloat(HeapMemoryManager.MEMSTORE_SIZE_MIN_RANGE_KEY, 0.03f);
     HeapMemoryManager manager = new HeapMemoryManager(new BlockCacheStub(0),
         new MemstoreFlusherStub(0), new RegionServerStub(conf));
     assertFalse(manager.isTunerOn());


Mime
View raw message