add main method to AsterixHyracksIntegrationUtil
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
index 236df53..8b64b18 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -38,12 +38,12 @@
public static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098;
public static final int DEFAULT_HYRACKS_CC_CLUSTER_PORT = 1099;
-
+
private static ClusterControllerService cc;
private static NodeControllerService nc1;
private static NodeControllerService nc2;
private static IHyracksClientConnection hcc;
-
+
public static void init() throws Exception {
CCConfig ccConfig = new CCConfig();
ccConfig.clusterNetIpAddress = "127.0.0.1";
@@ -107,5 +107,36 @@
GlobalConfig.ASTERIX_LOGGER.info(jobId.toString());
hcc.waitForCompletion(jobId);
}
+
+ /**
+ * main method to run a simple 2 node cluster in-process
+ *
+ * suggested VM arguments:
+ * <code>-enableassertions -Xmx2048m -Dfile.encoding=UTF-8</code>
+ *
+ * @param args unused
+ */
+ public static void main(String[] args) {
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ try {
+ deinit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ try {
+ System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, "asterix-build-configuration.xml");
+ System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002");
+
+ init();
+ while (true) {
+ Thread.sleep(10000);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
}