Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-27717 Add rsgroup name for dead region servers on master UI #5330

Merged
merged 2 commits into from
Aug 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -698,17 +699,37 @@ 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 = "default";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSGroupInfo.DEFAULT_GROUP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great,thank you

if (inMgr != null){
RSGroupInfo groupInfo = inMgr.getRSGroupOfServer(deadServerName.getAddress());
rsGroupName = (groupInfo == null ? "default" : groupInfo.getName());
}
</%java>
<tr>
<th></th>
<td><% deadServerName %></td>
<td><% deadServerUtil.getTimeOfDeath(deadServerName) %></td>
<%if !master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the rsGroupName be null as default, and here use condition if(rsGroupName!=null)

<%if RSGroupUtil.isRSGroupEnabled(master.getConfiguration()) %>
<td><% rsGroupName %></td>
</%if>
</%if>
</tr>
<%java>
}
Expand Down