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 Mon, 29 Jun 2015 22:02:50 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 854d27350 -> 254ef1624


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/254ef162
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/254ef162
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/254ef162

Branch: refs/heads/branch-1
Commit: 254ef1624e50825f3b70b313f5222d23bf40d2de
Parents: 854d273
Author: tedyu <yuzhihong@gmail.com>
Authored: Mon Jun 29 15:02:34 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Mon Jun 29 15:02:34 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/254ef162/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 ba6e959..a920bcc 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
@@ -111,6 +111,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);
@@ -136,7 +137,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);
@@ -155,9 +156,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);
@@ -183,7 +184,7 @@ public class HeapMemoryManager {
           + globalMemStorePercentMinRange + " and " + BLOCK_CACHE_SIZE_MAX_RANGE_KEY + "
is "
           + blockCachePercentMaxRange);
     }
-    return true;
+    return tuningEnabled;
   }
 
   public void start(ChoreService service) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/254ef162/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 10e125e..4928eb9 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
@@ -57,8 +57,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), new RegionServerAccountingStub());
     assertFalse(manager.isTunerOn());
@@ -67,8 +68,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), new RegionServerAccountingStub());
     assertFalse(manager.isTunerOn());


Mime
View raw message