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 1277acc..877d91b 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 @@ -305,7 +305,7 @@ are combined counts. Request count is sum of hits and misses.

} <%if cbsbf.isFull() %> -

Statistics below is based on sampling first <% cbsbfSnapshot.getMax() %> blocks only (hbase.ui.blockcache.by.file.max)

+

The stats below are incomplete! We ran into our accounting limit of <% cbsbf.getCount() %> blocks. Up the configuration hbase.ui.blockcache.by.file.max.

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheUtil.java index ff67337..89f73eb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheUtil.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheUtil.java @@ -179,16 +179,22 @@ public class BlockCacheUtil { private long size; private long dataSize; private final long now = System.nanoTime(); + /** + * How many blocks to look at before we give up. + * There could be many millions of blocks. We don't want the + * ui to freeze while we run through 1B blocks... users will + * think hbase dead. UI displays warning in red when stats + * are incomplete. + */ private final int max; - public static final int DEFAULT_MAX = 100000; - + public static final int DEFAULT_MAX = 1000000; + CachedBlocksByFile() { this(null); } CachedBlocksByFile(final Configuration c) { - this.max = c == null? DEFAULT_MAX: - c.getInt("hbase.ui.blockcache.by.file.max", DEFAULT_MAX); + this.max = c == null? DEFAULT_MAX: c.getInt("hbase.ui.blockcache.by.file.max", DEFAULT_MAX); } /** @@ -230,7 +236,7 @@ public class BlockCacheUtil { public boolean isFull() { return this.count >= this.max; } - + public NavigableMap> getCachedBlockStatsByFile() { return this.cachedBlockByFile; }