bsglz commented on a change in pull request #1337:
URL: https://github.com/apache/hbase/pull/1337#discussion_r439795812
##########
File path: hbase-server/src/main/resources/hbase-webapps/master/table.jsp
##########
@@ -910,6 +954,64 @@ if (fqtn != null && master.isInitialized()) {
here</a> to see all regions.</p>
<% } %>
</div>
+ <div class="tab-pane" id="tab_localityStats">
+ <table id="regionServerDetailsTable" class="tablesorter table
table-striped">
+ <thead>
+ <tr>
+ <th>Name(<%= String.format("%,1d", regions.size())%>)</th>
+ <th>Region Server</th>
+ <th>Locality</th>
+ <th>LocalityForSsd</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%
+ numRegionsRendered = 0;
+ for (Map.Entry<RegionInfo, RegionMetrics> hriEntry : entryList) {
+ RegionInfo regionInfo = hriEntry.getKey();
+ ServerName addr = regionsToServer.get(regionInfo);
+ RegionMetrics load = hriEntry.getValue();
+ String urlRegionServer = null;
+ float locality = 0.0f;
+ float localityForSsd = 0.0f;
+ String state = "N/A";
+ if (load != null) {
+ locality = load.getDataLocality();
+ localityForSsd = load.getDataLocalityForSsd();
+ }
+
+ if (addr != null) {
+ // This port might be wrong if RS actually ended up using
something else.
+ urlRegionServer =
+ "//" + URLEncoder.encode(addr.getHostname()) + ":" +
master.getRegionServerInfoPort(addr) + "/rs-status";
+ }
+
+ if (numRegionsRendered < numRegionsToRender) {
+ numRegionsRendered++;
+ %>
+ <tr>
+ <td><%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName()))
%></td>
+ <%
+ if (urlRegionServer != null) {
+ %>
+ <td>
+ <a href="<%= urlRegionServer %>"><%= addr == null? "-":
StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" +
master.getRegionServerInfoPort(addr) %></a>
Review comment:
Ditto.
Thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]