HBASE-22073 /rits.jsp throws an exception if no procedure

This commit is contained in:
Balazs Meszaros 2019-03-20 13:12:30 +01:00 committed by stack
parent 541f223de4
commit 8bac547559
1 changed files with 14 additions and 4 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.RegionTransitionProcedure"
%>
<%@ 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>
<%
RegionTransitionProcedure 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>
@ -117,4 +127,4 @@
</p>
</div>
</div>
<% } %>
<% } %>