This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 712254be0d5 HBASE-27717 Add rsgroup name for dead region servers on 
master UI (#5330)
712254be0d5 is described below

commit 712254be0d56b33d6b54776fc8da4fe1cbe9f602
Author: xieyupei <61450103+xieyu...@users.noreply.github.com>
AuthorDate: Sun Aug 13 18:08:59 2023 +0800

    HBASE-27717 Add rsgroup name for dead region servers on master UI (#5330)
    
    Co-authored-by: xieyupei <xieyu...@meituan.com>
    Signed-off-by: Xiaolin Ha <haxiao...@apache.org>
    Signed-off-by: Duo Zhang <zhang...@apache.org>
---
 .../hbase/tmpl/master/MasterStatusTmpl.jamon       | 27 ++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
index 1fd277fda2a..dd10be45c93 100644
--- 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
+++ 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
@@ -52,6 +52,7 @@ org.apache.hadoop.hbase.master.RegionState;
 org.apache.hadoop.hbase.master.ServerManager;
 org.apache.hadoop.hbase.quotas.QuotaUtil;
 org.apache.hadoop.hbase.rsgroup.RSGroupInfoManager;
+org.apache.hadoop.hbase.rsgroup.RSGroupInfo;
 org.apache.hadoop.hbase.rsgroup.RSGroupUtil;
 org.apache.hadoop.hbase.security.access.PermissionStorage;
 org.apache.hadoop.hbase.security.visibility.VisibilityConstants;
@@ -698,17 +699,35 @@ AssignmentManager assignmentManager = 
master.getAssignmentManager();
         <th></th>
         <th>ServerName</th>
         <th>Stop time</th>
+        <%if !master.isInMaintenanceMode() && 
master.getMasterCoprocessorHost() != null %>
+            <%if RSGroupUtil.isRSGroupEnabled(master.getConfiguration()) %>
+                <th>RSGroup</th>
+            </%if>
+        </%if>
     </tr>
     <%java>
-       DeadServer deadServerUtil = master.getServerManager().getDeadServers();
-       ServerName [] deadServerNames = deadServers.toArray(new 
ServerName[deadServers.size()]);
-         Arrays.sort(deadServerNames);
-         for (ServerName deadServerName: deadServerNames) {
+        RSGroupInfoManager inMgr = null;
+        DeadServer deadServerUtil = master.getServerManager().getDeadServers();
+        ServerName [] deadServerNames = deadServers.toArray(new 
ServerName[deadServers.size()]);
+        Arrays.sort(deadServerNames);
+        if (!master.isInMaintenanceMode() && master.getMasterCoprocessorHost() 
!= null
+            && RSGroupUtil.isRSGroupEnabled(master.getConfiguration())) {
+                inMgr = master.getRSGroupInfoManager();
+        }
+        for (ServerName deadServerName: deadServerNames) {
+            String rsGroupName = null;
+            if (inMgr != null){
+                RSGroupInfo groupInfo = 
inMgr.getRSGroupOfServer(deadServerName.getAddress());
+                rsGroupName = groupInfo == null ? RSGroupInfo.DEFAULT_GROUP : 
groupInfo.getName();
+            }
     </%java>
     <tr>
        <th></th>
         <td><% deadServerName %></td>
         <td><% deadServerUtil.getTimeOfDeath(deadServerName) %></td>
+        <%if rsGroupName != null %>
+            <td><% rsGroupName %></td>
+        </%if>
     </tr>
     <%java>
         }

Reply via email to