diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusServlet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusServlet.java index e46621d7b521..09bb5375a5d5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusServlet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusServlet.java @@ -77,7 +77,10 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro private ServerName getMetaLocationOrNull(HMaster master) { RegionStateNode rsn = master.getAssignmentManager().getRegionStates() .getRegionStateNode(RegionInfoBuilder.FIRST_META_REGIONINFO); - return rsn.isInState(RegionState.State.OPEN) ? rsn.getRegionLocation() : null; + if (rsn != null) { + return rsn.isInState(RegionState.State.OPEN) ? rsn.getRegionLocation() : null; + } + return null; } private Map getFragmentationInfo(HMaster master, Configuration conf) diff --git a/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp b/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp index 0ac2ff3908d3..c25c5c3886ba 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp @@ -47,8 +47,28 @@ <%@ page import="org.apache.hadoop.hbase.metrics.Histogram" %> <%@ page import="java.util.TreeMap" %> <%@ page import="org.apache.hadoop.hbase.metrics.impl.HistogramImpl" %> + + + + + <% HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER); + if (!master.isInitialized()) { +%> +
+
+ +
+


+ +

+<% return; + } %> + +<% ProcedureExecutor procExecutor = master.getMasterProcedureExecutor(); List> procedures = procExecutor.getProcedures(); Collections.sort(procedures, new Comparator() { @@ -63,9 +83,6 @@ List lockedResources = master.getLocks(); pageContext.setAttribute("pageTitle", "HBase Master Procedures: " + master.getServerName()); %> - - -
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp index c516d035aacf..f44b00301ac4 100644 --- a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp @@ -33,8 +33,10 @@ String regionName = request.getParameter("name"); HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER); FileSystem fs = rs.getFileSystem(); - - HRegion region = rs.getRegion(regionName); + HRegion region = null; + if (regionName != null) { + region = rs.getRegion(regionName); + } String displayName; boolean isReplicaRegion = false; if (region != null) { @@ -42,7 +44,11 @@ rs.getConfiguration()); isReplicaRegion = region.getRegionInfo().getReplicaId() > RegionInfo.DEFAULT_REPLICA_ID; } else { - displayName = "region {" + regionName + "} is not currently online on this region server"; + if (regionName != null) { + displayName = "region {" + regionName + "} is not currently online on this region server"; + } else { + displayName = "you must specify a region name when accessing this page"; + } } pageContext.setAttribute("pageTitle", "HBase RegionServer: " + rs.getServerName()); %>