HBASE-13777 Table fragmentation display triggers NPE on master status page

This commit is contained in:
Lars George 2015-05-27 10:22:13 +02:00
parent bb0d64b778
commit 91a5090365
1 changed files with 7 additions and 6 deletions

View File

@ -389,9 +389,10 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
</tr> </tr>
<%for HTableDescriptor htDesc : tables%> <%for HTableDescriptor htDesc : tables%>
<%java> <%java>
TableName tableName = htDesc.getTableName();
Map<RegionState.State, List<HRegionInfo>> tableRegions = Map<RegionState.State, List<HRegionInfo>> tableRegions =
master.getAssignmentManager().getRegionStates() master.getAssignmentManager().getRegionStates()
.getRegionByStateOfTable(htDesc.getTableName()); .getRegionByStateOfTable(tableName);
int openRegionsCount = tableRegions.get(RegionState.State.OPEN).size(); int openRegionsCount = tableRegions.get(RegionState.State.OPEN).size();
int offlineRegionsCount = tableRegions.get(RegionState.State.OFFLINE).size(); int offlineRegionsCount = tableRegions.get(RegionState.State.OFFLINE).size();
int splitRegionsCount = tableRegions.get(RegionState.State.SPLIT).size(); int splitRegionsCount = tableRegions.get(RegionState.State.SPLIT).size();
@ -407,10 +408,10 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
- splitRegionsCount; - splitRegionsCount;
</%java> </%java>
<tr> <tr>
<td><% htDesc.getTableName().getNamespaceAsString() %></td> <td><% tableName.getNamespaceAsString() %></td>
<td><a href=table.jsp?name=<% htDesc.getTableName().getNameAsString() %>><% htDesc.getTableName().getQualifierAsString() %></a> </td> <td><a href=table.jsp?name=<% tableName.getNameAsString() %>><% tableName.getQualifierAsString() %></a> </td>
<%if (frags != null) %> <%if (frags != null) %>
<td align="center"><% frags.get(htDesc.getTableName().getNameAsString()) != null ? frags.get(htDesc.getTableName().getQualifierAsString()).intValue() + "%" : "n/a" %></td> <td align="center"><% frags.get(tableName.getNameAsString()) != null ? frags.get(tableName.getNameAsString()).intValue() + "%" : "n/a" %></td>
</%if> </%if>
<td><% openRegionsCount %></td> <td><% openRegionsCount %></td>
<td><% offlineRegionsCount %></td> <td><% offlineRegionsCount %></td>