bsglz commented on a change in pull request #1337:
URL: https://github.com/apache/hbase/pull/1337#discussion_r439795738



##########
File path: hbase-server/src/main/resources/hbase-webapps/master/table.jsp
##########
@@ -319,6 +318,52 @@ if (fqtn != null && master.isInitialized()) {
         </tbody>
       </table>
     </div>
+    <div class="tab-pane" id="metaTab_localityStats">
+       <table id="tableRegionTable" class="tablesorter table table-striped">
+         <thead>
+           <tr>
+             <th>Name</th>
+             <th>Region Server</th>
+             <th>Locality</th>
+             <th>LocalityForSsd</th>
+           </tr>
+         </thead>
+         <tbody>
+         <%
+           // NOTE: Presumes meta with one or more replicas
+           for (int j = 0; j < numMetaReplicas; j++) {
+             RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
+                                     RegionInfoBuilder.FIRST_META_REGIONINFO, 
j);
+             ServerName metaLocation = 
MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
+             for (int i = 0; i < 1; i++) {
+               String hostAndPort = "";
+               float locality = 0.0f;
+               float localityForSsd = 0.0f;
+
+               if (metaLocation != null) {
+                 ServerMetrics sl = 
master.getServerManager().getLoad(metaLocation);
+                 hostAndPort = URLEncoder.encode(metaLocation.getHostname()) + 
":" + master.getRegionServerInfoPort(metaLocation);
+                 if (sl != null) {
+                   Map<byte[], RegionMetrics> map = sl.getRegionMetrics();
+                   if (map.containsKey(meta.getRegionName())) {
+                     RegionMetrics load = map.get(meta.getRegionName());
+                     locality = load.getDataLocality();
+                     localityForSsd = load.getDataLocalityForSsd();
+                   }
+                 }
+               }
+             %>
+           <tr>
+             <td><%= escapeXml(meta.getRegionNameAsString()) %></td>

Review comment:
       This part is copyed from exist code, so i think it is better to fix them 
in follow-on issue.




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


Reply via email to