hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1562986 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase: master/MasterDumpServlet.java monitoring/StateDumpServlet.java
Date Thu, 30 Jan 2014 21:37:00 GMT
Author: jxiang
Date: Thu Jan 30 21:37:00 2014
New Revision: 1562986

URL: http://svn.apache.org/r1562986
Log:
HBASE-10446 Backup master gives Error 500 for debug dump

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterDumpServlet.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/StateDumpServlet.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterDumpServlet.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterDumpServlet.java?rev=1562986&r1=1562985&r2=1562986&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterDumpServlet.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterDumpServlet.java
Thu Jan 30 21:37:00 2014
@@ -100,8 +100,14 @@ public class MasterDumpServlet extends S
   
 
   private void dumpRIT(HMaster master, PrintWriter out) {
+    AssignmentManager am = master.getAssignmentManager();
+    if (am == null) {
+      out.println("AssignmentManager is not initialized");
+      return;
+    }
+
     Map<String, RegionState> regionsInTransition =
-      master.getAssignmentManager().getRegionStates().getRegionsInTransition();
+      am.getRegionStates().getRegionsInTransition();
     for (Map.Entry<String, RegionState> e : regionsInTransition.entrySet()) {
       String rid = e.getKey();
       RegionState rs = e.getValue();
@@ -110,8 +116,13 @@ public class MasterDumpServlet extends S
   }
 
   private void dumpServers(HMaster master, PrintWriter out) {
-    Map<ServerName, ServerLoad> servers =
-      master.getServerManager().getOnlineServers();
+    ServerManager sm = master.getServerManager();
+    if (sm == null) {
+      out.println("ServerManager is not initialized");
+      return;
+    }
+
+    Map<ServerName, ServerLoad> servers = sm.getOnlineServers();
     for (Map.Entry<ServerName, ServerLoad> e : servers.entrySet()) {
       out.println(e.getKey() + ": " + e.getValue());
     }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/StateDumpServlet.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/StateDumpServlet.java?rev=1562986&r1=1562985&r2=1562986&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/StateDumpServlet.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/StateDumpServlet.java
Thu Jan 30 21:37:00 2014
@@ -55,6 +55,11 @@ public abstract class StateDumpServlet e
 
   protected void dumpExecutors(ExecutorService service, PrintWriter out)
       throws IOException {
+    if (service == null) {
+      out.println("ExecutorService is not initialized");
+      return;
+    }
+
     Map<String, ExecutorStatus> statuses = service.getAllExecutorStatuses();
     for (ExecutorStatus status : statuses.values()) {
       status.dumpTo(out, "  ");



Mime
View raw message