HBASE-13777 Table fragmentation display triggers NPE on master status page
This commit is contained in:
parent
bb0d64b778
commit
91a5090365
|
@ -215,7 +215,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
|
|||
<section>
|
||||
<& BackupMasterStatusTmpl; master = master &>
|
||||
</section>
|
||||
</%if>
|
||||
</%if>
|
||||
|
||||
|
||||
<section>
|
||||
|
@ -367,7 +367,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
|
|||
|
||||
<%def userTables>
|
||||
<%java>
|
||||
HTableDescriptor[] tables = null;
|
||||
HTableDescriptor[] tables = null;
|
||||
try (Admin admin = master.getConnection().getAdmin()) {
|
||||
tables = master.isInitialized() ? admin.listTables() : null;
|
||||
}
|
||||
|
@ -389,9 +389,10 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
|
|||
</tr>
|
||||
<%for HTableDescriptor htDesc : tables%>
|
||||
<%java>
|
||||
TableName tableName = htDesc.getTableName();
|
||||
Map<RegionState.State, List<HRegionInfo>> tableRegions =
|
||||
master.getAssignmentManager().getRegionStates()
|
||||
.getRegionByStateOfTable(htDesc.getTableName());
|
||||
.getRegionByStateOfTable(tableName);
|
||||
int openRegionsCount = tableRegions.get(RegionState.State.OPEN).size();
|
||||
int offlineRegionsCount = tableRegions.get(RegionState.State.OFFLINE).size();
|
||||
int splitRegionsCount = tableRegions.get(RegionState.State.SPLIT).size();
|
||||
|
@ -407,10 +408,10 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
|
|||
- splitRegionsCount;
|
||||
</%java>
|
||||
<tr>
|
||||
<td><% htDesc.getTableName().getNamespaceAsString() %></td>
|
||||
<td><a href=table.jsp?name=<% htDesc.getTableName().getNameAsString() %>><% htDesc.getTableName().getQualifierAsString() %></a> </td>
|
||||
<td><% tableName.getNamespaceAsString() %></td>
|
||||
<td><a href=table.jsp?name=<% tableName.getNameAsString() %>><% tableName.getQualifierAsString() %></a> </td>
|
||||
<%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>
|
||||
<td><% openRegionsCount %></td>
|
||||
<td><% offlineRegionsCount %></td>
|
||||
|
|
Loading…
Reference in New Issue