Skip to content

Commit 712254b

Browse files
xieyupeixieyupei
andauthored
HBASE-27717 Add rsgroup name for dead region servers on master UI (#5330)
Co-authored-by: xieyupei <xieyupei@meituan.com> Signed-off-by: Xiaolin Ha <haxiaolin@apache.org> Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent 00be2a5 commit 712254b

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ org.apache.hadoop.hbase.master.RegionState;
5252
org.apache.hadoop.hbase.master.ServerManager;
5353
org.apache.hadoop.hbase.quotas.QuotaUtil;
5454
org.apache.hadoop.hbase.rsgroup.RSGroupInfoManager;
55+
org.apache.hadoop.hbase.rsgroup.RSGroupInfo;
5556
org.apache.hadoop.hbase.rsgroup.RSGroupUtil;
5657
org.apache.hadoop.hbase.security.access.PermissionStorage;
5758
org.apache.hadoop.hbase.security.visibility.VisibilityConstants;
@@ -698,17 +699,35 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
698699
<th></th>
699700
<th>ServerName</th>
700701
<th>Stop time</th>
702+
<%if !master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null %>
703+
<%if RSGroupUtil.isRSGroupEnabled(master.getConfiguration()) %>
704+
<th>RSGroup</th>
705+
</%if>
706+
</%if>
701707
</tr>
702708
<%java>
703-
DeadServer deadServerUtil = master.getServerManager().getDeadServers();
704-
ServerName [] deadServerNames = deadServers.toArray(new ServerName[deadServers.size()]);
705-
Arrays.sort(deadServerNames);
706-
for (ServerName deadServerName: deadServerNames) {
709+
RSGroupInfoManager inMgr = null;
710+
DeadServer deadServerUtil = master.getServerManager().getDeadServers();
711+
ServerName [] deadServerNames = deadServers.toArray(new ServerName[deadServers.size()]);
712+
Arrays.sort(deadServerNames);
713+
if (!master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null
714+
&& RSGroupUtil.isRSGroupEnabled(master.getConfiguration())) {
715+
inMgr = master.getRSGroupInfoManager();
716+
}
717+
for (ServerName deadServerName: deadServerNames) {
718+
String rsGroupName = null;
719+
if (inMgr != null){
720+
RSGroupInfo groupInfo = inMgr.getRSGroupOfServer(deadServerName.getAddress());
721+
rsGroupName = groupInfo == null ? RSGroupInfo.DEFAULT_GROUP : groupInfo.getName();
722+
}
707723
</%java>
708724
<tr>
709725
<th></th>
710726
<td><% deadServerName %></td>
711727
<td><% deadServerUtil.getTimeOfDeath(deadServerName) %></td>
728+
<%if rsGroupName != null %>
729+
<td><% rsGroupName %></td>
730+
</%if>
712731
</tr>
713732
<%java>
714733
}

0 commit comments

Comments
 (0)