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 cache on RS UI
Date Wed, 06 Sep 2017 18:06:36 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 13da97d85 -> 5de4a7d89


HBASE-18737 Display configured max size of 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/5de4a7d8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5de4a7d8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5de4a7d8

Branch: refs/heads/branch-1
Commit: 5de4a7d898f6a6f9be0e7759504ca165b4a726e0
Parents: 13da97d
Author: Biju Nair <gs.biju@gmail.com>
Authored: Wed Sep 6 12:16:05 2017 -0400
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Sep 6 11:06:27 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/io/hfile/MemcachedBlockCache.java     |  5 +++++
 .../hbase/tmpl/regionserver/BlockCacheTmpl.jamon       | 13 +++++++++----
 .../hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon  |  6 +++---
 .../hbase/tmpl/regionserver/ServerMetricsTmpl.jamon    |  4 +++-
 .../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 +
 .../hbase/regionserver/TestHeapMemoryManager.java      |  5 +++++
 9 files changed, 39 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5de4a7d8/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 f50a117..4357262 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
@@ -195,6 +195,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/5de4a7d8/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 3d2606b..e7fd378 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/5de4a7d8/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 b98f50d..a8d4003 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
@@ -109,12 +109,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/5de4a7d8/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 e345de5..a270fc7 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
@@ -127,7 +127,9 @@ 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>
 </tr>
 </table>
 </%def>

http://git-wip-us.apache.org/repos/asf/hbase/blob/5de4a7d8/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 35cec26..2c2b039 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
@@ -90,6 +90,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/5de4a7d8/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 391dcae..ec8e5a0 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
@@ -112,6 +112,11 @@ public class CombinedBlockCache implements ResizableBlockCache, HeapSize
{
   }
 
   @Override
+  public long getMaxSize() {
+    return lruCache.getMaxSize() + l2Cache.getMaxSize();
+  }
+
+  @Override
   public long getFreeSize() {
     return lruCache.getFreeSize() + l2Cache.getFreeSize();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/5de4a7d8/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 5375e42..3fbe44b 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
@@ -830,6 +830,8 @@ public class LruBlockCache implements ResizableBlockCache, HeapSize {
    * Get the maximum size of this cache.
    * @return max size in bytes
    */
+
+  @Override
   public long getMaxSize() {
     return this.maxSize;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/5de4a7d8/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 0aef1e8..6d50bef 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
@@ -348,6 +348,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/5de4a7d8/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 24a995e..00ec9c8 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
@@ -586,6 +586,11 @@ public class TestHeapMemoryManager {
     }
 
     @Override
+    public long getMaxSize() {
+      return 0;
+    }
+
+    @Override
     public long getFreeSize() {
       return 0;
     }


Mime
View raw message