org.apache.hadoop.yarn.YarnUncaughtExceptionHandler.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(13.4k)|赞(0)|评价(0)|浏览(84)

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

YarnUncaughtExceptionHandler.<init>介绍

暂无

代码示例

代码示例来源:origin: Qihoo360/XLearning

static JobHistoryServer launchJobHistoryServer(String[] args) {
 Thread.
   setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(JobHistoryServer.class, args, LOG);
 JobHistoryServer jobHistoryServer = null;
 try {
  jobHistoryServer = new JobHistoryServer();
  ShutdownHookManager.get().addShutdownHook(
    new CompositeServiceShutdownHook(jobHistoryServer),
    SHUTDOWN_HOOK_PRIORITY);
  YarnConfiguration conf = new YarnConfiguration(new JobConf());
  new GenericOptionsParser(conf, args);
  jobHistoryServer.init(conf);
  jobHistoryServer.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting JobHistoryServer", t);
  ExitUtil.terminate(-1, "Error starting JobHistoryServer");
 }
 return jobHistoryServer;
}

代码示例来源:origin: org.apache.slider/slider-core

/**
 * The real main function, which takes the arguments as a list
 * arg 0 must be the service classname
 * @param argsList the list of arguments
 */
public static void serviceMain(List<String> argsList) {
 if (argsList.isEmpty()) {
  exitWithMessage(EXIT_USAGE, USAGE_MESSAGE);
 } else {
  String serviceClassName = argsList.get(0);
  if (LOG.isDebugEnabled()) {
   LOG.debug(startupShutdownMessage(serviceClassName, argsList));
   StringBuilder builder = new StringBuilder();
   for (String arg : argsList) {
    builder.append('"').append(arg).append("\" ");
   }
   LOG.debug(builder.toString());
  }
  Thread.setDefaultUncaughtExceptionHandler(
   new YarnUncaughtExceptionHandler());
  ServiceLauncher serviceLauncher = new ServiceLauncher<>(serviceClassName);
  serviceLauncher.launchServiceAndExit(argsList);
 }
}

代码示例来源: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: com.github.jiayuhan-it/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: 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: io.hops/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: org.apache.hadoop/hadoop-yarn-server-web-proxy

public static void main(String[] args) {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG);
 try {
  YarnConfiguration configuration = new YarnConfiguration();
  new GenericOptionsParser(configuration, args);
  WebAppProxyServer proxyServer = startServer(configuration);
  proxyServer.proxy.join();
 } catch (Throwable t) {
  ExitUtil.terminate(-1, t);
 }
}

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

public static void main(String[] args) {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG);
 try {
  YarnConfiguration configuration = new YarnConfiguration();
  new GenericOptionsParser(configuration, args);
  WebAppProxyServer proxyServer = startServer(configuration);
  proxyServer.proxy.join();
 } catch (Throwable t) {
  ExitUtil.terminate(-1, t);
 }
}

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

public static void main(String[] args) {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG);
 try {
  YarnConfiguration configuration = new YarnConfiguration();
  new GenericOptionsParser(configuration, args);
  WebAppProxyServer proxyServer = startServer(configuration);
  proxyServer.proxy.join();
 } catch (Throwable t) {
  ExitUtil.terminate(-1, t);
 }
}

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

public static void main(String[] args) {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG);
 try {
  YarnConfiguration configuration = new YarnConfiguration();
  new GenericOptionsParser(configuration, args);
  WebAppProxyServer proxyServer = startServer(configuration);
  proxyServer.proxy.join();
 } catch (Throwable t) {
  ExitUtil.terminate(-1, t);
 }
}

代码示例来源:origin: io.hops/hadoop-mapreduce-client-hs

static JobHistoryServer launchJobHistoryServer(String[] args) {
 Thread.
   setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(JobHistoryServer.class, args, LOG);
 JobHistoryServer jobHistoryServer = null;
 try {
  jobHistoryServer = new JobHistoryServer();
  ShutdownHookManager.get().addShutdownHook(
    new CompositeServiceShutdownHook(jobHistoryServer),
    SHUTDOWN_HOOK_PRIORITY);
  YarnConfiguration conf = new YarnConfiguration(new JobConf());
  new GenericOptionsParser(conf, args);
  jobHistoryServer.init(conf);
  jobHistoryServer.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting JobHistoryServer", t);
  ExitUtil.terminate(-1, "Error starting JobHistoryServer");
 }
 return jobHistoryServer;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-hs

static JobHistoryServer launchJobHistoryServer(String[] args) {
 Thread.
   setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(JobHistoryServer.class, args, LOG);
 JobHistoryServer jobHistoryServer = null;
 try {
  jobHistoryServer = new JobHistoryServer();
  ShutdownHookManager.get().addShutdownHook(
    new CompositeServiceShutdownHook(jobHistoryServer),
    SHUTDOWN_HOOK_PRIORITY);
  YarnConfiguration conf = new YarnConfiguration(new JobConf());
  new GenericOptionsParser(conf, args);
  jobHistoryServer.init(conf);
  jobHistoryServer.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting JobHistoryServer", t);
  ExitUtil.terminate(-1, "Error starting JobHistoryServer");
 }
 return jobHistoryServer;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-hs

static JobHistoryServer launchJobHistoryServer(String[] args) {
 Thread.
   setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(JobHistoryServer.class, args, LOG);
 JobHistoryServer jobHistoryServer = null;
 try {
  jobHistoryServer = new JobHistoryServer();
  ShutdownHookManager.get().addShutdownHook(
    new CompositeServiceShutdownHook(jobHistoryServer),
    SHUTDOWN_HOOK_PRIORITY);
  YarnConfiguration conf = new YarnConfiguration(new JobConf());
  new GenericOptionsParser(conf, args);
  jobHistoryServer.init(conf);
  jobHistoryServer.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting JobHistoryServer", t);
  ExitUtil.terminate(-1, "Error starting JobHistoryServer");
 }
 return jobHistoryServer;
}

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

/**
 * Launch the server.
 * @param conf configuration
 * @param rdns registry dns instance
 * @return
 */
static RegistryDNSServer launchDNSServer(Configuration conf,
  RegistryDNS rdns) {
 RegistryDNSServer dnsServer = null;
 Thread
   .setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 try {
  dnsServer = new RegistryDNSServer("RegistryDNSServer", rdns);
  ShutdownHookManager.get().addShutdownHook(
    new CompositeService.CompositeServiceShutdownHook(dnsServer),
    SHUTDOWN_HOOK_PRIORITY);
  dnsServer.init(conf);
  dnsServer.start();
 } catch (Throwable t) {
  LOG.error("Error starting Registry DNS Server", t);
  ExitUtil.terminate(-1, "Error starting Registry DNS Server");
 }
 return dnsServer;
}

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

public static void main(String[] argv) {
  Configuration conf = new YarnConfiguration();
  Thread
    .setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
  StringUtils.startupShutdownMessage(Router.class, argv, LOG);
  Router router = new Router();
  try {

   // Remove the old hook if we are rebooting.
   if (null != routerShutdownHook) {
    ShutdownHookManager.get().removeShutdownHook(routerShutdownHook);
   }

   routerShutdownHook = new CompositeServiceShutdownHook(router);
   ShutdownHookManager.get().addShutdownHook(routerShutdownHook,
     SHUTDOWN_HOOK_PRIORITY);

   router.init(conf);
   router.start();
  } catch (Throwable t) {
   LOG.error("Error starting Router", t);
   System.exit(-1);
  }
 }
}

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

public static void main(String argv[]) {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(ResourceManager.class, argv, LOG);
 try {
  Configuration conf = new YarnConfiguration();
  GenericOptionsParser hParser = new GenericOptionsParser(conf, argv);
  argv = hParser.getRemainingArgs();
  // If -format-state-store, then delete RMStateStore; else startup normally
  if (argv.length == 1 && argv[0].equals("-format-state-store")) {
   deleteRMStateStore(conf);
  } else {
   ResourceManager resourceManager = new ResourceManager();
   ShutdownHookManager.get().addShutdownHook(
    new CompositeServiceShutdownHook(resourceManager),
    SHUTDOWN_HOOK_PRIORITY);
   resourceManager.init(conf);
   resourceManager.start();
  }
 } catch (Throwable t) {
  LOG.fatal("Error starting ResourceManager", t);
  System.exit(-1);
 }
}

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

public static void main(String argv[]) {
 Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(ResourceManager.class, argv, LOG);
 try {
  Configuration conf = new YarnConfiguration();
  GenericOptionsParser hParser = new GenericOptionsParser(conf, argv);
  argv = hParser.getRemainingArgs();
  // If -format-state-store, then delete RMStateStore; else startup normally
  if (argv.length == 1 && argv[0].equals("-format-state-store")) {
   deleteRMStateStore(conf);
  } else {
   ResourceManager resourceManager = new ResourceManager();
   ShutdownHookManager.get().addShutdownHook(
    new CompositeServiceShutdownHook(resourceManager),
    SHUTDOWN_HOOK_PRIORITY);
   resourceManager.init(conf);
   resourceManager.start();
  }
 } catch (Throwable t) {
  LOG.fatal("Error starting ResourceManager", t);
  System.exit(-1);
 }
}

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

static ApplicationHistoryServer launchAppHistoryServer(String[] args) {
 Thread
  .setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(ApplicationHistoryServer.class, args,
  LOG);
 ApplicationHistoryServer appHistoryServer = null;
 try {
  appHistoryServer = new ApplicationHistoryServer();
  ShutdownHookManager.get().addShutdownHook(
   new CompositeServiceShutdownHook(appHistoryServer),
   SHUTDOWN_HOOK_PRIORITY);
  YarnConfiguration conf = new YarnConfiguration();
  new GenericOptionsParser(conf, args);
  appHistoryServer.init(conf);
  appHistoryServer.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting ApplicationHistoryServer", t);
  ExitUtil.terminate(-1, "Error starting ApplicationHistoryServer");
 }
 return appHistoryServer;
}

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

static ApplicationHistoryServer launchAppHistoryServer(String[] args) {
 Thread
  .setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(ApplicationHistoryServer.class, args,
  LOG);
 ApplicationHistoryServer appHistoryServer = null;
 try {
  appHistoryServer = new ApplicationHistoryServer();
  ShutdownHookManager.get().addShutdownHook(
   new CompositeServiceShutdownHook(appHistoryServer),
   SHUTDOWN_HOOK_PRIORITY);
  YarnConfiguration conf = new YarnConfiguration();
  new GenericOptionsParser(conf, args);
  appHistoryServer.init(conf);
  appHistoryServer.start();
 } catch (Throwable t) {
  LOG.fatal("Error starting ApplicationHistoryServer", t);
  ExitUtil.terminate(-1, "Error starting ApplicationHistoryServer");
 }
 return appHistoryServer;
}

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

static ApplicationHistoryServer launchAppHistoryServer(String[] args) {
 Thread
  .setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
 StringUtils.startupShutdownMessage(ApplicationHistoryServer.class, args,
  LOG);
 ApplicationHistoryServer appHistoryServer = null;
 try {
  appHistoryServer = new ApplicationHistoryServer();
  ShutdownHookManager.get().addShutdownHook(
   new CompositeServiceShutdownHook(appHistoryServer),
   SHUTDOWN_HOOK_PRIORITY);
  YarnConfiguration conf = new YarnConfiguration();
  new GenericOptionsParser(conf, args);
  appHistoryServer.init(conf);
  appHistoryServer.start();
 } catch (Throwable t) {
  LOG.error("Error starting ApplicationHistoryServer", t);
  ExitUtil.terminate(-1, "Error starting ApplicationHistoryServer");
 }
 return appHistoryServer;
}

相关文章

微信公众号

最新文章

更多