@@ -30,6 +30,7 @@ BlockCache bc;
3030</%java>
3131<%import>
3232java.util.Map;
33+ org.apache.hadoop.hbase.io.hfile.BlockCacheUtil;
3334org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
3435org.apache.hadoop.hbase.io.hfile.AgeSnapshot;
3536org.apache.hadoop.hbase.io.hfile.CachedBlock;
@@ -281,9 +282,7 @@ are combined counts. Request count is sum of hits and misses.</p>
281282<%java>
282283 String bcUrl = "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html";
283284 String bcName = bc.getClass().getSimpleName();
284- org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile cbsbf =
285- org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.getLoadedCachedBlocksByFile(config, bc);
286- AgeSnapshot cbsbfSnapshot = cbsbf.getAgeInCacheSnapshot();
285+ int maxCachedBlocksByFile = BlockCacheUtil.getMaxCachedBlocksByFile(config);
287286
288287 boolean bucketCache = bc.getClass().getSimpleName().equals("BucketCache");
289288 BucketCacheStats bucketCacheStats = null;
@@ -294,13 +293,6 @@ are combined counts. Request count is sum of hits and misses.</p>
294293 bucketAllocator = ((BucketCache)bc).getAllocator();
295294 }
296295</%java>
297- <%if cbsbf.isFull() %>
298- <p>
299- <div class="alert alert-danger">
300- <strong>The stats below are incomplete!</strong> We ran into our accounting limit of <% cbsbf.getCount() %> blocks. Up the configuration <i>hbase.ui.blockcache.by.file.max</i>.
301- </div>
302- </p>
303- </%if>
304296<table id="blocks_summary" class="table table-striped">
305297 <tr>
306298 <th>Attribute</th>
@@ -365,9 +357,13 @@ are combined counts. Request count is sum of hits and misses.</p>
365357</%if>
366358</table>
367359<%doc>Call through to block cache Detail rendering template</%doc>
368- <p>View block cache <a href="?format=json&bcn=<% name %>">as JSON</a> | Block cache <a href="?format=json&bcn=<% name %>&bcv=file">as JSON by file</a></p>
369- <%java>
370- cbsbf = null;
371- </%java>
360+ <p>
361+ View block cache <a href="?format=json&bcn=<% name %>">as JSON</a> | Block cache <a href="?format=json&bcn=<% name %>&bcv=file">as JSON by file</a>
362+ <%if bc.getBlockCount() > maxCachedBlocksByFile %>
363+ <br>
364+ <b>Note</b>: JSON view of block cache will be incomplete, because block count <% bc.getBlockCount() %> is greater than <i>hbase.ui.blockcache.by.file.max</i> value of <% maxCachedBlocksByFile %>.
365+ Increase that value to get a complete picture.
366+ </%if>
367+ </p>
372368</%def>
373369
0 commit comments