Repository: hbase Updated Branches: refs/heads/master aa916b81c -> 3d3784dd2
HBASE-11329 Minor fixup of new blockcache tab number formatting Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3d3784dd Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3d3784dd Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3d3784dd Branch: refs/heads/master Commit: 3d3784dd224c9ee17c3e5fc64db8192da497928f Parents: aa916b8 Author: Michael Stack <[email protected]> Authored: Wed Jun 11 12:25:18 2014 -0700 Committer: Michael Stack <[email protected]> Committed: Wed Jun 11 12:25:18 2014 -0700 ---------------------------------------------------------------------- .../tmpl/regionserver/BlockCacheTmpl.jamon | 25 +++++++++++++------- .../hbase/io/hfile/bucket/BucketCache.java | 4 ++++ .../io/hfile/bucket/ByteBufferIOEngine.java | 10 ++++++++ .../hbase/io/hfile/bucket/FileIOEngine.java | 10 ++++++++ 4 files changed, 40 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/3d3784dd/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 5422ddd..5e94279 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 @@ -195,37 +195,37 @@ org.apache.hadoop.util.StringUtils; </tr> <tr> <td>Count</td> - <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getBlockCount()) %></td> + <td><% String.format("%,d", cacheConfig.getBlockCache().getBlockCount()) %></td> <td>Number of blocks in Block Cache</td> </tr> <tr> <td>Evicted</td> - <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getStats().getEvictedCount()) %></td> + <td><% String.format("%,d", cacheConfig.getBlockCache().getStats().getEvictedCount()) %></td> <td>Number of blocks evicted</td> </tr> <tr> <td>Evictions</td> - <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getStats().getEvictionCount()) %></td> + <td><% String.format("%,d", cacheConfig.getBlockCache().getStats().getEvictionCount()) %></td> <td>Number of times an eviction occurred</td> </tr> <tr> <td>Hits</td> - <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getStats().getHitCount()) %></td> + <td><% String.format("%,d", cacheConfig.getBlockCache().getStats().getHitCount()) %></td> <td>Number requests that were cache hits</td> </tr> <tr> <td>Hits Caching</td> - <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getStats().getHitCachingCount()) %></td> + <td><% String.format("%,d", cacheConfig.getBlockCache().getStats().getHitCachingCount()) %></td> <td>Cache hit block requests but only requests set to use Block Cache</td> </tr> <tr> <td>Misses</td> - <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getStats().getMissCount()) %></td> + <td><% String.format("%,d", cacheConfig.getBlockCache().getStats().getMissCount()) %></td> <td>Number of requests that were cache misses</td> </tr> <tr> <td>Misses Caching</td> - <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getStats().getMissCount()) %></td> + <td><% String.format("%,d", cacheConfig.getBlockCache().getStats().getMissCount()) %></td> <td>Block requests that were cache misses but only requests set to use Block Cache</td> </tr> <tr> @@ -294,15 +294,22 @@ are combined counts. Request count is sum of hits and misses.</p> <td><a href="<% bcUrl %>"><% bc.getClass().getSimpleName() %></a></td> <td>Class implementing this Block Cache Level</td> </tr> +<%if bucketCache %> + <tr> + <td>Implementation</td> + <td><% ((BucketCache)bc).getIoEngine() %></a></td> + <td>IOEngine</td> + </tr> +</%if> <tr> <td>Count</td> - <td><% StringUtils.humanReadableInt(cbsbf.getCount()) %></td> + <td><% String.format("%,d", cbsbf.getCount()) %></td> <td>Count of Blocks</td> </tr> <%if !bucketCache %> <tr> <td>Count</td> - <td><% StringUtils.humanReadableInt(cbsbf.getDataCount()) %></td> + <td><% String.format("%,d", cbsbf.getDataCount()) %></td> <td>Count of DATA Blocks</td> </tr> </%if> http://git-wip-us.apache.org/repos/asf/hbase/blob/3d3784dd/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 c01c38f..39cbe0b 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 @@ -259,6 +259,10 @@ public class BucketCache implements BlockCache, HeapSize { persistencePath + ", bucketAllocator=" + this.bucketAllocator); } + public String getIoEngine() { + return ioEngine.toString(); + } + /** * Get the IOEngine from the IO engine name * @param ioEngineName http://git-wip-us.apache.org/repos/asf/hbase/blob/3d3784dd/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/ByteBufferIOEngine.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/ByteBufferIOEngine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/ByteBufferIOEngine.java index 2c3e946..efb72fa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/ByteBufferIOEngine.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/ByteBufferIOEngine.java @@ -31,6 +31,8 @@ import org.apache.hadoop.hbase.util.ByteBufferArray; @InterfaceAudience.Private public class ByteBufferIOEngine implements IOEngine { private ByteBufferArray bufferArray; + private final long capacity; + private final boolean direct; /** * Construct the ByteBufferIOEngine with the given capacity @@ -40,9 +42,17 @@ public class ByteBufferIOEngine implements IOEngine { */ public ByteBufferIOEngine(long capacity, boolean direct) throws IOException { + this.capacity = capacity; + this.direct = direct; bufferArray = new ByteBufferArray(capacity, direct); } + @Override + public String toString() { + return "ioengine=" + this.getClass().getSimpleName() + ", capacity=" + + String.format("%,d", this.capacity) + ", direct=" + this.direct; + } + /** * Memory IO engine is always unable to support persistent storage for the * cache http://git-wip-us.apache.org/repos/asf/hbase/blob/3d3784dd/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java index 3b690c2..26aae24 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java @@ -36,8 +36,12 @@ public class FileIOEngine implements IOEngine { private static final Log LOG = LogFactory.getLog(FileIOEngine.class); private final RandomAccessFile raf; private final FileChannel fileChannel; + private final String path; + private long size; public FileIOEngine(String filePath, long fileSize) throws IOException { + this.path = filePath; + this.size = fileSize; try { raf = new RandomAccessFile(filePath, "rw"); } catch (java.io.FileNotFoundException fex) { @@ -58,6 +62,12 @@ public class FileIOEngine implements IOEngine { LOG.info("Allocating " + StringUtils.byteDesc(fileSize) + ", on the path:" + filePath); } + @Override + public String toString() { + return "ioengine=" + this.getClass().getSimpleName() + ", path=" + this.path + + ", size=" + String.format("%,d", this.size); + } + /** * File IO engine is always able to support persistent storage for the cache * @return true
