HBASE-27615 Add group of regionServer on Master webUI (#5010)
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
This commit is contained in:
parent
bc8b13e468
commit
0491524eb1
|
@ -35,6 +35,9 @@ HMaster master;
|
||||||
org.apache.hadoop.hbase.util.VersionInfo;
|
org.apache.hadoop.hbase.util.VersionInfo;
|
||||||
org.apache.hadoop.hbase.util.Pair;
|
org.apache.hadoop.hbase.util.Pair;
|
||||||
org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
|
org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
|
||||||
|
org.apache.hadoop.hbase.net.Address;
|
||||||
|
org.apache.hadoop.hbase.rsgroup.RSGroupInfo;
|
||||||
|
org.apache.hadoop.hbase.rsgroup.RSGroupUtil;
|
||||||
</%import>
|
</%import>
|
||||||
|
|
||||||
<%if (servers != null && servers.size() > 0)%>
|
<%if (servers != null && servers.size() > 0)%>
|
||||||
|
@ -91,6 +94,11 @@ Arrays.sort(serverNames);
|
||||||
<th>Version</th>
|
<th>Version</th>
|
||||||
<th>Requests Per Second</th>
|
<th>Requests Per Second</th>
|
||||||
<th>Num. Regions</th>
|
<th>Num. Regions</th>
|
||||||
|
<%if !master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null %>
|
||||||
|
<%if RSGroupUtil.isRSGroupEnabled(master.getConfiguration()) %>
|
||||||
|
<th style="vertical-align: middle;" rowspan="2">RSGroup</th>
|
||||||
|
</%if>
|
||||||
|
</%if>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -101,6 +109,16 @@ Arrays.sort(serverNames);
|
||||||
String state = "Normal";
|
String state = "Normal";
|
||||||
String masterVersion = VersionInfo.getVersion();
|
String masterVersion = VersionInfo.getVersion();
|
||||||
Set<ServerName> decommissionedServers = new HashSet<>(master.listDecommissionedRegionServers());
|
Set<ServerName> decommissionedServers = new HashSet<>(master.listDecommissionedRegionServers());
|
||||||
|
String rsGroupName = "default";
|
||||||
|
List<RSGroupInfo> groups;
|
||||||
|
Map<Address, RSGroupInfo> server2GroupMap = new HashMap<>();
|
||||||
|
if (!master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null
|
||||||
|
&& RSGroupUtil.isRSGroupEnabled(master.getConfiguration())) {
|
||||||
|
groups = master.getRSGroupInfoManager().listRSGroups();
|
||||||
|
groups.forEach(group -> {
|
||||||
|
group.getServers().forEach(address -> server2GroupMap.put(address, group));
|
||||||
|
});
|
||||||
|
}
|
||||||
for (ServerName serverName: serverNames) {
|
for (ServerName serverName: serverNames) {
|
||||||
if (decommissionedServers.contains(serverName)) {
|
if (decommissionedServers.contains(serverName)) {
|
||||||
state = "Decommissioned";
|
state = "Decommissioned";
|
||||||
|
@ -123,6 +141,10 @@ Arrays.sort(serverNames);
|
||||||
lastContact = (System.currentTimeMillis() - sl.getReportTimestamp())/1000;
|
lastContact = (System.currentTimeMillis() - sl.getReportTimestamp())/1000;
|
||||||
}
|
}
|
||||||
long startcode = serverName.getStartcode();
|
long startcode = serverName.getStartcode();
|
||||||
|
if (!master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null
|
||||||
|
&& RSGroupUtil.isRSGroupEnabled(master.getConfiguration())) {
|
||||||
|
rsGroupName = server2GroupMap.get(serverName.getAddress()).getName();
|
||||||
|
}
|
||||||
</%java>
|
</%java>
|
||||||
<tr>
|
<tr>
|
||||||
<td><& serverNameLink; serverName=serverName; &></td>
|
<td><& serverNameLink; serverName=serverName; &></td>
|
||||||
|
@ -132,6 +154,11 @@ Arrays.sort(serverNames);
|
||||||
<td><% version %></td>
|
<td><% version %></td>
|
||||||
<td><% String.format("%,.0f", requestsPerSecond) %></td>
|
<td><% String.format("%,.0f", requestsPerSecond) %></td>
|
||||||
<td><% String.format("%,d", numRegionsOnline) %></td>
|
<td><% String.format("%,d", numRegionsOnline) %></td>
|
||||||
|
<%if !master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null %>
|
||||||
|
<%if RSGroupUtil.isRSGroupEnabled(master.getConfiguration()) %>
|
||||||
|
<td><% rsGroupName %></td>
|
||||||
|
</%if>
|
||||||
|
</%if>
|
||||||
</tr>
|
</tr>
|
||||||
<%java>
|
<%java>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue