runLocal is working but doesn't shut down properly
diff --git a/genomix/genomix-data/pom.xml b/genomix/genomix-data/pom.xml
index 18500cc..d164b0c 100644
--- a/genomix/genomix-data/pom.xml
+++ b/genomix/genomix-data/pom.xml
@@ -50,6 +50,11 @@
<type>maven-plugin</type>
</dependency>
<dependency>
+ <groupId>jfree</groupId>
+ <artifactId>jfreechart</artifactId>
+ <version>1.0.13</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
diff --git a/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/DriverUtils.java b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/DriverUtils.java
similarity index 93%
rename from genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/DriverUtils.java
rename to genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/DriverUtils.java
index 00cb252..9a9e27a 100644
--- a/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/DriverUtils.java
+++ b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/DriverUtils.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.genomix.driver;
+package edu.uci.ics.genomix.minicluster;
import java.io.BufferedWriter;
import java.io.File;
@@ -55,7 +55,7 @@
/*
* Get the IP address of the master node using the bin/getip.sh script
*/
- static String getIP(String hostName) throws IOException, InterruptedException {
+ public static String getIP(String hostName) throws IOException, InterruptedException {
String getIPCmd = "ssh -n " + hostName + " \"" + System.getProperty("app.home", ".") + File.separator + "bin"
+ File.separator + "getip.sh\"";
Process p = Runtime.getRuntime().exec(getIPCmd);
@@ -70,7 +70,7 @@
/**
* set the CC's IP address and port from the cluster.properties and `getip.sh` script
*/
- static void updateCCProperties(GenomixJobConf conf) throws FileNotFoundException, IOException, InterruptedException {
+ public static void updateCCProperties(GenomixJobConf conf) throws FileNotFoundException, IOException, InterruptedException {
Properties CCProperties = new Properties();
CCProperties.load(new FileInputStream(System.getProperty("app.home", ".") + File.separator + "conf"
+ File.separator + "cluster.properties"));
@@ -84,7 +84,7 @@
CCProperties.getProperty("FRAME_SIZE", String.valueOf(GenomixJobConf.DEFAULT_FRAME_SIZE)));
}
- static void drawStatistics(JobConf conf, String inputStats, String outputChart) throws IOException {
+ public static void drawStatistics(JobConf conf, String inputStats, String outputChart) throws IOException {
LOG.info("Getting coverage statistics...");
GenomixJobConf.tick("drawStatistics");
FileSystem dfs = FileSystem.get(conf);
@@ -136,7 +136,7 @@
LOG.info("Coverage took " + GenomixJobConf.tock("drawStatistics") + "ms");
}
- static void dumpGraph(JobConf conf, String inputGraph, String outputFasta, boolean followingBuild)
+ public static void dumpGraph(JobConf conf, String inputGraph, String outputFasta, boolean followingBuild)
throws IOException {
LOG.info("Dumping graph to fasta...");
GenomixJobConf.tick("dumpGraph");
diff --git a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/GenomixClusterManager.java b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/GenomixClusterManager.java
index 43de765..49c4573 100644
--- a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/GenomixClusterManager.java
+++ b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/GenomixClusterManager.java
@@ -59,7 +59,7 @@
}
private static final Log LOG = LogFactory.getLog(GenomixClusterManager.class);
-
+ public static final String LOCAL_HOSTNAME = "localhost";
public static final String LOCAL_IP = "127.0.0.1";
public static final int LOCAL_CLIENT_PORT = 3099;
public static final int LOCAL_CC_PORT = 1099;
@@ -132,8 +132,8 @@
private void startLocalCC() throws Exception {
LOG.info("Starting local CC...");
CCConfig ccConfig = new CCConfig();
- ccConfig.clientNetIpAddress = LOCAL_IP;
- ccConfig.clusterNetIpAddress = LOCAL_IP;
+ ccConfig.clientNetIpAddress = LOCAL_HOSTNAME;
+ ccConfig.clusterNetIpAddress = LOCAL_HOSTNAME;
ccConfig.clusterNetPort = LOCAL_CC_PORT;
ccConfig.clientNetPort = LOCAL_CLIENT_PORT;
ccConfig.defaultMaxJobAttempts = 0;
@@ -148,28 +148,13 @@
// ClusterConfig.setClusterPropertiesPath(System.getProperty("app.home") + "/conf/cluster.properties");
// ClusterConfig.setStorePath(...);
NCConfig ncConfig = new NCConfig();
- ncConfig.ccHost = "localhost";
- ncConfig.clusterNetIPAddress = "localhost";
- ncConfig.ccPort = LOCAL_CLIENT_PORT;
+ ncConfig.ccHost = LOCAL_HOSTNAME;
+ ncConfig.clusterNetIPAddress = LOCAL_HOSTNAME;
+ ncConfig.ccPort = LOCAL_CC_PORT;
ncConfig.dataIPAddress = LOCAL_IP;
ncConfig.datasetIPAddress = LOCAL_IP;
ncConfig.nodeId = "nc1";
ncConfig.ioDevices = "tmp" + File.separator + "t3";
- // ncConfig1.ioDevices = clusterWorkDir.toString() + File.separator + "tmp" + File.separator + "t3";
-
-
-// - NCConfig ncConfig1 = new NCConfig();
-// - ncConfig1.ccHost = "localhost";
-// - ncConfig1.clusterNetIPAddress = "localhost";
-// - ncConfig1.ccPort = TEST_HYRACKS_CC_PORT;
-// - ncConfig1.dataIPAddress = "127.0.0.1";
-// - ncConfig1.datasetIPAddress = "127.0.0.1";
-// - ncConfig1.nodeId = NC1_ID;
-// - ncConfig1.ioDevices = clusterWorkDir.toString() + File.separator + "tmp" + File.separator + "t3";
-// - ncConfig1.appNCMainClass = NCApplicationEntryPoint.class.getName();
-// - nc1 = new NodeControllerService(ncConfig1);
-// - nc1.start();
-
if (clusterType == ClusterType.PREGELIX)
ncConfig.appNCMainClass = NCApplicationEntryPoint.class.getName();
@@ -254,7 +239,7 @@
Thread hook = new Thread() {
@Override
public void run() {
- LOG.info("Shutting down the cluster");
+ LOG.info("Interrupt received... Shutting down the cluster!");
try {
stopCluster(clusterType);
} catch (Exception e) {
diff --git a/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java b/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java
index 6a058dd..dfc6f6f 100644
--- a/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java
+++ b/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java
@@ -36,6 +36,7 @@
import edu.uci.ics.genomix.config.GenomixJobConf;
import edu.uci.ics.genomix.config.GenomixJobConf.Patterns;
import edu.uci.ics.genomix.hyracks.graph.driver.Driver.Plan;
+import edu.uci.ics.genomix.minicluster.DriverUtils;
import edu.uci.ics.genomix.minicluster.GenomixClusterManager;
import edu.uci.ics.genomix.minicluster.GenomixClusterManager.ClusterType;
import edu.uci.ics.genomix.pregelix.format.InitialGraphCleanInputFormat;
@@ -236,7 +237,7 @@
public static void main(String[] args) throws CmdLineException, NumberFormatException, HyracksException, Exception {
String[] myArgs = {
-// "-runLocal", "true",
+ "-runLocal", "true",
"-kmerLength", "5", "-coresPerMachine", "2",
// "-saveIntermediateResults", "true",
// "-localInput", "../genomix-pregelix/data/input/reads/synthetic/",