HBASE-22133 Forward port HBASE-22073 "/rits.jsp throws an exception if no procedure" to branch-2.2+

Signed-off-by: Guanghao Zhang <zghao@apache.org>
This commit is contained in:
zhangduo 2019-03-30 14:19:51 +08:00 committed by Duo Zhang
parent 49cfecb13d
commit 129d806732
1 changed files with 13 additions and 3 deletions

View File

@ -22,10 +22,11 @@
import="java.util.Collections"
import="java.util.Comparator"
import="java.util.List"
import="java.util.stream.Collectors"
import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.master.assignment.RegionStateNode"
import="org.apache.hadoop.hbase.master.assignment.TransitRegionStateProcedure"
%>
<%@ page import="java.util.stream.Collectors" %>
<%
HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
List<RegionStateNode> rit = master.getAssignmentManager().getRegionsInTransition();
@ -86,8 +87,17 @@
<td><%= regionStateNode.getRegionInfo().getEncodedName() %></td>
<td><%= regionStateNode.getRegionInfo().getTable() %></td>
<td><%= regionStateNode.getState() %></td>
<td><%= regionStateNode.getProcedure().getProcId() %></td>
<td><%= escapeXml(regionStateNode.getProcedure().getState().toString() + (regionStateNode.getProcedure().isBypass() ? "(Bypassed)" : "")) %></td>
<%
TransitRegionStateProcedure procedure = regionStateNode.getProcedure();
if (procedure == null) {
%>
<td></td>
<td></td>
<% } else { %>
<td><%= procedure.getProcId() %></td>
<td><%= escapeXml(procedure.getState().toString() + (procedure.isBypass() ? "(Bypassed)" : "")) %></td>
<% } %>
</tr>
<% } %>
<p><%= rit.size() %> region(s) in transition.</p>