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-18737 Display configured max size of memstore and cache on RS UI
Date Tue, 05 Sep 2017 20:01:19 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 5d60123f3 -> f362ef709


HBASE-18737 Display configured max size of memstore and cache on RS UI

Signed-off-by: tedyu <yuzhihong@gmail.com>


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

Branch: refs/heads/master
Commit: f362ef709fae35428b9ad80efb2b5fd7700fc3c5
Parents: 5d60123
Author: Biju Nair <gs.biju@gmail.com>
Authored: Thu Aug 31 17:47:12 2017 -0400
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Sep 5 13:01:11 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/io/hfile/MemcachedBlockCache.java     |  5 +++++
 .../hbase/regionserver/MetricsRegionServerWrapper.java |  1 +
 .../hbase/tmpl/regionserver/BlockCacheTmpl.jamon       | 13 +++++++++----
 .../hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon  |  6 +++---
 .../hbase/tmpl/regionserver/ServerMetricsTmpl.jamon    |  8 +++++++-
 .../org/apache/hadoop/hbase/io/hfile/BlockCache.java   |  6 ++++++
 .../hadoop/hbase/io/hfile/CombinedBlockCache.java      |  5 +++++
 .../apache/hadoop/hbase/io/hfile/LruBlockCache.java    |  2 ++
 .../hadoop/hbase/io/hfile/bucket/BucketCache.java      |  1 +
 .../regionserver/MetricsRegionServerWrapperImpl.java   |  5 +++++
 .../regionserver/MetricsRegionServerWrapperStub.java   |  5 +++++
 .../hbase/regionserver/TestHeapMemoryManager.java      |  5 +++++
 12 files changed, 54 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java
----------------------------------------------------------------------
diff --git a/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java
b/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java
index 965bcbe..3df9d08 100644
--- a/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java
+++ b/hbase-external-blockcache/src/main/java/org/apache/hadoop/hbase/io/hfile/MemcachedBlockCache.java
@@ -199,6 +199,11 @@ public class MemcachedBlockCache implements BlockCache {
   }
 
   @Override
+  public long getMaxSize() {
+    return 0;
+  }
+
+  @Override
   public long getFreeSize() {
     return 0;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java
----------------------------------------------------------------------
diff --git a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java
index 86a30d5..e835636 100644
--- a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java
+++ b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java
@@ -207,6 +207,7 @@ public interface MetricsRegionServerWrapper {
    */
   int getFlushQueueSize();
 
+  public long getMemstoreLimit();
   /**
    * Get the size (in bytes) of the block cache that is free.
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
index 3afd4f9..b4e44d8 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
@@ -326,25 +326,30 @@ are combined counts. Request count is sum of hits and misses.</p>
     </tr>
 </%if>
     <tr>
-        <td>Count</td>
+        <td>Cache Size Limit</td>
+        <td><% TraditionalBinaryPrefix.long2String(bc.getMaxSize(), "B", 1) %></td>
+        <td>Max size of cache</td>
+    </tr>
+    <tr>
+        <td>Block Count</td>
         <td><% String.format("%,d", bc.getBlockCount()) %></td>
         <td>Count of Blocks</td>
     </tr>
 <%if !bucketCache %>
     <tr>
-        <td>Count</td>
+        <td>Data Block Count</td>
         <td><% String.format("%,d", bc.getDataBlockCount()) %></td>
         <td>Count of DATA Blocks</td>
     </tr>
 </%if>
     <tr>
-        <td>Size</td>
+        <td>Size of Blocks</td>
         <td><% TraditionalBinaryPrefix.long2String(bc.getCurrentSize(), "B", 1)
%></td>
         <td>Size of Blocks</td>
     </tr>
 <%if !bucketCache %>
     <tr>
-        <td>Size</td>
+        <td>Size of Data Blocks</td>
         <td><% TraditionalBinaryPrefix.long2String(bc.getCurrentDataSize(), "B",
1) %></td>
         <td>Size of DATA Blocks</td>
     </tr>

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
index 61795e0..6b403b2 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
@@ -108,12 +108,12 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
     </section>
 
     <section>
-    <& ../common/TaskMonitorTmpl; filter = filter &>
+    <h2>Block Cache</h2>
+    <& BlockCacheTmpl; cacheConfig = regionServer.getCacheConfig(); config = regionServer.getConfiguration()
&>
     </section>
 
     <section>
-    <h2>Block Cache</h2>
-    <& BlockCacheTmpl; cacheConfig = regionServer.getCacheConfig(); config = regionServer.getConfiguration()
&>
+    <& ../common/TaskMonitorTmpl; filter = filter &>
     </section>
 
     <section>

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
index f901030..1a8b274 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
@@ -112,6 +112,7 @@ MetricsRegionServerWrapper mWrap;
         <th>Direct Memory Used</th>
         <th>Direct Memory Configured</th>
         <th>Memstore Size</th>
+        <th>Memstore Limit</th>
     </tr>
 </tr>
 <tr>
@@ -127,7 +128,12 @@ MetricsRegionServerWrapper mWrap;
     <td>
         <% TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemorySize(),
"B", 1) %>
     </td>
-    <td><% TraditionalBinaryPrefix.long2String(mWrap.getMemstoreSize(), "B", 1)
%></td>
+    <td>
+        <% TraditionalBinaryPrefix.long2String(mWrap.getMemstoreSize(), "B", 1) %>
+    </td>
+    <td>
+        <% TraditionalBinaryPrefix.long2String(mWrap.getMemstoreLimit(), "B", 1) %>
+    </td>
 </tr>
 </table>
 </%def>

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java
index 3674033..bc991ff 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java
@@ -91,6 +91,12 @@ public interface BlockCache extends Iterable<CachedBlock> {
   long size();
 
   /**
+   * Returns the Max size of the block cache, in bytes.
+   * @return size of cache, in bytes
+   */
+  long getMaxSize();
+
+  /**
    * Returns the free size of the block cache, in bytes.
    * @return free space in cache, in bytes
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java
index abccdfc..bd08a14 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java
@@ -114,6 +114,11 @@ public class CombinedBlockCache implements ResizableBlockCache, HeapSize
{
   }
 
   @Override
+  public long getMaxSize() {
+    return lruCache.getMaxSize() + l2Cache.getMaxSize();
+  }
+
+  @Override
   public long getCurrentDataSize() {
     return lruCache.getCurrentDataSize() + l2Cache.getCurrentDataSize();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
index ad81c50..04aed06 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
@@ -840,6 +840,8 @@ public class LruBlockCache implements ResizableBlockCache, HeapSize {
    *
    * @return max size in bytes
    */
+
+  @Override
   public long getMaxSize() {
     return this.maxSize;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
index 939d53a..2a8afa7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
@@ -353,6 +353,7 @@ public class BucketCache implements BlockCache, HeapSize {
     return this.cacheEnabled;
   }
 
+  @Override
   public long getMaxSize() {
     return this.cacheCapacity;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
index e28ac74..1a5015f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
@@ -282,6 +282,11 @@ class MetricsRegionServerWrapperImpl
   }
 
   @Override
+  public long getMemstoreLimit() {
+	  return this.regionServer.getRegionServerAccounting().getGlobalMemstoreLimit();
+  }
+
+  @Override
   public long getBlockCacheSize() {
     if (this.blockCache == null) {
       return 0;

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperStub.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperStub.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperStub.java
index 39188f3..e2b4ab3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperStub.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperStub.java
@@ -206,6 +206,11 @@ public class MetricsRegionServerWrapperStub implements MetricsRegionServerWrappe
   }
 
   @Override
+  public long getMemstoreLimit() {
+	  return 419;
+  }
+
+  @Override
   public long getBlockCacheFreeSize() {
     return 413;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f362ef70/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 0840ac5..95a94b4 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
@@ -738,6 +738,11 @@ public class TestHeapMemoryManager {
     }
 
     @Override
+    public long getMaxSize() {
+      return 0;
+    }
+
+    @Override
     public long getFreeSize() {
       return 0;
     }


Mime
View raw message