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..49a1e1b 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,11 @@ are combined counts. Request count is sum of hits and misses.
}
%java>
<%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.
+
+
%if>
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 977284b..e31c340 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
@@ -180,16 +180,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);
}
/**
@@ -231,7 +237,7 @@ public class BlockCacheUtil {
public boolean isFull() {
return this.count >= this.max;
}
-
+
public NavigableMap> getCachedBlockStatsByFile() {
return this.cachedBlockByFile;
}