You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2014/06/28 02:31:02 UTC

[16/49] git commit: HBASE-10359 Master/RS WebUI changes for region replicas

HBASE-10359 Master/RS WebUI changes for region replicas

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-10070@1569992 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c1f9b619
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c1f9b619
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c1f9b619

Branch: refs/heads/master
Commit: c1f9b6193dac7650004c4020c428cbf5d9697b8f
Parents: 3d8ee3a
Author: Devaraj Das <dd...@apache.org>
Authored: Wed Feb 19 23:55:30 2014 +0000
Committer: Enis Soztutar <en...@apache.org>
Committed: Fri Jun 27 16:39:37 2014 -0700

----------------------------------------------------------------------
 .../hbase/tmpl/regionserver/RegionListTmpl.jamon   |  3 +++
 .../main/resources/hbase-webapps/master/table.jsp  | 17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c1f9b619/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 c18a8fc..8606b4e 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
@@ -30,6 +30,7 @@
         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.client.RegionReplicaUtil;
 </%import>
 <%if (onlineRegions != null && onlineRegions.size() > 0) %>
 
@@ -87,6 +88,7 @@
             <th>Region Name</th>
             <th>Start Key</th>
             <th>End Key</th>
+            <th>ReplicaID</th>
         </tr>
 
         <%for HRegionInfo r: onlineRegions %>
@@ -94,6 +96,7 @@
             <td><% r.getRegionNameAsString() %></td>
             <td><% Bytes.toStringBinary(r.getStartKey()) %></td>
             <td><% Bytes.toStringBinary(r.getEndKey()) %></td>
+            <td><% r.getReplicaId() %></td>
         </tr>
         </%for>
     </table>

http://git-wip-us.apache.org/repos/asf/hbase/blob/c1f9b619/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
index 1f579e6..4fa0299 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -35,6 +35,7 @@
   import="org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest"
   import="org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState"
   import="org.apache.hadoop.hbase.TableName"
+  import="org.apache.hadoop.hbase.client.RegionReplicaUtil"
   import="org.apache.hadoop.hbase.HBaseConfiguration" %>
 <%
   HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
@@ -42,7 +43,14 @@
   HBaseAdmin hbadmin = new HBaseAdmin(conf);
   String fqtn = request.getParameter("name");
   HTable table = new HTable(conf, fqtn);
-  String tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"><tr><th>Name</th><th>Region Server</th><th>Start Key</th><th>End Key</th><th>Requests</th></tr>";
+  String tableHeader;
+  boolean withReplica = false;
+  if (table.getTableDescriptor().getRegionReplication() > 1) {
+    tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"><tr><th>Name</th><th>Region Server</th><th>Start Key</th><th>End Key</th><th>Requests</th><th>ReplicaID</th></tr>";
+    withReplica = true;
+  } else {
+    tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"><tr><th>Name</th><th>Region Server</th><th>Start Key</th><th>End Key</th><th>Requests</th></tr>";
+  }
   ServerName rl = master.getCatalogTracker().getMetaLocation();
   boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false);
   boolean readOnly = conf.getBoolean("hbase.master.ui.readonly", false);
@@ -293,6 +301,13 @@
   <td><%= escapeXml(Bytes.toStringBinary(regionInfo.getStartKey())) %></td>
   <td><%= escapeXml(Bytes.toStringBinary(regionInfo.getEndKey())) %></td>
   <td><%= req%></td>
+  <%
+  if (withReplica) {
+  %>
+  <td><%= regionInfo.getReplicaId() %></td>
+  <%
+  }
+  %>
 </tr>
 <% } %>
 </table>