Skip to content

Commit

Permalink
HBASE-28191 Meta browser can happen NPE when server or targetServer o…
Browse files Browse the repository at this point in the history
…f region is null (#5508)

Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
  • Loading branch information
guluo2016 authored Nov 8, 2023
1 parent 7af6179 commit 954a1f8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,12 +562,13 @@
final RegionInfo regionInfo = regionReplicaInfo.getRegionInfo();
final ServerName serverName = regionReplicaInfo.getServerName();
final RegionState.State regionState = regionReplicaInfo.getRegionState();
final int rsPort = master.getRegionServerInfoPort(serverName);
final long seqNum = regionReplicaInfo.getSeqNum();
final String regionSpanFormat = "<span title=" + HConstants.CATALOG_FAMILY_STR + ":%s>%s</span>";
final String targetServerName = regionReplicaInfo.getTargetServerName().toString();
final String targetServerName = regionReplicaInfo.getTargetServerName() != null
? regionReplicaInfo.getTargetServerName().toString()
: "";
final Map<String, RegionInfo> mergeRegions = regionReplicaInfo.getMergeRegionInfo();
final String mergeRegionNames = (mergeRegions == null) ? "" :
mergeRegions.entrySet().stream()
Expand All @@ -585,7 +586,7 @@
<td title="endKey"><%= endKeyDisplay %></td>
<td title="replicaId"><%= replicaIdDisplay %></td>
<td title="regionState"><%= regionStateDisplay %></td>
<td title="<%= serverColumnName + "," + startCodeColumnName %>"><%= buildRegionLink(serverName, rsPort, regionInfo, regionState) %></td>
<td title="<%= serverColumnName + "," + startCodeColumnName %>"><%= serverName != null ? buildRegionLink(serverName, master.getRegionServerInfoPort(serverName), regionInfo, regionState) : "" %></td>
<td title="<%= seqNumColumnName %>"><%= seqNum %></td>
<td title="<%= serverNameColumnName %>"><%= targetServerName %></td>
<td><%= mergeRegionNames %></td>
Expand Down

0 comments on commit 954a1f8

Please sign in to comment.