Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A9871869D for ; Wed, 9 Dec 2015 01:50:32 +0000 (UTC) Received: (qmail 24458 invoked by uid 500); 9 Dec 2015 01:50:31 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 24415 invoked by uid 500); 9 Dec 2015 01:50:31 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 24406 invoked by uid 99); 9 Dec 2015 01:50:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2015 01:50:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B89EEE0972; Wed, 9 Dec 2015 01:50:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: antonov@apache.org To: commits@hbase.apache.org Message-Id: <9f7a1f7e67cc44c28c6082299678d990@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-7171 Initial web UI for region/memstore/storefiles details Date: Wed, 9 Dec 2015 01:50:31 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/branch-1.2 e8c3899d4 -> ded975820 HBASE-7171 Initial web UI for region/memstore/storefiles details Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ded97582 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ded97582 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ded97582 Branch: refs/heads/branch-1.2 Commit: ded97582063ca16ccc5d0ab4cd93ae7afa66bdad Parents: e8c3899 Author: Mikhail Antonov Authored: Tue Dec 8 13:53:21 2015 -0800 Committer: Mikhail Antonov Committed: Tue Dec 8 17:32:21 2015 -0800 ---------------------------------------------------------------------- .../tmpl/regionserver/RegionListTmpl.jamon | 20 ++- .../hbase-webapps/regionserver/region.jsp | 129 +++++++++++++++++++ .../hbase-webapps/regionserver/storeFile.jsp | 115 +++++++++++++++++ 3 files changed, 259 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/ded97582/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon ---------------------------------------------------------------------- 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 index bf143b9..8e341f0 100644 --- 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 @@ -95,7 +95,9 @@ <%for HRegionInfo r: onlineRegions %> - <% r.getRegionNameAsString() %> + + <% r.getRegionNameAsString() %> + <% Bytes.toStringBinary(r.getStartKey()) %> <% Bytes.toStringBinary(r.getEndKey()) %> <% r.getReplicaId() %> @@ -121,7 +123,9 @@ <%java> RegionLoad load = regionServer.createRegionLoad(r.getEncodedName()); - <% r.getRegionNameAsString() %> + + <% r.getRegionNameAsString() %> + <%if load != null %> <% load.getReadRequestsCount() %> <% load.getWriteRequestsCount() %> @@ -154,7 +158,9 @@ <%java> RegionLoad load = regionServer.createRegionLoad(r.getEncodedName()); - <% r.getRegionNameAsString() %> + + <% r.getRegionNameAsString() %> + <%if load != null %> <% load.getStores() %> <% load.getStorefiles() %> @@ -193,7 +199,9 @@ ((float) load.getCurrentCompactedKVs() / load.getTotalCompactingKVs())) + "%"; } - <% r.getRegionNameAsString() %> + + <% r.getRegionNameAsString() %> + <%if load != null %> <% load.getTotalCompactingKVs() %> <% load.getCurrentCompactedKVs() %> @@ -220,7 +228,9 @@ <%java> RegionLoad load = regionServer.createRegionLoad(r.getEncodedName()); - <% r.getRegionNameAsString() %> + + <% r.getRegionNameAsString() %> + <%if load != null %> <% load.getMemstoreSizeMB() %>m http://git-wip-us.apache.org/repos/asf/hbase/blob/ded97582/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp new file mode 100644 index 0000000..cd35ad1 --- /dev/null +++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp @@ -0,0 +1,129 @@ +<%-- +/** + * 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.Collection" + import="java.util.Date" + import="java.util.List" + import="static org.apache.commons.lang.StringEscapeUtils.escapeXml" + import="org.apache.hadoop.conf.Configuration" + import="org.apache.hadoop.hbase.HTableDescriptor" + import="org.apache.hadoop.hbase.HColumnDescriptor" + import="org.apache.hadoop.hbase.HBaseConfiguration" + import="org.apache.hadoop.hbase.HRegionInfo" + import="org.apache.hadoop.hbase.regionserver.HRegionServer" + import="org.apache.hadoop.hbase.regionserver.Region" + import="org.apache.hadoop.hbase.regionserver.Store" + import="org.apache.hadoop.hbase.regionserver.StoreFile"%> +<% + String regionName = request.getParameter("name"); + HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER); + Configuration conf = rs.getConfiguration(); + + Region region = rs.getFromOnlineRegions(regionName); + String displayName = region.getRegionInfo().getRegionNameAsString(); +%> + + + + + + HBase RegionServer: <%= rs.getServerName() %> + + + + + + + + + + + + + + +
+
+ +
+ +<% if(region != null) { // + List stores = region.getStores(); + for (Store store : stores) { + String cf = store.getColumnFamilyName(); + Collection storeFiles = store.getStorefiles(); %> + +

Column Family: <%= cf %>

+ +

Memstore size (MB): <%= (int) (store.getMemStoreSize() / 1024 / 1024) %>

+ +

Store Files

+ + + + + + + + <% for(StoreFile sf : storeFiles) { %> + + + + + + <% } %> + +

<%= storeFiles.size() %> StoreFile(s) in set.

+
Store FileSize (MB)Modification time
<%= sf.getPath() %><%= (int) (rs.getFileSystem().getLength(sf.getPath()) / 1024 / 1024) %><%= new Date(sf.getModificationTimeStamp()) %>
+ <% } + }%> +
+ + + + + http://git-wip-us.apache.org/repos/asf/hbase/blob/ded97582/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp new file mode 100644 index 0000000..cbbb61f --- /dev/null +++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp @@ -0,0 +1,115 @@ +<%-- +/** + * 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.Collection" + import="java.util.Date" + import="java.util.List" + import="java.io.ByteArrayOutputStream" + import="java.io.PrintStream" + import="java.io.BufferedReader" + import="java.io.InputStreamReader" + import="org.apache.hadoop.conf.Configuration" + import="org.apache.hadoop.hbase.HBaseConfiguration" + import="org.apache.hadoop.hbase.io.hfile.HFilePrettyPrinter" + import="org.apache.hadoop.hbase.regionserver.HRegionServer" + import="org.apache.hadoop.hbase.regionserver.Region" + import="org.apache.hadoop.hbase.regionserver.Store" + import="org.apache.hadoop.hbase.regionserver.StoreFile"%> +<% + String storeFile = request.getParameter("name"); + HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER); + Configuration conf = rs.getConfiguration(); +%> + + + + + + HBase RegionServer: <%= rs.getServerName() %> + + + + + + + + + + + + + + +
+
+ +
+
+<%
+   try {
+     ProcessBuilder pb=new ProcessBuilder("hbase", "hfile", "-s", "-f", storeFile);
+     pb.redirectErrorStream(true);
+     Process pr = pb.start();
+     BufferedReader in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
+     String line;
+     while ((line = in.readLine()) != null) {%>
+       <%= line %>
+     <%}
+     pr.waitFor();
+     in.close();
+   }
+   catch (Exception e) {%>
+     <%= e %>
+   <%}
+%>
+  
+
+ + + + +