本文整理了Java中org.apache.storm.utils.Utils.setupDefaultUncaughtExceptionHandler()
方法的一些代码示例,展示了Utils.setupDefaultUncaughtExceptionHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.setupDefaultUncaughtExceptionHandler()
方法的具体详情如下:
包路径:org.apache.storm.utils.Utils
类名称:Utils
方法名:setupDefaultUncaughtExceptionHandler
暂无
代码示例来源:origin: apache/storm
public static void main(String[] args) throws Exception {
Utils.setupDefaultUncaughtExceptionHandler();
launch(new StandaloneINimbus());
}
代码示例来源:origin: apache/storm
public static void main(String[] args) throws Exception {
Preconditions.checkArgument(args.length == 5, "Illegal number of arguments. Expected: 5, Actual: " + args.length);
String stormId = args[0];
String assignmentId = args[1];
String supervisorPort = args[2];
String portStr = args[3];
String workerId = args[4];
Map<String, Object> conf = ConfigUtils.readStormConfig();
Utils.setupDefaultUncaughtExceptionHandler();
StormCommon.validateDistributedMode(conf);
Worker worker = new Worker(conf, null, stormId, assignmentId, Integer.parseInt(supervisorPort),
Integer.parseInt(portStr), workerId);
worker.start();
Utils.addShutdownHookWithForceKillIn1Sec(worker::shutdown);
}
代码示例来源:origin: apache/storm
/**
* supervisor daemon enter entrance.
*
* @param args
*/
public static void main(String[] args) throws Exception {
Utils.setupDefaultUncaughtExceptionHandler();
StormMetricsRegistry metricsRegistry = new StormMetricsRegistry();
@SuppressWarnings("resource")
Supervisor instance = new Supervisor(new StandaloneSupervisor(), metricsRegistry);
instance.launchDaemon();
}
代码示例来源:origin: apache/storm
/**
* Main method to start the server.
*/
public static void main(String [] args) throws Exception {
Utils.setupDefaultUncaughtExceptionHandler();
Map<String, Object> conf = ConfigUtils.readStormConfig();
StormMetricsRegistry metricsRegistry = new StormMetricsRegistry();
try (DRPCServer server = new DRPCServer(conf, metricsRegistry)) {
metricsRegistry.startMetricsReporters(conf);
Utils.addShutdownHookWithForceKillIn1Sec(() -> {
server.meterShutdownCalls.mark();
metricsRegistry.stopMetricsReporters();
server.close();
});
server.start();
server.awaitTermination();
}
}
}
代码示例来源:origin: apache/storm
/**
* Main method to start the server.
*/
public static void main(String [] args) throws Exception {
Utils.setupDefaultUncaughtExceptionHandler();
Map<String, Object> conf = ConfigUtils.readStormConfig();
StormMetricsRegistry metricsRegistry = new StormMetricsRegistry();
String logRoot = ConfigUtils.workerArtifactsRoot(conf);
File logRootDir = new File(logRoot);
logRootDir.mkdirs();
WorkerLogs workerLogs = new WorkerLogs(conf, logRootDir, metricsRegistry);
DirectoryCleaner directoryCleaner = new DirectoryCleaner(metricsRegistry);
try (LogviewerServer server = new LogviewerServer(conf, metricsRegistry);
LogCleaner logCleaner = new LogCleaner(conf, workerLogs, directoryCleaner, logRootDir, metricsRegistry)) {
metricsRegistry.startMetricsReporters(conf);
Utils.addShutdownHookWithForceKillIn1Sec(() -> {
server.meterShutdownCalls.mark();
metricsRegistry.stopMetricsReporters();
server.close();
});
logCleaner.start();
server.start();
server.awaitTermination();
}
}
}
代码示例来源:origin: org.apache.storm/storm-core
/**
* supervisor daemon enter entrance
*
* @param args
*/
public static void main(String[] args) throws Exception {
Utils.setupDefaultUncaughtExceptionHandler();
@SuppressWarnings("resource")
Supervisor instance = new Supervisor(new StandaloneSupervisor());
instance.launchDaemon();
}
}
内容来源于网络,如有侵权,请联系作者删除!