HBASE-21232 Show table state in Tables view on Master home page

This commit is contained in:
Michael Stack 2018-09-25 18:08:08 -07:00
parent d7e08317d2
commit 1154f81230
1 changed files with 7 additions and 3 deletions

View File

@ -44,6 +44,7 @@ org.apache.hadoop.hbase.ServerName;
org.apache.hadoop.hbase.TableName;
org.apache.hadoop.hbase.client.Admin;
org.apache.hadoop.hbase.client.MasterSwitchType;
org.apache.hadoop.hbase.client.TableState;
org.apache.hadoop.hbase.master.assignment.AssignmentManager;
org.apache.hadoop.hbase.master.DeadServer;
org.apache.hadoop.hbase.master.HMaster;
@ -464,21 +465,23 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
<table class="table table-striped">
<tr>
<th>Namespace</th>
<th>Table Name</th>
<th>Name</th>
<%if (frags != null) %>
<th title="Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.">Frag.</th>
</%if>
<th>Online Regions</th>
<th>State</th>
<th>Open Regions</th>
<th>Offline Regions</th>
<th>Failed Regions</th>
<th>Split Regions</th>
<th>Other Regions</th>
<th>Other (CLOSED, etc.)</th>
<th>Description</th>
</tr>
<%for TableDescriptor desc : tables%>
<%java>
HTableDescriptor htDesc = new HTableDescriptor(desc);
TableName tableName = htDesc.getTableName();
TableState tableState = master.getTableStateManager().getTableState(tableName);
Map<RegionState.State, List<RegionInfo>> tableRegions =
master.getAssignmentManager().getRegionStates()
.getRegionByStateOfTable(tableName);
@ -502,6 +505,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
<%if (frags != null) %>
<td align="center"><% frags.get(tableName.getNameAsString()) != null ? frags.get(tableName.getNameAsString()).intValue() + "%" : "n/a" %></td>
</%if>
<td><% tableState.getState() %></td>
<td><% openRegionsCount %></td>
<td><% offlineRegionsCount %></td>
<td><% failedRegionsCount %></td>