|
@@ -40,6 +40,7 @@ import org.apache.hadoop.security.SecurityUtil;
|
|
import org.apache.hadoop.service.CompositeService;
|
|
import org.apache.hadoop.service.CompositeService;
|
|
import org.apache.hadoop.util.ExitUtil;
|
|
import org.apache.hadoop.util.ExitUtil;
|
|
import org.apache.hadoop.util.GenericOptionsParser;
|
|
import org.apache.hadoop.util.GenericOptionsParser;
|
|
|
|
+import org.apache.hadoop.util.JvmPauseMonitor;
|
|
import org.apache.hadoop.util.NodeHealthScriptRunner;
|
|
import org.apache.hadoop.util.NodeHealthScriptRunner;
|
|
import org.apache.hadoop.util.ReflectionUtils;
|
|
import org.apache.hadoop.util.ReflectionUtils;
|
|
import org.apache.hadoop.util.ShutdownHookManager;
|
|
import org.apache.hadoop.util.ShutdownHookManager;
|
|
@@ -83,6 +84,7 @@ public class NodeManager extends CompositeService
|
|
private static final Log LOG = LogFactory.getLog(NodeManager.class);
|
|
private static final Log LOG = LogFactory.getLog(NodeManager.class);
|
|
private static long nmStartupTime = System.currentTimeMillis();
|
|
private static long nmStartupTime = System.currentTimeMillis();
|
|
protected final NodeManagerMetrics metrics = NodeManagerMetrics.create();
|
|
protected final NodeManagerMetrics metrics = NodeManagerMetrics.create();
|
|
|
|
+ private JvmPauseMonitor pauseMonitor;
|
|
private ApplicationACLsManager aclsManager;
|
|
private ApplicationACLsManager aclsManager;
|
|
private NodeHealthCheckerService nodeHealthChecker;
|
|
private NodeHealthCheckerService nodeHealthChecker;
|
|
private NodeLabelsProvider nodeLabelsProvider;
|
|
private NodeLabelsProvider nodeLabelsProvider;
|
|
@@ -307,13 +309,16 @@ public class NodeManager extends CompositeService
|
|
dispatcher.register(ContainerManagerEventType.class, containerManager);
|
|
dispatcher.register(ContainerManagerEventType.class, containerManager);
|
|
dispatcher.register(NodeManagerEventType.class, this);
|
|
dispatcher.register(NodeManagerEventType.class, this);
|
|
addService(dispatcher);
|
|
addService(dispatcher);
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ pauseMonitor = new JvmPauseMonitor(conf);
|
|
|
|
+ metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
|
|
|
|
+
|
|
DefaultMetricsSystem.initialize("NodeManager");
|
|
DefaultMetricsSystem.initialize("NodeManager");
|
|
|
|
|
|
// StatusUpdater should be added last so that it get started last
|
|
// StatusUpdater should be added last so that it get started last
|
|
// so that we make sure everything is up before registering with RM.
|
|
// so that we make sure everything is up before registering with RM.
|
|
addService(nodeStatusUpdater);
|
|
addService(nodeStatusUpdater);
|
|
-
|
|
|
|
|
|
+
|
|
super.serviceInit(conf);
|
|
super.serviceInit(conf);
|
|
// TODO add local dirs to del
|
|
// TODO add local dirs to del
|
|
}
|
|
}
|
|
@@ -325,6 +330,7 @@ public class NodeManager extends CompositeService
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
throw new YarnRuntimeException("Failed NodeManager login", e);
|
|
throw new YarnRuntimeException("Failed NodeManager login", e);
|
|
}
|
|
}
|
|
|
|
+ pauseMonitor.start();
|
|
super.serviceStart();
|
|
super.serviceStart();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -336,6 +342,9 @@ public class NodeManager extends CompositeService
|
|
try {
|
|
try {
|
|
super.serviceStop();
|
|
super.serviceStop();
|
|
DefaultMetricsSystem.shutdown();
|
|
DefaultMetricsSystem.shutdown();
|
|
|
|
+ if (pauseMonitor != null) {
|
|
|
|
+ pauseMonitor.stop();
|
|
|
|
+ }
|
|
} finally {
|
|
} finally {
|
|
// YARN-3641: NM's services stop get failed shouldn't block the
|
|
// YARN-3641: NM's services stop get failed shouldn't block the
|
|
// release of NMLevelDBStore.
|
|
// release of NMLevelDBStore.
|