HBASE-19291 Use common header and footer for JSP pages

Use header and footer in our *.jsp pages to avoid unnecessary redundancy (copy-paste of code)

Misc edits:
- Due to redundancy, new additions make it to some places but not others. For eg there are missing links to "/logLevel", "/processRS.jsp" in few places.
- Fix processMaster.jsp wrongly pointing to rs-status instead of master-status (probably due to copy paste from processRS.jsp)
- Deleted a bunch of extraneous "</a>" in processMaster.jsp & processRS.jsp
- Added missing </div> tag in snapshot.jsp
- Deleted fossils of html5shiv.js. It's uses and the js itself were deleted in the commit "819aed4ccd073d818bfef5931ec8d248bfae5f1f"
- Fixed wrongly matched heading tags
- Deleted some unused variables

Tested:
Ran standalone cluster and opened each page to make sure it looked right.

Sidenote:
Looks like HBASE-3835 started the work of converting from jsp to jamon, but the work didn't finish. Now we have a mix of jsp and jamon. Needs reconciling, but later.
This commit is contained in:
Apekshit 2016-04-08 00:50:33 -07:00 committed by Apekshit Sharma
parent 984e0ecfc4
commit 3b2b22b5fa
14 changed files with 288 additions and 563 deletions

View File

@ -0,0 +1,24 @@
<%--
/**
* 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.
*/
--%>
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/static/js/tab.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1,67 @@
<%--
/**
* 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.HBaseConfiguration"
%>
<!DOCTYPE html>
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title><%= request.getParameter("pageTitle")%></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/master-status">
<img src="/static/hbase_logo_small.png" alt="HBase Logo"/>
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<li><a href="/procedures.jsp">Procedures</a></li>
<li><a href="/processMaster.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>

View File

@ -25,24 +25,19 @@
import="java.util.Date" import="java.util.Date"
import="java.util.List" import="java.util.List"
import="java.util.Set" import="java.util.Set"
import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.HBaseConfiguration"
import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv" import="org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv"
import="org.apache.hadoop.hbase.master.procedure.ProcedureDescriber" import="org.apache.hadoop.hbase.master.procedure.ProcedureDescriber"
import="org.apache.hadoop.hbase.procedure2.LockedResource" import="org.apache.hadoop.hbase.procedure2.LockedResource"
import="org.apache.hadoop.hbase.procedure2.Procedure" import="org.apache.hadoop.hbase.procedure2.Procedure"
import="org.apache.hadoop.hbase.procedure2.ProcedureExecutor" import="org.apache.hadoop.hbase.procedure2.ProcedureExecutor"
import="org.apache.hadoop.hbase.procedure2.ProcedureUtil"
import="org.apache.hadoop.hbase.procedure2.store.wal.ProcedureWALFile" import="org.apache.hadoop.hbase.procedure2.store.wal.ProcedureWALFile"
import="org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore" import="org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore"
import="org.apache.hadoop.hbase.procedure2.util.StringUtils" import="org.apache.hadoop.hbase.procedure2.util.StringUtils"
import="org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos"
import="org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil"
import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix" import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix"
%> %>
<% <%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
ProcedureExecutor<MasterProcedureEnv> procExecutor = master.getMasterProcedureExecutor(); ProcedureExecutor<MasterProcedureEnv> procExecutor = master.getMasterProcedureExecutor();
WALProcedureStore walStore = master.getWalProcedureStore(); WALProcedureStore walStore = master.getWalProcedureStore();
@ -62,49 +57,12 @@
}); });
List<LockedResource> lockedResources = master.getLocks(); List<LockedResource> lockedResources = master.getLocks();
pageContext.setAttribute("pageTitle", "HBase Master Procedures: " + master.getServerName());
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="${pageTitle}"/>
<html xmlns="http://www.w3.org/1999/xhtml"> </jsp:include>
<head>
<meta charset="utf-8" />
<title>HBase Master Procedures: <%= master.getServerName() %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="" />
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="/static/css/hbase.css" rel="stylesheet" />
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/master-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<li><a href="/procedures.jsp">Procedures &amp; Locks</a></li>
<li><a href="/processMaster.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row"> <div class="row">
<div class="page-header"> <div class="page-header">
@ -282,8 +240,5 @@
<% } %> <% } %>
<% } %> <% } %>
</div> </div>
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body> <jsp:include page="footer.jsp" />
</html>

View File

@ -20,8 +20,6 @@
<%@ page contentType="text/html;charset=UTF-8" <%@ page contentType="text/html;charset=UTF-8"
import="java.util.Date" import="java.util.Date"
import="java.util.List" import="java.util.List"
import="org.apache.hadoop.hbase.HBaseConfiguration"
import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
import="javax.management.ObjectName" import="javax.management.ObjectName"
import="java.lang.management.ManagementFactory" import="java.lang.management.ManagementFactory"
import="java.lang.management.MemoryPoolMXBean" import="java.lang.management.MemoryPoolMXBean"
@ -30,7 +28,6 @@
import="org.apache.hadoop.hbase.util.JSONMetricUtil" import="org.apache.hadoop.hbase.util.JSONMetricUtil"
import="org.apache.hadoop.hbase.procedure2.util.StringUtils" import="org.apache.hadoop.hbase.procedure2.util.StringUtils"
import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix" import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix"
import="com.fasterxml.jackson.databind.JsonNode"
%> %>
<% <%
RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean(); RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
@ -45,49 +42,12 @@ collector1 = gcBeans.get(0);
collector2 = gcBeans.get(1); collector2 = gcBeans.get(1);
} catch(IndexOutOfBoundsException e) {} } catch(IndexOutOfBoundsException e) {}
List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools(); List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.getProcessPID());
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="${pageTitle}"/>
<html xmlns="http://www.w3.org/1999/xhtml"> </jsp:include>
<head>
<meta charset="utf-8">
<title>Process info for PID: <%= JSONMetricUtil.getProcessPID() %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/rs-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<li><a href="/procedures.jsp">Procedures</a></li>
<li><a href="/processMaster.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row"> <div class="row">
<div class="page-header"> <div class="page-header">
@ -103,10 +63,10 @@ List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
</tr> </tr>
<tr> <tr>
<tr> <tr>
<td><%= new Date(runtimeBean.getStartTime()) %></a></td> <td><%= new Date(runtimeBean.getStartTime()) %></td>
<td><%= StringUtils.humanTimeDiff(runtimeBean.getUptime()) %></a></td> <td><%= StringUtils.humanTimeDiff(runtimeBean.getUptime()) %></td>
<td><%= JSONMetricUtil.getProcessPID() %></a></td> <td><%= JSONMetricUtil.getProcessPID() %></td>
<td><%= runtimeBean.getSystemProperties().get("user.name") %></a></td> <td><%= runtimeBean.getSystemProperties().get("user.name") %></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -126,12 +86,12 @@ List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
<th>ThreadsTerminated</th> <th>ThreadsTerminated</th>
</tr> </tr>
<tr> <tr>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsNew") %></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsNew") %></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsRunnable")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsRunnable")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsBlocked")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsBlocked")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsWaiting")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsWaiting")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTimedWaiting")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTimedWaiting")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTerminated")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTerminated")%></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -208,20 +168,15 @@ if(mp.getName().contains("Cache")) continue;%>
</tr> </tr>
<tr> <tr>
<tr> <tr>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getCommitted(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getCommitted(), "B", 1) %></td>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getInit(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getInit(), "B", 1) %></td>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getMax(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getMax(), "B", 1) %></td>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getUsed(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getUsed(), "B", 1) %></td>
<td><%= JSONMetricUtil.calcPercentage(mp.getUsage().getUsed(), <td><%= JSONMetricUtil.calcPercentage(mp.getUsage().getUsed(),
mp.getUsage().getCommitted()) %></a></td> mp.getUsage().getCommitted()) %></td>
</tr> </tr>
</table> </table>
</div> </div>
<% } %> <% } %>
<script src="/static/js/jquery.min.js" type="text/javascript"></script> <jsp:include page="footer.jsp" />
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/static/js/tab.js" type="text/javascript"></script>
</body>
</html>

View File

@ -26,7 +26,7 @@
import="org.apache.hadoop.hbase.snapshot.SnapshotInfo" import="org.apache.hadoop.hbase.snapshot.SnapshotInfo"
import="org.apache.hadoop.util.StringUtils" import="org.apache.hadoop.util.StringUtils"
import="org.apache.hadoop.hbase.TableName" import="org.apache.hadoop.hbase.TableName"
import="org.apache.hadoop.hbase.HBaseConfiguration" %> %>
<% <%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
Configuration conf = master.getConfiguration(); Configuration conf = master.getConfiguration();
@ -51,64 +51,22 @@
} }
String action = request.getParameter("action"); String action = request.getParameter("action");
String cloneName = request.getParameter("cloneName");
boolean isActionResultPage = (!readOnly && action != null); boolean isActionResultPage = (!readOnly && action != null);
String pageTitle;
if (isActionResultPage) {
pageTitle = "HBase Master: " + master.getServerName();
} else {
pageTitle = "Snapshot: " + snapshotName;
}
pageContext.setAttribute("pageTitle", pageTitle);
%> %>
<!DOCTYPE html>
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<% if (isActionResultPage) { %>
<title>HBase Master: <%= master.getServerName() %></title>
<% } else { %>
<title>Snapshot: <%= snapshotName %></title>
<% } %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet"> <jsp:include page="header.jsp">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet"> <jsp:param name="pageTitle" value="${pageTitle}"/>
<link href="/static/css/hbase.css" rel="stylesheet"> </jsp:include>
<% if (isActionResultPage) { %>
<script type="text/javascript"> <div class="container-fluid content">
<!--
setTimeout("history.back()",5000);
-->
</script>
<% } %>
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/master-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<li><a href="/procedures.jsp">Procedures &amp; Locks</a></li>
<li><a href="/processMaster.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<% if (snapshot == null) { %> <% if (snapshot == null) { %>
<div class="container-fluid content">
<div class="row inner_header"> <div class="row inner_header">
<div class="page-header"> <div class="page-header">
<h1>Snapshot "<%= snapshotName %>" does not exist</h1> <h1>Snapshot "<%= snapshotName %>" does not exist</h1>
@ -116,7 +74,6 @@
</div> </div>
<p>Go <a href="javascript:history.back()">Back</a>, or wait for the redirect. <p>Go <a href="javascript:history.back()">Back</a>, or wait for the redirect.
<% } else { %> <% } else { %>
<div class="container-fluid content">
<div class="row"> <div class="row">
<div class="page-header"> <div class="page-header">
<h1>Snapshot: <%= snapshotName %></h1> <h1>Snapshot: <%= snapshotName %></h1>
@ -178,10 +135,6 @@
<% <%
} // end else } // end else
%> %>
</div>
<jsp:include page="footer.jsp" />
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>

View File

@ -24,7 +24,6 @@
import="java.util.Map" import="java.util.Map"
import="org.apache.hadoop.conf.Configuration" import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.fs.Path" import="org.apache.hadoop.fs.Path"
import="org.apache.hadoop.hbase.HBaseConfiguration"
import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.snapshot.SnapshotInfo" import="org.apache.hadoop.hbase.snapshot.SnapshotInfo"
import="org.apache.hadoop.hbase.TableName" import="org.apache.hadoop.hbase.TableName"
@ -50,48 +49,11 @@
totalArchivedSize, totalSharedSize, totalMobSize); totalArchivedSize, totalSharedSize, totalMobSize);
totalSize = totalSharedSize.get() + totalArchivedSize.get() + totalMobSize.get(); totalSize = totalSharedSize.get() + totalArchivedSize.get() + totalMobSize.get();
} }
pageContext.setAttribute("pageTitle", "HBase Master Snapshots: " + master.getServerName());
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="${pageTitle}"/>
<html xmlns="http://www.w3.org/1999/xhtml"> </jsp:include>
<head>
<meta charset="utf-8">
<title>HBase Master Snapshots: <%= master.getServerName() %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/master-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<li><a href="/procedures.jsp">Procedures &amp; Locks</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row"> <div class="row">
<div class="page-header"> <div class="page-header">
@ -141,8 +103,4 @@
</table> </table>
</div> </div>
<script src="/static/js/jquery.min.js" type="text/javascript"></script> <jsp:include page="footer.jsp" />
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>

View File

@ -30,7 +30,6 @@
import="java.util.TreeMap" import="java.util.TreeMap"
import="org.apache.commons.lang3.StringEscapeUtils" import="org.apache.commons.lang3.StringEscapeUtils"
import="org.apache.hadoop.conf.Configuration" import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.HBaseConfiguration"
import="org.apache.hadoop.hbase.HColumnDescriptor" import="org.apache.hadoop.hbase.HColumnDescriptor"
import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.HConstants"
import="org.apache.hadoop.hbase.HRegionLocation" import="org.apache.hadoop.hbase.HRegionLocation"
@ -118,65 +117,19 @@
} }
int numRegions = 0; int numRegions = 0;
String pageTitle;
if ( !readOnly && action != null ) {
pageTitle = "HBase Master: " + StringEscapeUtils.escapeHtml4(master.getServerName().toString());
} else {
pageTitle = "Table: " + escaped_fqtn;
}
pageContext.setAttribute("pageTitle", pageTitle);
%> %>
<!DOCTYPE html>
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<% if ( !readOnly && action != null ) { %>
<title>HBase Master: <%= StringEscapeUtils.escapeHtml4(master.getServerName().toString()) %></title>
<% } else { %>
<title>Table: <%= escaped_fqtn %></title>
<% } %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<jsp:include page="header.jsp">
<jsp:param name="pageTitle" value="${pageTitle}"/>
</jsp:include>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
<% if ( ( !readOnly && action != null ) || fqtn == null ) { %>
<script type="text/javascript">
<!--
setTimeout("history.back()",5000);
-->
</script>
<% } else { %>
<!--[if lt IE 9]>
<script src="/static/js/html5shiv.js"></script>
<![endif]-->
<% } %>
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/master-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<li><a href="/procedures.jsp">Procedures &amp; Locks</a></li>
<li><a href="/processMaster.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<% <%
if ( fqtn != null ) { if ( fqtn != null ) {
try { try {
@ -889,11 +842,8 @@ Actions:
<p>Go <a href="javascript:history.back()">Back</a>, or wait for the redirect. <p>Go <a href="javascript:history.back()">Back</a>, or wait for the redirect.
</div> </div>
<% } %> <% } %>
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body> <jsp:include page="footer.jsp" />
</html>
<script> <script>
var index=0; var index=0;

View File

@ -19,64 +19,18 @@
--%> --%>
<%@ page contentType="text/html;charset=UTF-8" <%@ page contentType="text/html;charset=UTF-8"
import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml" import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.client.Admin" import="org.apache.hadoop.hbase.client.Admin"
import="org.apache.hadoop.hbase.client.Connection" import="org.apache.hadoop.hbase.client.Connection"
import="org.apache.hadoop.hbase.client.ConnectionFactory"
import="org.apache.hadoop.hbase.HTableDescriptor" import="org.apache.hadoop.hbase.HTableDescriptor"
import="org.apache.hadoop.hbase.HBaseConfiguration" %> %>
<% <%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
Configuration conf = master.getConfiguration(); pageContext.setAttribute("pageTitle", "HBase Master: " + master.getServerName());
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="${pageTitle}"/>
<html lang="en"> </jsp:include>
<head>
<meta charset="utf-8">
<title>HBase Master: <%= master.getServerName() %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/master-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<%if (master.isActiveMaster()) { %>
<li><a href="/procedures.jsp">Procedures &amp; Locks</a></li>
<% } %>
<li><a href="/processMaster.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row inner_header"> <div class="row inner_header">
@ -110,8 +64,5 @@
</table> </table>
<% } %> <% } %>
</div> </div>
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body> <jsp:include page="footer.jsp" />
</html>

View File

@ -21,57 +21,15 @@
import="org.apache.commons.lang3.StringEscapeUtils" import="org.apache.commons.lang3.StringEscapeUtils"
import="org.apache.hadoop.hbase.zookeeper.ZKUtil" import="org.apache.hadoop.hbase.zookeeper.ZKUtil"
import="org.apache.hadoop.hbase.zookeeper.ZKWatcher" import="org.apache.hadoop.hbase.zookeeper.ZKWatcher"
import="org.apache.hadoop.hbase.HBaseConfiguration" import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.master.HMaster"%><% %>
<%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
ZKWatcher watcher = master.getZooKeeper(); ZKWatcher watcher = master.getZooKeeper();
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="Zookeeper Dump"/>
<!-- Dont put a doctype jetty doesnt serve the css/js out correctly so we need quirks mode on --> </jsp:include>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>ZooKeeper Dump</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/master-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/master-status">Home</a></li>
<li><a href="/tablesDetailed.jsp">Table Details</a></li>
<li><a href="/procedures.jsp">Procedures &amp; Locks</a></li>
<li><a href="/processMaster.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row inner_header"> <div class="row inner_header">
<div class="page-header"> <div class="page-header">
@ -84,8 +42,4 @@
</div> </div>
</div> </div>
</div> </div>
<script src="/static/js/jquery.min.js" type="text/javascript"></script> <jsp:include page="footer.jsp" />
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1,24 @@
<%--
/**
* 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.
*/
--%>
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/static/js/tab.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1,65 @@
<%--
/**
* 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.HBaseConfiguration"
%>
<!DOCTYPE html>
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title><%= request.getParameter("pageTitle")%></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/rs-status">
<img src="/static/hbase_logo_small.png" alt="HBase Logo"/>
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/rs-status">Home</a></li>
<li><a href="/processRS.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>

View File

@ -20,8 +20,6 @@
<%@ page contentType="text/html;charset=UTF-8" <%@ page contentType="text/html;charset=UTF-8"
import="java.util.Date" import="java.util.Date"
import="java.util.List" import="java.util.List"
import="org.apache.hadoop.hbase.HBaseConfiguration"
import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
import="javax.management.ObjectName" import="javax.management.ObjectName"
import="java.lang.management.ManagementFactory" import="java.lang.management.ManagementFactory"
import="java.lang.management.MemoryPoolMXBean" import="java.lang.management.MemoryPoolMXBean"
@ -30,7 +28,6 @@
import="org.apache.hadoop.hbase.util.JSONMetricUtil" import="org.apache.hadoop.hbase.util.JSONMetricUtil"
import="org.apache.hadoop.hbase.procedure2.util.StringUtils" import="org.apache.hadoop.hbase.procedure2.util.StringUtils"
import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix" import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix"
import="com.fasterxml.jackson.databind.JsonNode"
%> %>
<% <%
RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean(); RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
@ -46,46 +43,12 @@ collector1 = gcBeans.get(0);
collector2 = gcBeans.get(1); collector2 = gcBeans.get(1);
} catch(IndexOutOfBoundsException e) {} } catch(IndexOutOfBoundsException e) {}
List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools(); List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.getProcessPID());
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="${pageTitle}"/>
<html xmlns="http://www.w3.org/1999/xhtml"> </jsp:include>
<head>
<meta charset="utf-8">
<title>Process info for PID: <%= JSONMetricUtil.getProcessPID() %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/rs-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/rs-status">Home</a></li>
<li><a href="/processRS.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row"> <div class="row">
<div class="page-header"> <div class="page-header">
@ -102,12 +65,12 @@ List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
</tr> </tr>
<tr> <tr>
<tr> <tr>
<td><%= new Date(runtimeBean.getStartTime()) %></a></td> <td><%= new Date(runtimeBean.getStartTime()) %></td>
<td><%= StringUtils.humanTimeDiff(runtimeBean.getUptime()) %></a></td> <td><%= StringUtils.humanTimeDiff(runtimeBean.getUptime()) %></td>
<td><%= JSONMetricUtil.getProcessPID() %></a></td> <td><%= JSONMetricUtil.getProcessPID() %></td>
<td><%= (long)JSONMetricUtil.getValueFromMBean(rsMetrics, "pauseWarnThresholdExceeded") <td><%= (long)JSONMetricUtil.getValueFromMBean(rsMetrics, "pauseWarnThresholdExceeded")
+ (long)JSONMetricUtil.getValueFromMBean(rsMetrics, "pauseInfoThresholdExceeded") %></a></td> + (long)JSONMetricUtil.getValueFromMBean(rsMetrics, "pauseInfoThresholdExceeded") %></td>
<td><%= runtimeBean.getSystemProperties().get("user.name") %></a></td> <td><%= runtimeBean.getSystemProperties().get("user.name") %></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -128,12 +91,12 @@ List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
</tr> </tr>
<tr> <tr>
<tr> <tr>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsNew") %></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsNew") %></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsRunnable")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsRunnable")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsBlocked")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsBlocked")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsWaiting")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsWaiting")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTimedWaiting")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTimedWaiting")%></td>
<td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTerminated")%></a></td> <td><%= JSONMetricUtil.getValueFromMBean(jvmMetrics, "ThreadsTerminated")%></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -210,20 +173,15 @@ if(mp.getName().contains("Cache")) continue;%>
</tr> </tr>
<tr> <tr>
<tr> <tr>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getCommitted(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getCommitted(), "B", 1) %></td>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getInit(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getInit(), "B", 1) %></td>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getMax(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getMax(), "B", 1) %></td>
<td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getUsed(), "B", 1) %></a></td> <td><%= TraditionalBinaryPrefix.long2String(mp.getUsage().getUsed(), "B", 1) %></td>
<td><%= JSONMetricUtil.calcPercentage(mp.getUsage().getUsed(), <td><%= JSONMetricUtil.calcPercentage(mp.getUsage().getUsed(),
mp.getUsage().getCommitted()) %></a></td> mp.getUsage().getCommitted()) %></td>
</tr> </tr>
</table> </table>
</div> </div>
<% } %> <% } %>
<script src="/static/js/jquery.min.js" type="text/javascript"></script> <jsp:include page="footer.jsp" />
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/static/js/tab.js" type="text/javascript"></script>
</body>
</html>

View File

@ -21,9 +21,6 @@
import="java.util.Collection" import="java.util.Collection"
import="java.util.Date" import="java.util.Date"
import="java.util.List" import="java.util.List"
import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.HBaseConfiguration"
import="org.apache.hadoop.hbase.client.RegionInfoDisplay" import="org.apache.hadoop.hbase.client.RegionInfoDisplay"
import="org.apache.hadoop.hbase.regionserver.HRegionServer" import="org.apache.hadoop.hbase.regionserver.HRegionServer"
import="org.apache.hadoop.hbase.regionserver.Region" import="org.apache.hadoop.hbase.regionserver.Region"
@ -33,55 +30,15 @@
<% <%
String regionName = request.getParameter("name"); String regionName = request.getParameter("name");
HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER); HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
Configuration conf = rs.getConfiguration();
Region region = rs.getRegion(regionName); Region region = rs.getRegion(regionName);
String displayName = RegionInfoDisplay.getRegionNameAsStringForDisplay(region.getRegionInfo(), String displayName = RegionInfoDisplay.getRegionNameAsStringForDisplay(region.getRegionInfo(),
rs.getConfiguration()); rs.getConfiguration());
pageContext.setAttribute("pageTitle", "HBase RegionServer: " + rs.getServerName());
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="${pageTitle}"/>
<html lang="en"> </jsp:include>
<head>
<meta charset="utf-8">
<title>HBase RegionServer: <%= rs.getServerName() %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/rs-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/rs-status">Home</a></li>
<li><a href="/processRS.jsp">Process Metrics</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row inner_header"> <div class="row inner_header">
@ -96,11 +53,11 @@
String cf = store.getColumnFamilyName(); String cf = store.getColumnFamilyName();
Collection<? extends StoreFile> storeFiles = store.getStorefiles(); %> Collection<? extends StoreFile> storeFiles = store.getStorefiles(); %>
<h3>Column Family: <%= cf %></h2> <h3>Column Family: <%= cf %></h3>
<h4>Memstore size (MB): <%= (int) (store.getMemStoreSize().getHeapSize() / 1024 / 1024) %></h3> <h4>Memstore size (MB): <%= (int) (store.getMemStoreSize().getHeapSize() / 1024 / 1024) %></h4>
<h4>Store Files</h3> <h4>Store Files</h4>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
@ -121,8 +78,5 @@
<% } <% }
}%> }%>
</div> </div>
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body> <jsp:include page="footer.jsp" />
</html>

View File

@ -22,58 +22,18 @@
import="java.io.PrintStream" import="java.io.PrintStream"
import="org.apache.hadoop.conf.Configuration" import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.fs.Path" import="org.apache.hadoop.fs.Path"
import="org.apache.hadoop.hbase.HBaseConfiguration"
import="org.apache.hadoop.hbase.io.hfile.HFilePrettyPrinter" import="org.apache.hadoop.hbase.io.hfile.HFilePrettyPrinter"
import="org.apache.hadoop.hbase.regionserver.HRegionServer" import="org.apache.hadoop.hbase.regionserver.HRegionServer"
import="org.apache.hadoop.hbase.regionserver.StoreFile" %>
%>
<% <%
String storeFile = request.getParameter("name"); String storeFile = request.getParameter("name");
HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER); HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
Configuration conf = rs.getConfiguration(); Configuration conf = rs.getConfiguration();
pageContext.setAttribute("pageTitle", "HBase RegionServer: " + rs.getServerName());
%> %>
<!DOCTYPE html> <jsp:include page="header.jsp">
<?xml version="1.0" encoding="UTF-8" ?> <jsp:param name="pageTitle" value="${pageTitle}"/>
<html lang="en"> </jsp:include>
<head>
<meta charset="utf-8">
<title>HBase RegionServer: <%= rs.getServerName() %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/static/css/hbase.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/rs-status"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/rs-status">Home</a></li>
<li><a href="/logs/">Local Logs</a></li>
<li><a href="/logLevel">Log Level</a></li>
<li><a href="/dump">Debug Dump</a></li>
<li><a href="/jmx">Metrics Dump</a></li>
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
<li><a href="/conf">HBase Configuration</a></li>
<% } %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid content"> <div class="container-fluid content">
<div class="row inner_header"> <div class="row inner_header">
@ -103,8 +63,5 @@
%> %>
</pre> </pre>
</div> </div>
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
</body> <jsp:include page="footer.jsp" />
</html>