org.apache.storm.utils.Utils.setupDefaultUncaughtExceptionHandler()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(173)

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

Utils.setupDefaultUncaughtExceptionHandler介绍

暂无

代码示例

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

  1. public static void main(String[] args) throws Exception {
  2. Utils.setupDefaultUncaughtExceptionHandler();
  3. launch(new StandaloneINimbus());
  4. }

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

  1. public static void main(String[] args) throws Exception {
  2. Preconditions.checkArgument(args.length == 5, "Illegal number of arguments. Expected: 5, Actual: " + args.length);
  3. String stormId = args[0];
  4. String assignmentId = args[1];
  5. String supervisorPort = args[2];
  6. String portStr = args[3];
  7. String workerId = args[4];
  8. Map<String, Object> conf = ConfigUtils.readStormConfig();
  9. Utils.setupDefaultUncaughtExceptionHandler();
  10. StormCommon.validateDistributedMode(conf);
  11. Worker worker = new Worker(conf, null, stormId, assignmentId, Integer.parseInt(supervisorPort),
  12. Integer.parseInt(portStr), workerId);
  13. worker.start();
  14. Utils.addShutdownHookWithForceKillIn1Sec(worker::shutdown);
  15. }

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

  1. /**
  2. * supervisor daemon enter entrance.
  3. *
  4. * @param args
  5. */
  6. public static void main(String[] args) throws Exception {
  7. Utils.setupDefaultUncaughtExceptionHandler();
  8. StormMetricsRegistry metricsRegistry = new StormMetricsRegistry();
  9. @SuppressWarnings("resource")
  10. Supervisor instance = new Supervisor(new StandaloneSupervisor(), metricsRegistry);
  11. instance.launchDaemon();
  12. }

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

  1. /**
  2. * Main method to start the server.
  3. */
  4. public static void main(String [] args) throws Exception {
  5. Utils.setupDefaultUncaughtExceptionHandler();
  6. Map<String, Object> conf = ConfigUtils.readStormConfig();
  7. StormMetricsRegistry metricsRegistry = new StormMetricsRegistry();
  8. try (DRPCServer server = new DRPCServer(conf, metricsRegistry)) {
  9. metricsRegistry.startMetricsReporters(conf);
  10. Utils.addShutdownHookWithForceKillIn1Sec(() -> {
  11. server.meterShutdownCalls.mark();
  12. metricsRegistry.stopMetricsReporters();
  13. server.close();
  14. });
  15. server.start();
  16. server.awaitTermination();
  17. }
  18. }
  19. }

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

  1. /**
  2. * Main method to start the server.
  3. */
  4. public static void main(String [] args) throws Exception {
  5. Utils.setupDefaultUncaughtExceptionHandler();
  6. Map<String, Object> conf = ConfigUtils.readStormConfig();
  7. StormMetricsRegistry metricsRegistry = new StormMetricsRegistry();
  8. String logRoot = ConfigUtils.workerArtifactsRoot(conf);
  9. File logRootDir = new File(logRoot);
  10. logRootDir.mkdirs();
  11. WorkerLogs workerLogs = new WorkerLogs(conf, logRootDir, metricsRegistry);
  12. DirectoryCleaner directoryCleaner = new DirectoryCleaner(metricsRegistry);
  13. try (LogviewerServer server = new LogviewerServer(conf, metricsRegistry);
  14. LogCleaner logCleaner = new LogCleaner(conf, workerLogs, directoryCleaner, logRootDir, metricsRegistry)) {
  15. metricsRegistry.startMetricsReporters(conf);
  16. Utils.addShutdownHookWithForceKillIn1Sec(() -> {
  17. server.meterShutdownCalls.mark();
  18. metricsRegistry.stopMetricsReporters();
  19. server.close();
  20. });
  21. logCleaner.start();
  22. server.start();
  23. server.awaitTermination();
  24. }
  25. }
  26. }

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

  1. /**
  2. * supervisor daemon enter entrance
  3. *
  4. * @param args
  5. */
  6. public static void main(String[] args) throws Exception {
  7. Utils.setupDefaultUncaughtExceptionHandler();
  8. @SuppressWarnings("resource")
  9. Supervisor instance = new Supervisor(new StandaloneSupervisor());
  10. instance.launchDaemon();
  11. }
  12. }

相关文章

Utils类方法