org.apache.hadoop.yarn.server.nodemanager.NodeManager类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中org.apache.hadoop.yarn.server.nodemanager.NodeManager类的一些代码示例,展示了NodeManager类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NodeManager类的具体详情如下:
包路径:org.apache.hadoop.yarn.server.nodemanager.NodeManager
类名称:NodeManager

NodeManager介绍

暂无

代码示例

代码示例来源:origin: apache/metron

private int verifyContainerLog(int containerNum,
                List<String> expectedContent, boolean count, String expectedWord) {
 File logFolder =
     new File(yarnComponent.getYARNCluster().getNodeManager(0).getConfig()
         .get(YarnConfiguration.NM_LOG_DIRS,
             YarnConfiguration.DEFAULT_NM_LOG_DIRS));

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

NodeManager createNewNodeManager() {
 return new NodeManager();
}

代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager

private void createCRLFetcherService(Configuration conf) {
 if (conf.getBoolean(CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED,
   CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED_DEFAULT)) {
  if (conf.getBoolean(CommonConfigurationKeysPublic.HOPS_CRL_VALIDATION_ENABLED_KEY,
    CommonConfigurationKeysPublic.HOPS_CRL_VALIDATION_ENABLED_DEFAULT)) {
   LOG.info("Creating CertificateRevocationList Fetcher service");
   revocationListFetcherService = new RevocationListFetcherService();
   addService(revocationListFetcherService);
  } else {
   LOG.warn("RPC TLS is enabled but CRL validation is disabled");
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

initAndStartRecoveryStore(conf);
} catch (IOException e) {
 String recoveryDirName = conf.get(YarnConfiguration.NM_RECOVERY_DIR);
recoverTokens(nmTokenSecretManager, containerTokenSecretManager);
this.context = createNMContext(containerTokenSecretManager,
  nmTokenSecretManager, nmStore, isDistSchedulingEnabled, conf);
ResourcePluginManager pluginManager = createResourcePluginManager();
pluginManager.initialize(context);
((NMContext)context).setResourcePluginManager(pluginManager);
ContainerExecutor exec = createContainerExecutor(conf);
try {
 exec.init(context);
DeletionService del = createDeletionService(exec);
addService(del);
this.dispatcher = createNMDispatcher();
    getNodeHealthScriptRunner(conf), dirsHandler);
addService(nodeHealthChecker);
  createNodeStatusUpdater(context, dispatcher, nodeHealthChecker);
nodeLabelsProvider = createNodeLabelsProvider(conf);
if (nodeLabelsProvider != null) {

代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager

initAndStartRecoveryStore(conf);
createCRLFetcherService(conf);
recoverTokens(nmTokenSecretManager, containerTokenSecretManager);
DeletionService del = createDeletionService(exec);
addService(del);
nodeHealthChecker =
  new NodeHealthCheckerService(
    getNodeHealthScriptRunner(conf), dirsHandler);
addService(nodeHealthChecker);
this.context = createNMContext(containerTokenSecretManager,
  nmTokenSecretManager, nmStore);
nodeLabelsProvider = createNodeLabelsProvider(conf);
   createNodeStatusUpdater(context, dispatcher, nodeHealthChecker);
} else {
 addIfService(nodeLabelsProvider);
 nodeStatusUpdater =
   createNodeStatusUpdater(context, dispatcher, nodeHealthChecker,
     nodeLabelsProvider);
nodeResourceMonitor = createNodeResourceMonitor();
addService(nodeResourceMonitor);
((NMContext) context).setNodeResourceMonitor(nodeResourceMonitor);

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

initAndStartRecoveryStore(conf);
recoverTokens(nmTokenSecretManager, containerTokenSecretManager);
DeletionService del = createDeletionService(exec);
addService(del);
addService(nodeHealthChecker);
dirsHandler = nodeHealthChecker.getDiskHandler();
this.context = createNMContext(containerTokenSecretManager,
  nmTokenSecretManager, nmStore);
  createNodeStatusUpdater(context, dispatcher, nodeHealthChecker);
NodeResourceMonitor nodeResourceMonitor = createNodeResourceMonitor();
addService(nodeResourceMonitor);
  createContainerManager(context, exec, del, nodeStatusUpdater,
  this.aclsManager, dirsHandler);
addService(containerManager);
((NMContext) context).setContainerManager(containerManager);
WebServer webServer = createWebServer(context, containerManager
  .getContainersMonitor(), this.aclsManager, dirsHandler);
addService(webServer);
((NMContext) context).setWebServer(webServer);
addService(dispatcher);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

private void initAndStartNodeManager(Configuration conf, boolean hasToReboot) {
 try {
  // Remove the old hook if we are rebooting.
  if (hasToReboot && null != nodeManagerShutdownHook) {
   ShutdownHookManager.get().removeShutdownHook(nodeManagerShutdownHook);
  }
  nodeManagerShutdownHook = new CompositeServiceShutdownHook(this);
  ShutdownHookManager.get().addShutdownHook(nodeManagerShutdownHook,
                       SHUTDOWN_HOOK_PRIORITY);
  // System exit should be called only when NodeManager is instantiated from
  // main() funtion
  this.shouldExitOnShutdownEvent = true;
  this.init(conf);
  this.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting NodeManager", t);
  System.exit(-1);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

public static void main(String[] args) throws IOException {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(NodeManager.class, args, LOG);
 NodeManager nodeManager = new NodeManager();
 Configuration conf = new YarnConfiguration();
 new GenericOptionsParser(conf, args);
 nodeManager.initAndStartNodeManager(conf, false);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

@Override
 public void run() {
  try {
   NodeManager.this.stop();
  } catch (Throwable t) {
   LOG.error("Error while shutting down NodeManager", t);
  } finally {
   if (shouldExitOnShutdownEvent
     && !ShutdownHookManager.get().isShutdownInProgress()) {
    ExitUtil.terminate(-1);
   }
  }
 }
}.start();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-tests

+ nm.getConfig().get(dirsProperty));
dirsHandler = nm.getNodeHealthChecker().getDiskHandler();
List<String> list = localORLogDirs ? dirsHandler.getLocalDirs()
                  : dirsHandler.getLogDirs();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-tests

protected synchronized void serviceStart() throws Exception {
 nodeManagers[index].start();
 if (nodeManagers[index].getServiceState() != STATE.STARTED) {
  // NM could have failed.
  throw new IOException("NodeManager " + index + " failed to start");
 }
 super.serviceStart();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-tests

nodeManagers[index].init(config);
super.serviceInit(config);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

initAndStartRecoveryStore(conf);
recoverTokens(nmTokenSecretManager, containerTokenSecretManager);
DeletionService del = createDeletionService(exec);
addService(del);
addService(nodeHealthChecker);
dirsHandler = nodeHealthChecker.getDiskHandler();
this.context = createNMContext(containerTokenSecretManager,
  nmTokenSecretManager, nmStore);
  createNodeStatusUpdater(context, dispatcher, nodeHealthChecker);
NodeResourceMonitor nodeResourceMonitor = createNodeResourceMonitor();
addService(nodeResourceMonitor);
  createContainerManager(context, exec, del, nodeStatusUpdater,
  this.aclsManager, dirsHandler);
addService(containerManager);
((NMContext) context).setContainerManager(containerManager);
WebServer webServer = createWebServer(context, containerManager
  .getContainersMonitor(), this.aclsManager, dirsHandler);
addService(webServer);
((NMContext) context).setWebServer(webServer);
addService(dispatcher);

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

private void initAndStartNodeManager(Configuration conf, boolean hasToReboot) {
 try {
  // Remove the old hook if we are rebooting.
  if (hasToReboot && null != nodeManagerShutdownHook) {
   ShutdownHookManager.get().removeShutdownHook(nodeManagerShutdownHook);
  }
  nodeManagerShutdownHook = new CompositeServiceShutdownHook(this);
  ShutdownHookManager.get().addShutdownHook(nodeManagerShutdownHook,
                       SHUTDOWN_HOOK_PRIORITY);
  // System exit should be called only when NodeManager is instantiated from
  // main() funtion
  this.shouldExitOnShutdownEvent = true;
  this.init(conf);
  this.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting NodeManager", t);
  System.exit(-1);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

public static void main(String[] args) throws IOException {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(NodeManager.class, args, LOG);
 @SuppressWarnings("resource")
 NodeManager nodeManager = new NodeManager();
 Configuration conf = new YarnConfiguration();
 new GenericOptionsParser(conf, args);
 nodeManager.initAndStartNodeManager(conf, false);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

@Override
 public void run() {
  try {
   NodeManager.this.stop();
  } catch (Throwable t) {
   LOG.error("Error while shutting down NodeManager", t);
  } finally {
   if (shouldExitOnShutdownEvent
     && !ShutdownHookManager.get().isShutdownInProgress()) {
    ExitUtil.terminate(-1);
   }
  }
 }
}.start();

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-tests

+ nm.getConfig().get(dirsProperty));
dirsHandler = nm.getNodeHealthChecker().getDiskHandler();
List<String> list = localORLogDirs ? dirsHandler.getLocalDirs()
                  : dirsHandler.getLogDirs();

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-tests

protected synchronized void serviceStart() throws Exception {
 nodeManagers[index].start();
 if (nodeManagers[index].getServiceState() != STATE.STARTED) {
  // NM could have failed.
  throw new IOException("NodeManager " + index + " failed to start");
 }
 super.serviceStart();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-tests

nodeManagers[index].init(config);
super.serviceInit(config);

代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager

protected NMContext createNMContext(
  NMContainerTokenSecretManager containerTokenSecretManager,
  NMTokenSecretManagerInNM nmTokenSecretManager,
  NMStateStoreService stateStore) {
 boolean isSSLEnabled = getConfig().getBoolean
   (CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED,
     CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED_DEFAULT);
 return new NMContext(containerTokenSecretManager, nmTokenSecretManager,
   dirsHandler, aclsManager, stateStore, isSSLEnabled);
}

相关文章