rdEntry : regDistribution.entrySet()) {
ServerName addr = rdEntry.getKey();
String url = "//" + URLEncoder.encode(addr.getHostname(), StandardCharsets.UTF_8) + ":"
- + master.getRegionServerInfoPort(addr) + "/rs-status";
+ + master.getRegionServerInfoPort(addr) + "/regionserver.jsp";
%>
<%= StringEscapeUtils.escapeHtml4(addr.getHostname())
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCache.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCache.jsp
new file mode 100644
index 000000000000..7bba000a271a
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCache.jsp
@@ -0,0 +1,72 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCache"
+ import="org.apache.hadoop.hbase.regionserver.HRegionServer" %>
+<%@ page import="org.apache.hadoop.hbase.io.hfile.CacheConfig" %>
+
+<%-- Template for rendering Block Cache tabs in RegionServer Status page. --%>
+
+<%
+ HRegionServer regionServer =
+ (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
+
+ CacheConfig cacheConfig = new CacheConfig(regionServer.getConfiguration());
+
+ BlockCache bc = regionServer.getBlockCache().orElse(null);
+
+ BlockCache[] bcs = bc == null ? null : bc.getBlockCaches();
+ BlockCache l1 = bcs == null ? bc : bcs[0];
+ BlockCache l2 = bcs == null ? null : bcs.length <= 1 ? null : bcs[1];
+%>
+
+
+
+
+
+ <% request.setAttribute("bc", bc); %>
+
+
+
+ <% request.setAttribute("cacheConfig", cacheConfig); %>
+
+
+
+ <% request.setAttribute("bc", bc); %>
+
+
+
+ <% request.setAttribute("bc", l1); %>
+ <% request.setAttribute("name", "L1"); %>
+
+
+
+ <% request.setAttribute("bc", l2); %>
+ <% request.setAttribute("name", "L2"); %>
+
+
+
+
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheBaseInfo.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheBaseInfo.jsp
new file mode 100644
index 000000000000..d7d322d4754d
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheBaseInfo.jsp
@@ -0,0 +1,42 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCache" %>
+
+<%
+ BlockCache bc = (BlockCache) request.getAttribute("bc");
+
+ String bcUrl = bc == null ? null : "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html";
+ String bcName = bc == null ? null : bc.getClass().getSimpleName();
+%>
+
+
+
+ | Attribute |
+ Value |
+ Description |
+
+
+ | Implementation |
+ <%= bcName %> |
+ Block cache implementing class |
+
+
+See block cache in the HBase Reference Guide for help.
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheConfig.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheConfig.jsp
new file mode 100644
index 000000000000..d73652de4cb2
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheConfig.jsp
@@ -0,0 +1,72 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="org.apache.hadoop.hbase.io.hfile.CacheConfig" %>
+
+<%
+ CacheConfig cacheConfig = (CacheConfig) request.getAttribute("cacheConfig");
+if (cacheConfig == null) { %>
+ CacheConfig is null
+<% } else { %>
+
+
+ | Attribute |
+ Value |
+ Description |
+
+
+ | Cache DATA on Read |
+ <%= cacheConfig.shouldCacheDataOnRead() %> |
+ True if DATA blocks are cached on read
+ (INDEX & BLOOM blocks are always cached) |
+
+
+ | Cache DATA on Write |
+ <%= cacheConfig.shouldCacheDataOnWrite() %> |
+ True if DATA blocks are cached on write. |
+
+
+ | Cache INDEX on Write |
+ <%= cacheConfig.shouldCacheIndexesOnWrite() %> |
+ True if INDEX blocks are cached on write |
+
+
+ | Cache BLOOM on Write |
+ <%= cacheConfig.shouldCacheBloomsOnWrite() %> |
+ True if BLOOM blocks are cached on write |
+
+
+ | Evict blocks on Close |
+ <%= cacheConfig.shouldEvictOnClose() %> |
+ True if blocks are evicted from cache when an HFile
+ reader is closed |
+
+
+ | Cache DATA in compressed format |
+ <%= cacheConfig.shouldCacheDataCompressed() %> |
+ True if DATA blocks are cached in their compressed form |
+
+
+ | Prefetch on Open |
+ <%= cacheConfig.shouldPrefetchOnOpen() %> |
+ True if blocks are prefetched into cache on open |
+
+
+<% } %>
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheEvictions.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheEvictions.jsp
new file mode 100644
index 000000000000..58870ca0072f
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheEvictions.jsp
@@ -0,0 +1,45 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCache"
+ import="org.apache.hadoop.hbase.io.hfile.AgeSnapshot" %>
+
+<%
+ BlockCache bc = (BlockCache) request.getAttribute("bc");
+
+ AgeSnapshot ageAtEvictionSnapshot = bc.getStats().getAgeAtEvictionSnapshot();
+ // Only show if non-zero mean and stddev as is the case in combinedblockcache
+%>
+
+ |
+ | Evicted |
+ <%= String.format("%,d", bc.getStats().getEvictedCount()) %> |
+ The total number of blocks evicted |
+
+
+ | Evictions |
+ <%= String.format("%,d", bc.getStats().getEvictionCount()) %> |
+ The total number of times an eviction has occurred |
+
+
+ | Mean |
+ <%= String.format("%,d", (long)ageAtEvictionSnapshot.getMean()) %> |
+ Mean age of Blocks at eviction time (seconds) |
+
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheHits.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheHits.jsp
new file mode 100644
index 000000000000..df9da58592c2
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheHits.jsp
@@ -0,0 +1,92 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCache" %>
+
+<%
+ BlockCache bc = (BlockCache) request.getAttribute("bc");
+
+ int hitPeriods = 0;
+ for (int i = 0; i < bc.getStats().getNumPeriodsInWindow(); i++) {
+ if (bc.getStats().getWindowPeriods()[i] != null) {
+ hitPeriods++;
+ }
+ }
+%>
+
+<% if (hitPeriods > 0) { %>
+
+<% } %>
+
+ | Hits |
+ <%= String.format("%,d", bc.getStats().getHitCount()) %> |
+ Number requests that were cache hits |
+
+
+ | Hits Caching |
+ <%= String.format("%,d", bc.getStats().getHitCachingCount()) %> |
+ Cache hit block requests but only requests set to cache block if a miss |
+
+
+ | Misses |
+ <%= String.format("%,d", bc.getStats().getMissCount()) %> |
+ Block requests that were cache misses but set to cache missed blocks |
+
+
+ | Misses Caching |
+ <%= String.format("%,d", bc.getStats().getMissCachingCount()) %> |
+ Block requests that were cache misses but only requests set to use block cache |
+
+
+ | All Time Hit Ratio |
+ <%= String.format("%,.2f", bc.getStats().getHitRatio() * 100) %><%= "%" %> |
+ Hit Count divided by total requests count |
+
+<% for (int i = 0; i < hitPeriods; i++) { %>
+<%-- These rows are hidden on page load, blockCacheInit.js will display these as paginated. --%>
+
+ | Hit Ratio for period starting at <%= bc.getStats().getWindowPeriods()[i] %> |
+ <% if (bc.getStats().getRequestCounts()[i] > 0) { %>
+ <%= String.format("%,.2f", ((double)bc.getStats().getHitCounts()[i] / (double)bc.getStats().getRequestCounts()[i]) * 100.0) %><%= "%" %> |
+ <% } else { %>
+ No requests |
+ <% } %>
+ Hit Count divided by total requests count over the <%= i %>th period of <%= bc.getStats().getPeriodTimeInMinutes() %> minutes |
+
+<% } %>
+<% if (hitPeriods > 0) { %>
+
+<% } %>
+<% if (bc.getStats().getPeriodTimeInMinutes() > 0) { %>
+
+ | Last <%= bc.getStats().getNumPeriodsInWindow()*bc.getStats().getPeriodTimeInMinutes() %> minutes Hit Ratio |
+ <%= String.format("%,.2f", bc.getStats().getHitRatioPastNPeriods() * 100.0) %><%= "%" %> |
+ Hit Count divided by total requests count for the last <%= bc.getStats().getNumPeriodsInWindow()*bc.getStats().getPeriodTimeInMinutes() %> minutes |
+
+<% } %>
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheLevel.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheLevel.jsp
new file mode 100644
index 000000000000..47cc6a5a9856
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheLevel.jsp
@@ -0,0 +1,159 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="org.apache.hadoop.conf.Configuration"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCache"
+ import="org.apache.hadoop.hbase.regionserver.HRegionServer"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCacheUtil"
+ import="org.apache.hadoop.hbase.io.hfile.LruBlockCache"
+ import="org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats"
+ import="org.apache.hadoop.hbase.io.hfile.bucket.BucketCache"
+ import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix" %>
+
+<%
+ HRegionServer regionServer =
+ (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
+
+ Configuration configuration = regionServer.getConfiguration();
+
+ BlockCache bc = (BlockCache) request.getAttribute("bc");
+
+ String name = (String) request.getAttribute("name");
+%>
+
+<% if (bc == null) { %>
+ No <%= name %> deployed
+<% } else { %>
+
+<%
+ String bcUrl = "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html";
+ String bcName = bc.getClass().getSimpleName();
+ int maxCachedBlocksByFile = BlockCacheUtil.getMaxCachedBlocksByFile(configuration);
+
+ boolean isLru = bc instanceof LruBlockCache;
+
+ boolean isBucketCache = bc.getClass().getSimpleName().equals("BucketCache");
+ BucketCacheStats bucketCacheStats = null;
+ BucketCache bucketCache = null;
+ if (bc instanceof BucketCache) {
+ bucketCache = (BucketCache) bc;
+ bucketCacheStats = (BucketCacheStats) bc.getStats();
+ }
+%>
+
+
+
+ | Attribute |
+ Value |
+ Description |
+
+
+ | Implementation |
+ <%= bcName %> |
+ Class implementing this block cache Level |
+
+<% if (isBucketCache) { %>
+
+ | IOEngine |
+ <%= bucketCache.getIoEngine() %> |
+ Supported IOEngine types: offheap, file, files, mmap or pmem. See hbase.bucketcache.ioengine. |
+
+<% } %>
+
+ | Cache Size Limit |
+ <%= TraditionalBinaryPrefix.long2String(bc.getMaxSize(), "B", 1) %> |
+ Max size of cache |
+
+
+ | Block Count |
+ <%= String.format("%,d", bc.getBlockCount()) %> |
+ Count of Blocks |
+
+<% if (!isBucketCache) { %>
+
+ | Data Block Count |
+ <%= String.format("%,d", bc.getDataBlockCount()) %> |
+ Count of DATA Blocks |
+
+<% } %>
+<% if (isLru) { %>
+
+ | Index Block Count |
+ <%= String.format("%,d", ((LruBlockCache)bc).getIndexBlockCount()) %> |
+ Count of INDEX Blocks |
+
+
+ | Bloom Block Count |
+ <%= String.format("%,d", ((LruBlockCache)bc).getBloomBlockCount()) %> |
+ Count of BLOOM Blocks |
+
+<% } %>
+
+ | Size of Blocks |
+ <%= TraditionalBinaryPrefix.long2String(bc.getCurrentSize(), "B", 1) %> |
+ Size of Blocks |
+
+<% if (!isBucketCache) { %>
+
+ | Size of Data Blocks |
+ <%= TraditionalBinaryPrefix.long2String(bc.getCurrentDataSize(), "B", 1) %> |
+ Size of DATA Blocks |
+
+<% } %>
+<% if (isLru) { %>
+
+ | Size of Index Blocks |
+ <%= TraditionalBinaryPrefix.long2String(((LruBlockCache)bc).getCurrentIndexSize(), "B", 1) %> |
+ Size of INDEX Blocks |
+
+
+ | Size of Bloom Blocks |
+ <%= TraditionalBinaryPrefix.long2String(((LruBlockCache)bc).getCurrentBloomSize(), "B", 1) %> |
+ Size of BLOOM Blocks |
+
+<% } %>
+ <% request.setAttribute("bc", bc); %>
+
+
+
+<% if (isBucketCache) { %>
+
+ | Hits per Second |
+ <%= bucketCacheStats.getIOHitsPerSecond() %> |
+ Block gets against this cache per second |
+
+
+ | Time per Hit |
+ <%= bucketCacheStats.getIOTimePerHit() %> |
+ Time per cache hit |
+
+<% } %>
+
+
+<%-- Call through to block cache Detail rendering template --%>
+
+ View block cache as JSON | Block cache as JSON by file
+ <% if (bc.getBlockCount() > maxCachedBlocksByFile) { %>
+
+ Note: JSON view of block cache will be incomplete, because block count <%= bc.getBlockCount() %> is greater than hbase.ui.blockcache.by.file.max value of <%= maxCachedBlocksByFile %>.
+ Increase that value to get a complete picture.
+ <% } %>
+
+<% } %>
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheStats.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheStats.jsp
new file mode 100644
index 000000000000..c30160b7621b
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheStats.jsp
@@ -0,0 +1,58 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCache"
+ import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix" %>
+
+<%
+ BlockCache bc = (BlockCache) request.getAttribute("bc");
+if (bc == null) { %>
+ BlockCache is null
+<% } else { %>
+
+
+ | Attribute |
+ Value |
+ Description |
+
+
+ | Size |
+ <%= TraditionalBinaryPrefix.long2String(bc.getCurrentSize(),
+ "B", 1) %> |
+ Current size of block cache in use |
+
+
+ | Free |
+ <%= TraditionalBinaryPrefix.long2String(bc.getFreeSize(),
+ "B", 1) %> |
+ The total free memory currently available to store more cache entries |
+
+
+ | Count |
+ <%= String.format("%,d", bc.getBlockCount()) %> |
+ Number of blocks in block cache |
+
+ <% request.setAttribute("bc", bc); %>
+
+
+
+If block cache is made up of more than one cache -- i.e. a L1 and a L2 -- then the above
+ are combined counts. Request count is sum of hits and misses.
+<% } %>
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheView.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheView.jsp
new file mode 100644
index 000000000000..be6061bc652a
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheView.jsp
@@ -0,0 +1,62 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="java.util.*"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCache"
+ import="org.apache.hadoop.conf.Configuration"
+ import="org.apache.hadoop.hbase.io.hfile.BlockCacheUtil"
+ import="org.apache.hadoop.hbase.io.hfile.CachedBlock"
+ import="org.apache.hadoop.hbase.regionserver.http.RSStatusConstants" %><%
+ // This template is used to give views on an individual block cache as JSON.
+
+ Configuration conf = (Configuration) request.getAttribute("conf");
+ String bcn = (String) request.getAttribute(RSStatusConstants.BLOCK_CACHE_NAME);
+ String bcv = (String) request.getAttribute(RSStatusConstants.BLOCK_CACHE_V);
+ BlockCache bc = (BlockCache) request.getAttribute("blockCache");
+
+ BlockCache [] bcs = bc == null ? null : bc.getBlockCaches();
+ if (bcn.equals(RSStatusConstants.BLOCK_CACHE_NAME_L1)) {
+ bc = bcs == null || bcs.length == 0? bc: bcs[0];
+ } else {
+ if (bcs == null || bcs.length < 2) {
+ System.out.println("There is no L2 block cache");
+ return;
+ }
+ bc = bcs[1];
+ }
+ if (bc == null) {
+ System.out.println("There is no block cache");
+ return;
+ }
+ BlockCacheUtil.CachedBlocksByFile cbsbf = BlockCacheUtil.getLoadedCachedBlocksByFile(conf, bc);
+ if (bcv.equals(RSStatusConstants.BLOCK_CACHE_V_FILE)) {
+ boolean firstEntry = true; %>
+ [<% for (Map.Entry> e: cbsbf.getCachedBlockStatsByFile().entrySet()) { %>
+ <% if (!firstEntry) { %>,<% } %><%= BlockCacheUtil.toJSON(e.getKey(), e.getValue()) %>
+ <%
+ if (firstEntry) {
+ firstEntry = false;
+ }
+ %>
+ <% } %>]
+
+<% } else { %>
+[ <%= BlockCacheUtil.toJSON(bc) %>, <%= BlockCacheUtil.toJSON(cbsbf) %> ]
+<% } %>
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/footer.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/footer.jsp
index 02a36e9c23fa..4b2d6cb2f5ee 100644
--- a/hbase-server/src/main/resources/hbase-webapps/regionserver/footer.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/footer.jsp
@@ -17,14 +17,6 @@
* limitations under the License.
*/
--%>
-
-
-
-
+