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
This commit is contained in:
Devaraj Das 2014-02-19 23:55:30 +00:00 committed by Enis Soztutar
parent 3d8ee3a06e
commit c1f9b6193d
2 changed files with 19 additions and 1 deletions

View File

@ -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>

View File

@ -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>