Fixed issue 499 in AsterixDB
diff --git a/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java b/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
index 4bf3da2..538b0a5 100644
--- a/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
+++ b/hyracks/hyracks-control/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
@@ -20,19 +20,24 @@
public class CCDriver {
public static void main(String args[]) throws Exception {
- CCConfig ccConfig = new CCConfig();
- CmdLineParser cp = new CmdLineParser(ccConfig);
try {
- cp.parseArgument(args);
+ CCConfig ccConfig = new CCConfig();
+ CmdLineParser cp = new CmdLineParser(ccConfig);
+ try {
+ cp.parseArgument(args);
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ cp.printUsage(System.err);
+ return;
+ }
+ ClusterControllerService ccService = new ClusterControllerService(ccConfig);
+ ccService.start();
+ while (true) {
+ Thread.sleep(100000);
+ }
} catch (Exception e) {
- System.err.println(e.getMessage());
- cp.printUsage(System.err);
- return;
- }
- ClusterControllerService ccService = new ClusterControllerService(ccConfig);
- ccService.start();
- while (true) {
- Thread.sleep(100000);
+ e.printStackTrace();
+ System.exit(1);
}
}
}
\ No newline at end of file
diff --git a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
index 489f696..422748a 100644
--- a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
+++ b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
@@ -26,34 +26,39 @@
private static final Logger LOGGER = Logger.getLogger(NCDriver.class.getName());
public static void main(String args[]) throws Exception {
- NCConfig ncConfig = new NCConfig();
- CmdLineParser cp = new CmdLineParser(ncConfig);
try {
- cp.parseArgument(args);
- } catch (Exception e) {
- System.err.println(e.getMessage());
- cp.printUsage(System.err);
- return;
- }
-
- final NodeControllerService nService = new NodeControllerService(ncConfig);
- if (LOGGER.isLoggable(Level.INFO)) {
- LOGGER.severe("Setting uncaught exception handler " + LifeCycleComponentManager.INSTANCE);
- }
- Thread.currentThread().setUncaughtExceptionHandler(LifeCycleComponentManager.INSTANCE);
- nService.start();
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- try {
- nService.stop();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ NCConfig ncConfig = new NCConfig();
+ CmdLineParser cp = new CmdLineParser(ncConfig);
+ try {
+ cp.parseArgument(args);
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ cp.printUsage(System.err);
+ return;
}
- });
- while (true) {
- Thread.sleep(10000);
+
+ final NodeControllerService nService = new NodeControllerService(ncConfig);
+ if (LOGGER.isLoggable(Level.INFO)) {
+ LOGGER.severe("Setting uncaught exception handler " + LifeCycleComponentManager.INSTANCE);
+ }
+ Thread.currentThread().setUncaughtExceptionHandler(LifeCycleComponentManager.INSTANCE);
+ nService.start();
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public void run() {
+ try {
+ nService.stop();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ while (true) {
+ Thread.sleep(10000);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
}
}
}
\ No newline at end of file