HBASE-10446 Backup master gives Error 500 for debug dump
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1562986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3f9f4e00b6
commit
b3b3d0ddff
|
@ -100,8 +100,14 @@ public class MasterDumpServlet extends StateDumpServlet {
|
|||
|
||||
|
||||
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 StateDumpServlet {
|
|||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
|
|
@ -55,6 +55,11 @@ public abstract class StateDumpServlet extends HttpServlet {
|
|||
|
||||
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, " ");
|
||||
|
|
Loading…
Reference in New Issue