add log to debug
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java
index 9b80f8c..6c93433 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java
@@ -10,6 +10,7 @@
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
+import edu.uci.ics.genomix.pregelix.operator.NaiveFilterVertex;
import edu.uci.ics.genomix.pregelix.operator.ThreeStepLogAlgorithmForPathMergeVertex;
import edu.uci.ics.genomix.pregelix.operator.NaiveAlgorithmForPathMergeVertex;
import edu.uci.ics.genomix.pregelix.operator.TwoStepLogAlgorithmForPathMergeVertex;
@@ -43,6 +44,9 @@
@Option(name = "-runtime-profiling", usage = "whether to do runtime profifling", required = false)
public String profiling = "false";
+
+ @Option(name = "-filter-kmer", usage = "whether to do runtime profifling", required = false)
+ public String filterKmer = "";
}
public static void run(String[] args, PregelixJob job) throws Exception {
@@ -69,6 +73,7 @@
job.getConfiguration().setInt(TwoStepLogAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
job.getConfiguration().setInt(ThreeStepLogAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
}
+ job.getConfiguration().set(NaiveFilterVertex.FILTERKMER, options.filterKmer);
return options;
}
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveAlgorithmForPathMergeVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveAlgorithmForPathMergeVertex.java
index ea89b06..b20d6ea 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveAlgorithmForPathMergeVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveAlgorithmForPathMergeVertex.java
@@ -1,6 +1,7 @@
package edu.uci.ics.genomix.pregelix.operator;
import java.util.Iterator;
+import java.util.logging.Logger;
import org.apache.hadoop.io.NullWritable;
@@ -51,6 +52,8 @@
* Naive Algorithm for path merge graph
*/
public class NaiveAlgorithmForPathMergeVertex extends Vertex<KmerBytesWritable, ValueStateWritable, NullWritable, NaiveAlgorithmMessageWritable>{
+ public static Logger logger = Logger.getLogger(NaiveAlgorithmForPathMergeVertex.class.getName());
+
public static final String KMER_SIZE = "NaiveAlgorithmForPathMergeVertex.kmerSize";
public static final String ITERATIONS = "NaiveAlgorithmForPathMergeVertex.iteration";
@@ -161,6 +164,7 @@
msg.set(getVertexId(), chainVertexId, getVertexId(), (byte)0, false);
sendMsgToAllNextNodes(getVertexId(), getVertexValue().getAdjMap());
}
+
}
else if(getSuperstep() == 2){
if(msgIterator.hasNext()){
@@ -182,6 +186,12 @@
responseMsgToHeadVertex();
}
}
+ String log = "Iterator:" + getSuperstep();
+ log += getVertexId().toString() + "\t";
+ log += getVertexValue().getMergeChain().toString() + "\t";
+ log += GeneCode.getSymbolFromBitMap(getVertexValue().getAdjMap()) + "\t";
+ log += getVertexValue().getState();
+ logger.info(log);
voteToHalt();
}
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveFilterVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveFilterVertex.java
index a02f3d5..f0020bc 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveFilterVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/NaiveFilterVertex.java
@@ -54,8 +54,10 @@
public static final String KMER_SIZE = "NaiveAlgorithmForPathMergeVertex.kmerSize";
public static final String ITERATIONS = "NaiveAlgorithmForPathMergeVertex.iteration";
+ public static final String FILTERKMER = "NaiveFilterVertex.filterKmer";
public static int kmerSize = -1;
private int maxIteration = -1;
+ private String filterKmer = "";
private NaiveAlgorithmMessageWritable msg = new NaiveAlgorithmMessageWritable();
@@ -72,6 +74,8 @@
kmerSize = getContext().getConfiguration().getInt(KMER_SIZE, 5);
if (maxIteration < 0)
maxIteration = getContext().getConfiguration().getInt(ITERATIONS, 1000000);
+ if(filterKmer.equals(""))
+ filterKmer = getContext().getConfiguration().get(FILTERKMER, "");
}
public void findDestination(){
destVertexId.set(msg.getSourceVertexId());
@@ -147,8 +151,8 @@
byte tmp = GraphVertexOperation.updateRightNeighberByVertexId(getVertexValue().getAdjMap(), msg.getSourceVertexId(), kmerSize);
getVertexValue().set(tmp, State.FINAL_VERTEX, msg.getChainVertexId());
setVertexValue(getVertexValue());
- //String source = msg.getChainVertexId().toString();
- //System.out.print("");
+ String source = msg.getChainVertexId().toString();
+ System.out.print("");
}
}
}
@@ -158,7 +162,7 @@
initVertex();
if (getSuperstep() == 1) {
if(GraphVertexOperation.isHeadVertex(getVertexValue().getAdjMap())){
- if(getVertexId().toString().equals("ACGTTATATGGGACGACGTTATAACGTATTACGTTATATGGGATGTCGTTATAAC")){
+ if(getVertexId().toString().equals(filterKmer)){
getVertexValue().setState(State.FILTER);
setVertexValue(getVertexValue());
msg.set(getVertexId(), chainVertexId, getVertexId(), (byte)0, false);
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java
index 2353529..2ef2932 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java
@@ -1,6 +1,7 @@
package edu.uci.ics.genomix.pregelix.operator;
import java.util.Iterator;
+import java.util.logging.Logger;
import org.apache.hadoop.io.NullWritable;
@@ -48,6 +49,7 @@
* The details about message are in edu.uci.ics.pregelix.example.io.MessageWritable.
*/
public class TwoStepLogAlgorithmForPathMergeVertex extends Vertex<KmerBytesWritable, ValueStateWritable, NullWritable, LogAlgorithmMessageWritable>{
+ public static Logger logger = Logger.getLogger(TwoStepLogAlgorithmForPathMergeVertex.class.getName());
public static final String KMER_SIZE = "TwoStepLogAlgorithmForPathMergeVertex.kmerSize";
public static final String ITERATIONS = "TwoStepLogAlgorithmForPathMergeVertex.iteration";
@@ -339,6 +341,12 @@
}
else
voteToHalt();
+ String log = "Iterator:" + getSuperstep();
+ log += getVertexId().toString() + "\t";
+ log += getVertexValue().getMergeChain().toString() + "\t";
+ log += GeneCode.getSymbolFromBitMap(getVertexValue().getAdjMap()) + "\t";
+ log += getVertexValue().getState();
+ logger.info(log);
}
/**
* @param args
diff --git a/genomix/genomix-pregelix/src/test/java/edu/uci/ics/genomix/pregelix/pathmerge/GraphBuildTest.java b/genomix/genomix-pregelix/src/test/java/edu/uci/ics/genomix/pregelix/pathmerge/GraphBuildTest.java
index a381c3c..5681ae0 100644
--- a/genomix/genomix-pregelix/src/test/java/edu/uci/ics/genomix/pregelix/pathmerge/GraphBuildTest.java
+++ b/genomix/genomix-pregelix/src/test/java/edu/uci/ics/genomix/pregelix/pathmerge/GraphBuildTest.java
@@ -34,14 +34,14 @@
private static final String ACTUAL_RESULT_DIR = "graphbuildresult";
private static final String PATH_TO_HADOOP_CONF = "src/test/resources/hadoop/conf";
- private static final String DATA_PATH = "data/shortjump_1.head8M.fastq";
+ private static final String DATA_PATH = "data/testGeneFile";
private static final String HDFS_INPUT_PATH = "/test";
private static final String HDFS_OUTPUT_PATH = "/result";
private static final String DUMPED_RESULT = ACTUAL_RESULT_DIR
+ HDFS_OUTPUT_PATH + "/result.txt";
private static final String CONVERT_RESULT = ACTUAL_RESULT_DIR
- + HDFS_OUTPUT_PATH + "/result.txt.txt";
+ + "/graph_build_result.txt";
private static final String EXPECTED_PATH = "src/test/resources/expected/result2";
private static final String HADOOP_CONF_PATH = ACTUAL_RESULT_DIR
diff --git a/pregelix/pregelix-core/src/main/java/edu/uci/ics/pregelix/core/driver/Driver.java b/pregelix/pregelix-core/src/main/java/edu/uci/ics/pregelix/core/driver/Driver.java
index 1f071bf..a072b9b 100644
--- a/pregelix/pregelix-core/src/main/java/edu/uci/ics/pregelix/core/driver/Driver.java
+++ b/pregelix/pregelix-core/src/main/java/edu/uci/ics/pregelix/core/driver/Driver.java
@@ -130,12 +130,14 @@
do {
start = System.currentTimeMillis();
runLoopBodyIteration(deploymentId, jobGen, i);
+ runHDFSWRite(deploymentId, jobGen);
end = System.currentTimeMillis();
time = end - start;
LOG.info("iteration " + i + " finished " + time + "ms");
terminate = IterationUtils.readTerminationState(job.getConfiguration(), jobGen.getJobId())
|| IterationUtils.readForceTerminationState(job.getConfiguration(), jobGen.getJobId());
i++;
+
} while (!terminate);
start = System.currentTimeMillis();