HBASE-27037 Display the region server state on the Web UI (#4432)

Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit db992083af)
This commit is contained in:
litao 2022-06-02 21:19:45 +08:00 committed by Duo Zhang
parent 40c2743a0c
commit b21930f3fa
1 changed files with 6 additions and 1 deletions

View File

@ -97,9 +97,13 @@ Arrays.sort(serverNames);
int totalRegions = 0; int totalRegions = 0;
int totalRequestsPerSecond = 0; int totalRequestsPerSecond = 0;
int inconsistentNodeNum = 0; int inconsistentNodeNum = 0;
String state = "Normal";
String masterVersion = VersionInfo.getVersion(); String masterVersion = VersionInfo.getVersion();
Set<ServerName> decommissionedServers = new HashSet<>(master.listDecommissionedRegionServers());
for (ServerName serverName: serverNames) { for (ServerName serverName: serverNames) {
if (decommissionedServers.contains(serverName)) {
state = "Decommissioned";
}
ServerMetrics sl = master.getServerManager().getLoad(serverName); ServerMetrics sl = master.getServerManager().getLoad(serverName);
String version = master.getRegionServerVersion(serverName); String version = master.getRegionServerVersion(serverName);
if (!masterVersion.equals(version)) { if (!masterVersion.equals(version)) {
@ -134,6 +138,7 @@ Arrays.sort(serverNames);
<tr><td>Total:<% servers.size() %></td> <tr><td>Total:<% servers.size() %></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
<%if inconsistentNodeNum > 0%> <%if inconsistentNodeNum > 0%>
<td style="color:red;"><% inconsistentNodeNum %> nodes with inconsistent version</td> <td style="color:red;"><% inconsistentNodeNum %> nodes with inconsistent version</td>
<%else> <%else>