diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml
index 2c7c021c0541..4392a554e3c2 100644
--- a/hbase-server/pom.xml
+++ b/hbase-server/pom.xml
@@ -571,12 +571,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon
deleted file mode 100644
index 8798e930c707..000000000000
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon
+++ /dev/null
@@ -1,140 +0,0 @@
-<%doc>
-
-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.
-%doc>
-<%import>
-java.util.*;
-org.apache.hadoop.hbase.monitoring.*;
-org.apache.hadoop.util.StringUtils;
-%import>
-<%args>
-TaskMonitor taskMonitor = TaskMonitor.get();
-String filter = "general";
-String format = "html";
-String parent = "";
-%args>
-
-<%if format.equals("json")%>
- <& renderTasks; filter=filter &>
-<%else>
-
- %if>
- %if>
-%def>
-
-<%def stateCss>
- <%args>
- MonitoredTask.State state;
- %args>
-<%java> if (state == MonitoredTask.State.COMPLETE) { %java>alert alert-success<%java> } %java>
-<%java> else if (state == MonitoredTask.State.ABORTED) { %java>alert alert-danger<%java> } %java>
-%def>
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
deleted file mode 100644
index 67b3df5df168..000000000000
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
+++ /dev/null
@@ -1,396 +0,0 @@
-<%doc>
-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.
-
-Template for rendering Block Cache tabs in RegionServer Status page.
-%doc>
-<%args>
-CacheConfig cacheConfig;
-Configuration config;
-BlockCache bc;
-%args>
-<%java>
- String bcUrl = bc == null ? null : "http://hbase.apache.org/devapidocs/" + bc.getClass().getName().replaceAll("\\.", "/") + ".html";
- String bcName = bc == null ? null : bc.getClass().getSimpleName();
- BlockCache [] bcs = bc == null ? null : bc.getBlockCaches();
- boolean evictions = bcs != null && bcs.length > 1;
-%java>
-<%import>
-java.util.Map;
-org.apache.hadoop.hbase.io.hfile.BlockCacheUtil;
-org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
-org.apache.hadoop.hbase.io.hfile.AgeSnapshot;
-org.apache.hadoop.hbase.io.hfile.CachedBlock;
-org.apache.hadoop.conf.Configuration;
-org.apache.hadoop.hbase.io.hfile.CacheConfig;
-org.apache.hadoop.hbase.io.hfile.BlockCache;
-org.apache.hadoop.hbase.io.hfile.LruBlockCache;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
-org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
-%import>
-
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
-
-
-%if>
-%def>
-
-<%def evictions_tmpl>
-<%args>
- BlockCache bc;
-%args>
-<%java>
- AgeSnapshot ageAtEvictionSnapshot = bc.getStats().getAgeAtEvictionSnapshot();
- // Only show if non-zero mean and stddev as is the case in combinedblockcache
-%java>
-
The total free memory currently available to store more cache entries
-
-
-
Count
-
<% String.format("%,d", bc.getBlockCount()) %>
-
Number of blocks in block cache
-
- <& evictions_tmpl; bc = bc; &>
- <& hits_tmpl; 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.
-%if>
- <& evictions_tmpl; bc = bc; &>
-<& hits_tmpl; bc = bc; &>
-
-<%if bucketCache %>
-
-
Hits per Second
-
<% bucketCacheStats.getIOHitsPerSecond() %>
-
Block gets against this cache per second
-
-
-
Time per Hit
-
<% bucketCacheStats.getIOTimePerHit() %>
-
Time per cache hit
-
-%if>
-
-<%doc>Call through to block cache Detail rendering template%doc>
-
-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.
-%if>
-
-%def>
-
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheViewTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheViewTmpl.jamon
deleted file mode 100644
index d5a9aa54e6fd..000000000000
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheViewTmpl.jamon
+++ /dev/null
@@ -1,70 +0,0 @@
-<%doc>
-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.
-
-
-This template is used to give views on an individual block cache as JSON.
-%doc>
-<%args>
-CacheConfig cacheConfig;
-Configuration conf;
-String bcn;
-String bcv;
-BlockCache blockCache;
-%args>
-<%import>
-java.util.*;
-org.apache.hadoop.conf.Configuration;
-org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
-org.apache.hadoop.hbase.io.hfile.BlockCacheUtil;
-org.apache.hadoop.hbase.io.hfile.CachedBlock;
-org.apache.hadoop.hbase.io.hfile.CacheConfig;
-org.apache.hadoop.hbase.io.hfile.BlockCache;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
-org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
-org.apache.hadoop.util.StringUtils;
-%import>
-<%java>
- BlockCache bc = blockCache;
- BlockCache [] bcs = bc == null ? null : bc.getBlockCaches();
- if (bcn.equals("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;
- }
- CachedBlocksByFile cbsbf = BlockCacheUtil.getLoadedCachedBlocksByFile(conf, bc);
-%java>
-<%if bcv.equals("file") %><& bc_by_file; cbsbf = cbsbf; &><%else>[ <% BlockCacheUtil.toJSON(bc) %>, <% BlockCacheUtil.toJSON(cbsbf) %> ]%if>
-<%java>
-cbsbf = null;
-%java>
-
-<%def bc_by_file>
-<%args>
- CachedBlocksByFile cbsbf;
-%args>
-[<%for Map.Entry> e: cbsbf.getCachedBlockStatsByFile().entrySet() %><% BlockCacheUtil.toJSON(e.getKey(), e.getValue()) %>%for>]
-%def>
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
deleted file mode 100644
index 01f6e3d0296a..000000000000
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
+++ /dev/null
@@ -1,328 +0,0 @@
-<%doc>
-
-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.
-%doc>
-<%args>
-HRegionServer regionServer;
-String filter = "general";
-String format = "html";
-String bcn = "";
-String bcv = "";
-%args>
-<%import>
-java.util.*;
-org.apache.hadoop.hbase.regionserver.HRegionServer;
-org.apache.hadoop.hbase.client.RegionInfo;
-org.apache.hadoop.hbase.ServerName;
-org.apache.hadoop.hbase.HBaseConfiguration;
-org.apache.hadoop.hbase.io.hfile.CacheConfig;
-org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
-org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ServerInfo;
-org.apache.hadoop.hbase.util.JvmVersion;
-org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
-%import>
-<%doc>If json AND bcn is NOT an empty string presume it a block cache view request.%doc>
-<%if format.equals("json") && bcn != null && bcn.length() > 0 %>
- <& BlockCacheViewTmpl; conf = regionServer.getConfiguration(); cacheConfig = new CacheConfig(regionServer.getConfiguration()); bcn = bcn; bcv = bcv; blockCache = regionServer.getBlockCache().orElse(null) &>
- <%java return; %>
-<%elseif format.equals("json") %>
- <& ../common/TaskMonitorTmpl; filter = filter; format = "json" &>
- <%java return; %>
-%if>
-<%java>
- ServerInfo serverInfo = ProtobufUtil.getServerInfo(null, regionServer.getRSRpcServices());
- ServerName serverName = ProtobufUtil.toServerName(serverInfo.getServerName());
- List onlineRegions = ProtobufUtil.getOnlineRegions(regionServer.getRSRpcServices());
- MasterAddressTracker masterAddressTracker = regionServer.getMasterAddressTracker();
- ServerName masterServerName = masterAddressTracker == null ? null
- : masterAddressTracker.getMasterAddress();
- int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMasterInfoPort();
-%java>
-
-<%class>
- public String formatZKString() {
- StringBuilder quorums = new StringBuilder();
- String zkQuorum = regionServer.getZooKeeper().getQuorum();
-
- if (null == zkQuorum) {
- return quorums.toString();
- }
-
- String[] zks = zkQuorum.split(",");
-
- if (zks.length == 0) {
- return quorums.toString();
- }
-
- for(int i = 0; i < zks.length; ++i) {
- quorums.append(zks[i].trim());
-
- if (i != (zks.length - 1)) {
- quorums.append(" ");
- }
- }
-
- return quorums.toString();
- }
-%class>
-
-
-
-
-
-
- HBase Region Server: <% serverName.getHostname() %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
deleted file mode 100644
index c1d27c40c977..000000000000
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
+++ /dev/null
@@ -1,315 +0,0 @@
-<%doc>
-
- 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.
-%doc>
-<%args>
- HRegionServer regionServer;
- List onlineRegions;
-%args>
-<%import>
- java.util.*;
- org.apache.commons.lang3.time.FastDateFormat;
- org.apache.hadoop.hbase.regionserver.HRegionServer;
- org.apache.hadoop.hbase.util.Bytes;
- org.apache.hadoop.hbase.client.RegionInfo;
- org.apache.hadoop.hbase.client.RegionInfoDisplay;
- org.apache.hadoop.hbase.regionserver.Region;
- org.apache.hadoop.hbase.ServerName;
- org.apache.hadoop.hbase.HBaseConfiguration;
- org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
- org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ServerInfo;
- org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad;
- org.apache.hadoop.hbase.client.RegionReplicaUtil;
- org.apache.hadoop.hbase.regionserver.MetricsRegionWrapper;
- org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
-%import>
-<%if (onlineRegions != null && onlineRegions.size() > 0) %>
-
- <%java>
- Collections.sort(onlineRegions, RegionInfo.COMPARATOR);
- %java>
-
-
Region names are made of the containing table's name, a comma,
- the start key, a comma, and a randomly generated region id. To illustrate,
- the region named
- domains,apache.org,5464829424211263407 is party to the table
- domains, has an id of 5464829424211263407 and the first key
- in the region is apache.org. The hbase:meta 'table' is an internal
- system table (or a 'catalog' table in db-speak).
- The hbase:meta table keeps a list of all regions in the system. The empty key is used to denote
- table start and table end. A region with an empty start key is the first region in a table.
- If a region has both an empty start key and an empty end key, it's the only region in the
- table. See HBase Home for further explication.
-<%else>
-
Not serving regions
-%if>
-
-<%def baseInfo>
-<%args>
- List onlineRegions;
-%args>
-
-%def>
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ReplicationStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ReplicationStatusTmpl.jamon
deleted file mode 100644
index 273b26aecd36..000000000000
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ReplicationStatusTmpl.jamon
+++ /dev/null
@@ -1,105 +0,0 @@
-<%doc>
-
- 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.
-%doc>
-<%args>
- HRegionServer regionServer;
-%args>
-<%import>
- java.util.*;
- java.util.Map.Entry;
- org.apache.hadoop.hbase.procedure2.util.StringUtils;
- org.apache.hadoop.hbase.regionserver.HRegionServer;
- org.apache.hadoop.hbase.replication.regionserver.ReplicationStatus;
-%import>
-
-<%java>
- Map walGroupsReplicationStatus = regionServer.getWalGroupsReplicationStatus();
-%java>
-
-<%if (walGroupsReplicationStatus != null && walGroupsReplicationStatus.size() > 0) %>
-
-
If the replication delay is UNKNOWN, that means this walGroup doesn't start replicate yet and it may get disabled.
- If the size of log is 0, it means we are replicating current HLog, thus we can't get accurate size since it's not closed yet.
-%def>
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
deleted file mode 100644
index 84161a80381c..000000000000
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
+++ /dev/null
@@ -1,269 +0,0 @@
-<%doc>
-
-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.
-%doc>
-<%args>
-MetricsRegionServerWrapper mWrap;
-MetricsHBaseServerWrapper mServerWrap;
-ByteBuffAllocator bbAllocator;
-%args>
-<%import>
-java.util.*;
-org.apache.hadoop.hbase.regionserver.HRegionServer;
-org.apache.hadoop.hbase.io.ByteBuffAllocator;
-org.apache.hadoop.hbase.ipc.MetricsHBaseServerWrapper;
-org.apache.hadoop.hbase.regionserver.MetricsRegionServerWrapper;
-org.apache.hadoop.hbase.util.Bytes;
-org.apache.hadoop.hbase.HRegionInfo;
-org.apache.hadoop.hbase.ServerName;
-org.apache.hadoop.hbase.HBaseConfiguration;
-org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
-org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
-org.apache.hadoop.hbase.util.DirectMemoryUtils;
-org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
-java.lang.management.MemoryUsage;
-org.apache.hadoop.hbase.io.util.MemorySizeUtil;
-%import>
-
-%def>
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusUtil.java
index 221e43f8e114..c860e89681c9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusUtil.java
@@ -79,7 +79,7 @@ public static ServerName getMetaLocationOrNull(HMaster master) {
public static String serverNameLink(HMaster master, ServerName serverName) {
int infoPort = master.getRegionServerInfoPort(serverName);
- String url = "//" + serverName.getHostname() + ":" + infoPort + "/rs-status";
+ String url = "//" + serverName.getHostname() + ":" + infoPort + "/regionserver.jsp";
if (infoPort > 0) {
return "" + serverName.getServerName() + "";
} else {
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/http/RSStatusConstants.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/http/RSStatusConstants.java
new file mode 100644
index 000000000000..09b7c34e3318
--- /dev/null
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/http/RSStatusConstants.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+package org.apache.hadoop.hbase.regionserver.http;
+
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * Constants used by the web UI JSP pages.
+ */
+@InterfaceAudience.Private
+public final class RSStatusConstants {
+ public static final String FILTER = "filter";
+ public static final String FILTER_GENERAL = "general";
+ public static final String FORMAT = "format";
+ public static final String FORMAT_JSON = "json";
+ public static final String FORMAT_HTML = "html";
+ public static final String PARENT = "parent";
+ public static final String BLOCK_CACHE_NAME = "bcn";
+ public static final String BLOCK_CACHE_NAME_L1 = "L1";
+ public static final String BLOCK_CACHE_V = "bcv";
+ public static final String BLOCK_CACHE_V_FILE = "file";
+
+ private RSStatusConstants() {
+ // Do not instantiate.
+ }
+}
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/http/RSStatusServlet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/http/RSStatusServlet.java
index b9bf2da6080e..9b8f9833f0b8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/http/RSStatusServlet.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/http/RSStatusServlet.java
@@ -18,38 +18,20 @@
package org.apache.hadoop.hbase.regionserver.http;
import java.io.IOException;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.hadoop.hbase.regionserver.HRegionServer;
-import org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl;
import org.apache.yetus.audience.InterfaceAudience;
+/**
+ * Only kept for redirecting to regionserver.jsp.
+ */
@InterfaceAudience.Private
public class RSStatusServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
- HRegionServer hrs =
- (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
- assert hrs != null : "No RS in context!";
-
- resp.setContentType("text/html");
-
- if (!hrs.isOnline()) {
- resp.getWriter().write("The RegionServer is initializing!");
- resp.getWriter().close();
- return;
- }
-
- RSStatusTmpl tmpl = new RSStatusTmpl();
- if (req.getParameter("format") != null) tmpl.setFormat(req.getParameter("format"));
- if (req.getParameter("filter") != null) tmpl.setFilter(req.getParameter("filter"));
- if (req.getParameter("bcn") != null) tmpl.setBcn(req.getParameter("bcn"));
- if (req.getParameter("bcv") != null) tmpl.setBcv(req.getParameter("bcv"));
- tmpl.render(resp.getWriter(), hrs);
+ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ response.sendRedirect(request.getContextPath() + "/regionserver.jsp");
}
}
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ZKStringFormatter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ZKStringFormatter.java
new file mode 100644
index 000000000000..a83f07014b05
--- /dev/null
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ZKStringFormatter.java
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+package org.apache.hadoop.hbase.util;
+
+import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * Utility used by both Master and Region Server web UI JSP pages.
+ */
+@InterfaceAudience.Private
+public final class ZKStringFormatter {
+
+ private ZKStringFormatter() {
+ // Do not instantiate.
+ }
+
+ public static String formatZKString(ZKWatcher zookeeper) {
+ StringBuilder quorums = new StringBuilder();
+ String zkQuorum = zookeeper.getQuorum();
+
+ if (null == zkQuorum) {
+ return quorums.toString();
+ }
+
+ String[] zks = zkQuorum.split(",");
+
+ if (zks.length == 0) {
+ return quorums.toString();
+ }
+
+ for (int i = 0; i < zks.length; ++i) {
+ quorums.append(zks[i].trim());
+
+ if (i != (zks.length - 1)) {
+ quorums.append(" ");
+ }
+ }
+
+ return quorums.toString();
+ }
+}
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/taskMonitor.jsp b/hbase-server/src/main/resources/hbase-webapps/common/taskMonitor.jsp
similarity index 100%
rename from hbase-server/src/main/resources/hbase-webapps/master/taskMonitor.jsp
rename to hbase-server/src/main/resources/hbase-webapps/common/taskMonitor.jsp
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/taskMonitorRenderTasks.jsp b/hbase-server/src/main/resources/hbase-webapps/common/taskMonitorRenderTasks.jsp
similarity index 100%
rename from hbase-server/src/main/resources/hbase-webapps/master/taskMonitorRenderTasks.jsp
rename to hbase-server/src/main/resources/hbase-webapps/common/taskMonitorRenderTasks.jsp
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp b/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp
index 01cb4680ba97..ea4a1a7f4163 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp
@@ -383,7 +383,7 @@ private static String formatServerName(HMaster master,
int infoPort = master.getRegionServerInfoPort(serverName);
if (infoPort > 0) {
return "" + sn + "";
+ infoPort + "/regionserver.jsp>" + sn + "";
} else {
return "" + sn + "";
}
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/master.jsp b/hbase-server/src/main/resources/hbase-webapps/master/master.jsp
index 7e5371238513..76dbd656e9de 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/master.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/master.jsp
@@ -32,6 +32,7 @@
if (format != null && format.equals("json")) {
request.setAttribute(MasterStatusConstants.FILTER, filter);
request.setAttribute(MasterStatusConstants.FORMAT, "json");
+ response.setContentType("application/json");
%>
<%
@@ -143,6 +144,7 @@
<% } %>
+ <% request.setAttribute(MasterStatusConstants.PARENT, "/master.jsp"); %>
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp b/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp
index 6e7f0cc5d5e3..f53e2cefaed0 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp
@@ -40,10 +40,11 @@
import="org.apache.hadoop.hbase.rsgroup.RSGroupInfo"
import="org.apache.hadoop.hbase.util.Bytes"
import="org.apache.hadoop.hbase.util.VersionInfo"
- import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix"%>
-<%@ page import="org.apache.hadoop.hbase.ServerMetrics" %>
-<%@ page import="org.apache.hadoop.hbase.Size" %>
-<%@ page import="org.apache.hadoop.hbase.RegionMetrics" %>
+ import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix"
+ import="org.apache.hadoop.hbase.ServerMetrics"
+ import="org.apache.hadoop.hbase.Size"
+ import="org.apache.hadoop.hbase.RegionMetrics"
+ import="static org.apache.hadoop.hbase.master.http.MasterStatusUtil.serverNameLink" %>
<%
String rsGroupName = request.getParameter("name");
pageContext.setAttribute("pageTitle", "RSGroup: " + rsGroupName);
@@ -169,11 +170,9 @@
totalRequestsPerSecond += sl.getRequestCountPerSecond();
lastContact = (System.currentTimeMillis() - sl.getReportTimestamp())/1000;
}
- long startcode = serverName.getStartCode();
- int infoPort = master.getRegionServerInfoPort(serverName);
- String url = "//" + serverName.getHostname() + ":" + infoPort + "/rs-status";%>
+ long startcode = serverName.getStartCode(); %>
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();
+%>
+
+
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
+%>
+
+
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..cd21bcf747dc
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/blockCacheHits.jsp
@@ -0,0 +1,50 @@
+<%--
+/**
+ * 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");
+%>
+
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) { %>
+
+
+<%-- 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) { %>
+
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.
*/
--%>
-
-
-
-
+