remove -port and -ipAddress in favor of reading from conf
diff --git a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/config/GenomixJobConf.java b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/config/GenomixJobConf.java
index 4ef8ca8..9ed4163 100644
--- a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/config/GenomixJobConf.java
+++ b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/config/GenomixJobConf.java
@@ -138,17 +138,10 @@
private int maxReadIDsPerEdge = -1;
// Hyracks/Pregelix Setup
- // TODO remove ip and port? (refactor Nan's driver)
- @Option(name = "-ip", usage = "IP address of the cluster controller", required = false)
- private String ipAddress;
-
- @Option(name = "-port", usage = "Port of the cluster controller", required = false)
- private int port = -1;
-
@Option(name = "-profile", usage = "Whether or not to do runtime profifling", required = false)
private boolean profile = false;
- @Option(name = "-runLocal", usage = "Run a local instance using the Hadoop MiniCluster. NOTE: overrides settings for -ip and -port and those in conf/*.properties", required=false)
+ @Option(name = "-runLocal", usage = "Run a local instance using the Hadoop MiniCluster.", required=false)
private boolean runLocal = false;
@Option(name = "-debugKmers", usage = "Log all interactions with the given comma-separated list of kmers at the FINE log level (check conf/logging.properties to specify an output location)", required=false)
@@ -423,9 +416,6 @@
setBoolean(LOG_READIDS, opts.logReadIds);
// Hyracks/Pregelix Setup
- if (opts.ipAddress != null)
- set(IP_ADDRESS, opts.ipAddress);
- setInt(PORT, opts.port);
setBoolean(PROFILE, opts.profile);
// Graph cleaning
diff --git a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/DriverUtils.java b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/DriverUtils.java
index 3046192..1284ebc 100644
--- a/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/DriverUtils.java
+++ b/genomix/genomix-data/src/main/java/edu/uci/ics/genomix/minicluster/DriverUtils.java
@@ -74,11 +74,22 @@
Properties CCProperties = new Properties();
CCProperties.load(new FileInputStream(System.getProperty("app.home", ".") + File.separator + "conf"
+ File.separator + "cluster.properties"));
- if (conf.get(GenomixJobConf.IP_ADDRESS) == null)
- conf.set(GenomixJobConf.IP_ADDRESS, getIP("localhost")); // TODO runLocal shouldn't require calling the outside script
- if (Integer.parseInt(conf.get(GenomixJobConf.PORT)) == -1) {
- conf.set(GenomixJobConf.PORT, CCProperties.getProperty("CC_CLIENTPORT"));
+ if (Boolean.parseBoolean(conf.get(GenomixJobConf.RUN_LOCAL))) {
+ if (conf.get(GenomixJobConf.IP_ADDRESS) == null) {
+ conf.set(GenomixJobConf.IP_ADDRESS, GenomixClusterManager.LOCAL_IP);
+ }
+ if (Integer.parseInt(conf.get(GenomixJobConf.PORT)) == -1) {
+ conf.setInt(GenomixJobConf.PORT, GenomixClusterManager.LOCAL_HYRACKS_CC_PORT);
+ }
+ } else {
+ if (conf.get(GenomixJobConf.IP_ADDRESS) == null) {
+ conf.set(GenomixJobConf.IP_ADDRESS, getIP("localhost"));
+ }
+ if (Integer.parseInt(conf.get(GenomixJobConf.PORT)) == -1) {
+ conf.set(GenomixJobConf.PORT, CCProperties.getProperty("CC_CLIENTPORT"));
+ }
}
+
if (conf.get(GenomixJobConf.FRAME_SIZE) == null)
conf.set(GenomixJobConf.FRAME_SIZE, CCProperties.getProperty("FRAME_SIZE"));
if (conf.get(GenomixJobConf.FRAME_LIMIT) == null)
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 82e432b..066f843 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
@@ -146,8 +146,8 @@
manager.startCluster(ClusterType.HYRACKS);
GenomixJobConf.tick("buildGraphWithHyracks");
- String hyracksIP = runLocal ? GenomixClusterManager.LOCAL_IP : conf.get(GenomixJobConf.IP_ADDRESS);
- int hyracksPort = runLocal ? GenomixClusterManager.LOCAL_HYRACKS_CLIENT_PORT : Integer.parseInt(conf.get(GenomixJobConf.PORT));
+ String hyracksIP = conf.get(GenomixJobConf.IP_ADDRESS);
+ int hyracksPort = Integer.parseInt(conf.get(GenomixJobConf.PORT));
hyracksDriver = new edu.uci.ics.genomix.hyracks.graph.driver.Driver(hyracksIP, hyracksPort, numCoresPerMachine);
hyracksDriver.runJob(conf, Plan.BUILD_DEBRUIJN_GRAPH, Boolean.parseBoolean(conf.get(GenomixJobConf.PROFILE)));
followingBuild = true;
@@ -195,8 +195,8 @@
if (pregelixJobs.size() > 0) {
manager.startCluster(ClusterType.PREGELIX);
pregelixDriver = new edu.uci.ics.pregelix.core.driver.Driver(this.getClass());
- String pregelixIP = runLocal ? GenomixClusterManager.LOCAL_IP : conf.get(GenomixJobConf.IP_ADDRESS);
- int pregelixPort = runLocal ? GenomixClusterManager.LOCAL_PREGELIX_CLIENT_PORT : Integer.parseInt(conf.get(GenomixJobConf.PORT));
+ String pregelixIP = conf.get(GenomixJobConf.IP_ADDRESS);
+ int pregelixPort = Integer.parseInt(conf.get(GenomixJobConf.PORT));
// if the user wants to, we can save the intermediate results to HDFS (running each job individually)
// this would let them resume at arbitrary points of the pipeline