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

svn commit: r1569992 - in /hbase/branches/hbase-10070/hbase-server/src/main: jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon resources/hbase-webapps/master/table.jsp

Author: ddas
Date: Wed Feb 19 23:55:30 2014
New Revision: 1569992

URL: http://svn.apache.org/r1569992
Log:
Master/RS WebUI changes for region replicas

Modified:
    hbase/branches/hbase-10070/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
    hbase/branches/hbase-10070/hbase-server/src/main/resources/hbase-webapps/master/table.jsp

Modified: hbase/branches/hbase-10070/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
URL: http://svn.apache.org/viewvc/hbase/branches/hbase-10070/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon?rev=1569992&r1=1569991&r2=1569992&view=diff
==============================================================================
--- hbase/branches/hbase-10070/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon (original)
+++ hbase/branches/hbase-10070/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon Wed Feb 19 23:55:30 2014
@@ -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>

Modified: hbase/branches/hbase-10070/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
URL: http://svn.apache.org/viewvc/hbase/branches/hbase-10070/hbase-server/src/main/resources/hbase-webapps/master/table.jsp?rev=1569992&r1=1569991&r2=1569992&view=diff
==============================================================================
--- hbase/branches/hbase-10070/hbase-server/src/main/resources/hbase-webapps/master/table.jsp (original)
+++ hbase/branches/hbase-10070/hbase-server/src/main/resources/hbase-webapps/master/table.jsp Wed Feb 19 23:55:30 2014
@@ -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>