change code format of naive algorithm and delete some extra test code
git-svn-id: https://hyracks.googlecode.com/svn/branches/fullstack_genomix@3303 123451ca-8445-de46-9d55-352943316053
diff --git a/genomix/genomix-pregelix/data/webmap/sequenceShortFileMergeTest b/genomix/genomix-pregelix/data/webmap/sequenceShortFileMergeTest
index c5ebbc1..edd1e59 100755
--- a/genomix/genomix-pregelix/data/webmap/sequenceShortFileMergeTest
+++ b/genomix/genomix-pregelix/data/webmap/sequenceShortFileMergeTest
Binary files differ
diff --git a/genomix/genomix-pregelix/pom.xml b/genomix/genomix-pregelix/pom.xml
index ebed72c..7544d7c 100644
--- a/genomix/genomix-pregelix/pom.xml
+++ b/genomix/genomix-pregelix/pom.xml
@@ -3,6 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.uci.ics.pregelix</groupId>
<artifactId>genomix-pregelix</artifactId>
+ <packaging>jar</packaging>
<version>0.2.4-SNAPSHOT</version>
<name>genomix-pregelix</name>
@@ -54,6 +55,29 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>appassembler-maven-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <configuration>
+ <programs>
+ <program>
+ <mainClass>edu.uci.ics.pregelix.example.Client</mainClass>
+ <name>pregelix</name>
+ </program>
+ </programs>
+ <repositoryLayout>flat</repositoryLayout>
+ <repositoryName>lib</repositoryName>
+ </configuration>
+ <phase>package</phase>
+ <goals>
+ <goal>assemble</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/BinaryLoadGraphInputFormat.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/BinaryLoadGraphInputFormat.java
index 82fe3d9..deac3c8 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/BinaryLoadGraphInputFormat.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/BinaryLoadGraphInputFormat.java
@@ -1,6 +1,8 @@
package edu.uci.ics.pregelix;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
import org.apache.hadoop.io.ByteWritable;
import org.apache.hadoop.io.BytesWritable;
@@ -12,74 +14,72 @@
import edu.uci.ics.pregelix.api.graph.Vertex;
import edu.uci.ics.pregelix.api.io.VertexReader;
import edu.uci.ics.pregelix.api.io.binary.BinaryVertexInputFormat;
+import edu.uci.ics.pregelix.api.io.binary.BinaryVertexInputFormat.BinaryVertexReader;
import edu.uci.ics.pregelix.api.util.BspUtils;
import edu.uci.ics.pregelix.bitwise.BitwiseOperation;
import edu.uci.ics.pregelix.example.io.MessageWritable;
+import edu.uci.ics.pregelix.example.io.VLongWritable;
import edu.uci.ics.genomix.type.KmerCountValue;
public class BinaryLoadGraphInputFormat extends
BinaryVertexInputFormat<BytesWritable, ByteWritable, NullWritable, MessageWritable>{
-
+ //static int number = 0;
/**
* Format INPUT
*/
@Override
public VertexReader<BytesWritable, ByteWritable, NullWritable, MessageWritable> createVertexReader(
InputSplit split, TaskAttemptContext context) throws IOException {
+ /*try{
+ System.out.println("split: " + number++ + " length:"+ split.getLength());
+ }catch (Exception ex){
+
+ }*/
return new BinaryLoadGraphReader(binaryInputFormat.createRecordReader(split, context));
+ }
+}
+
+@SuppressWarnings("rawtypes")
+class BinaryLoadGraphReader extends
+ BinaryVertexReader<BytesWritable, ByteWritable, NullWritable, MessageWritable> {
+ private Vertex vertex;
+ private BytesWritable vertexId = new BytesWritable();
+ private ByteWritable vertexValue = new ByteWritable();
+
+ public BinaryLoadGraphReader(RecordReader<BytesWritable,KmerCountValue> recordReader) {
+ super(recordReader);
}
-
- @SuppressWarnings("rawtypes")
- class BinaryLoadGraphReader extends
- BinaryVertexReader<BytesWritable, ByteWritable, NullWritable, MessageWritable> {
- private final static String separator = " ";
- private Vertex vertex;
- private BytesWritable vertexId = new BytesWritable();
- private ByteWritable vertexValue = new ByteWritable();
- public BinaryLoadGraphReader(RecordReader<BytesWritable,KmerCountValue> recordReader) {
- super(recordReader);
- }
-
- @Override
- public boolean nextVertex() throws IOException, InterruptedException {
- return getRecordReader().nextKeyValue();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Vertex<BytesWritable, ByteWritable, NullWritable, MessageWritable> getCurrentVertex() throws IOException,
- InterruptedException {
- if (vertex == null)
- vertex = (Vertex) BspUtils.createVertex(getContext().getConfiguration());
-
- vertex.getMsgList().clear();
- vertex.getEdges().clear();
-
-
- if(getRecordReader() != null){
- /**
- * set the src vertex id
- */
-
- vertexId = getRecordReader().getCurrentKey();
- vertex.setVertexId(vertexId);
- /**
- * set the vertex value
- */
- KmerCountValue kmerCountValue = getRecordReader().getCurrentValue();
- vertexValue.set(kmerCountValue.getAdjBitMap());
- vertex.setVertexValue(vertexValue);
-
- String kmer = BitwiseOperation.convertBytesToBinaryStringKmer(vertexId.getBytes(),GraphVertexOperation.k);
- System.out.println("key: " + kmer);
- System.out.println("code: " + GraphVertexOperation.convertBinaryStringToGenecode(kmer));
- System.out.println("value: " + BitwiseOperation.convertByteToBinaryString(kmerCountValue.getAdjBitMap()));
- System.out.println();
- }
-
- return vertex;
- }
+ @Override
+ public boolean nextVertex() throws IOException, InterruptedException {
+ return getRecordReader().nextKeyValue();
}
-
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Vertex<BytesWritable, ByteWritable, NullWritable, MessageWritable> getCurrentVertex() throws IOException,
+ InterruptedException {
+ if (vertex == null)
+ vertex = (Vertex) BspUtils.createVertex(getContext().getConfiguration());
+
+ vertex.getMsgList().clear();
+ vertex.getEdges().clear();
+
+ vertex.reset();
+ if(getRecordReader() != null){
+ /**
+ * set the src vertex id
+ */
+ vertexId.set(getRecordReader().getCurrentKey());
+ vertex.setVertexId(vertexId);
+ /**
+ * set the vertex value
+ */
+ KmerCountValue kmerCountValue = getRecordReader().getCurrentValue();
+ vertexValue.set(kmerCountValue.getAdjBitMap());
+ vertex.setVertexValue(vertexValue);
+ }
+
+ return vertex;
+ }
}
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/GraphVertexOperation.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/GraphVertexOperation.java
index 8fa34c3..8197ea8 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/GraphVertexOperation.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/GraphVertexOperation.java
@@ -24,7 +24,7 @@
import edu.uci.ics.pregelix.type.KmerCountValue;
public class GraphVertexOperation {
- public static final int k = 55; //kmer, k: the length of kmer
+ public static final int k = 3; //kmer, k: the length of kmer
static private final Path TMP_DIR = new Path(
GenerateSequenceFile.class.getSimpleName() + "_INTERIM");
/**
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/LogAlgorithmForMergeGraphVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/LogAlgorithmForMergeGraphVertex.java
index a3d5e3f..8ccb03e 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/LogAlgorithmForMergeGraphVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/LogAlgorithmForMergeGraphVertex.java
@@ -58,7 +58,6 @@
private byte[] tmpVertextId;
private byte[] tmpSourceVertextId;
private byte[] tmpDestVertexId;
- private byte[] tmpChainVertexId;
private byte[] mergeChainVertexId;
private int lengthOfMergeChainVertex;
private byte[] tmpMergeChainVertexId;
@@ -81,8 +80,7 @@
if (getSuperstep() == 1) {
tmpVal = getVertexValue();
tmpVertexValue = tmpVal.getValue();
- tmpChainVertexId = new byte[0];
- tmpMsg.setChainVertexId(tmpChainVertexId);
+ tmpMsg.setChainVertexId(new byte[0]);
if(GraphVertexOperation.isHead(new ByteWritable(tmpVertexValue))){
tmpMsg.setMessage(Message.START);
tmpDestVertexId = GraphVertexOperation.getDestVertexId(tmpVertextId, tmpVertexValue);
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/MergeGraphVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/MergeGraphVertex.java
index 5d8d199..3fdcd6d 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/MergeGraphVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/MergeGraphVertex.java
@@ -53,12 +53,12 @@
*/
public class MergeGraphVertex extends Vertex<BytesWritable, ByteWritable, NullWritable, MessageWritable>{
- private byte[] tmpVertextId;
- private byte[] tmpSourceVertextId;
- private byte[] tmpDestVertexId;
- private byte[] tmpChainVertexId;
- private byte tmpNeighberByte;
- private byte tmpVertexValue;
+ /** The number of bytes for vertex id */
+ public static final int numBytes = (GraphVertexOperation.k-1)/4 + 1;
+ private BytesWritable tmpVertextId = new BytesWritable();
+ private BytesWritable tmpDestVertexId = new BytesWritable();
+ private BytesWritable tmpChainVertexId = new BytesWritable();
+ private ByteWritable tmpVertexValue = new ByteWritable();
private MessageWritable tmpMsg = new MessageWritable();
OutputStreamWriter writer;
/**
@@ -69,19 +69,19 @@
try {
writer = new OutputStreamWriter(new FileOutputStream("test/check_Naive",true));
} catch (FileNotFoundException e1) { e1.printStackTrace();}
- tmpVertextId = GraphVertexOperation.generateValidDataFromBytesWritable(getVertexId());
+ tmpVertextId.set(GraphVertexOperation.generateValidDataFromBytesWritable(getVertexId()),0,numBytes);
if (getSuperstep() == 1) {
if(GraphVertexOperation.isHead(getVertexValue())){
- tmpSourceVertextId = tmpVertextId;
- tmpDestVertexId = GraphVertexOperation.getDestVertexId(tmpSourceVertextId,
- getVertexValue().get());
- tmpMsg.setSourceVertexId(tmpSourceVertextId);
- tmpChainVertexId = new byte[0];
- tmpMsg.setChainVertexId(tmpChainVertexId);
- sendMsg(new BytesWritable(tmpDestVertexId),tmpMsg);
+ //tmpSourceVertextId = tmpVertextId;
+ tmpDestVertexId.set(GraphVertexOperation.getDestVertexId(tmpVertextId.getBytes(),
+ getVertexValue().get()), 0, numBytes);
+ tmpMsg.setSourceVertexId(tmpVertextId.getBytes());
+ tmpMsg.setLengthOfChain(0);
+ tmpMsg.setChainVertexId(tmpChainVertexId.getBytes());
+ sendMsg(tmpDestVertexId,tmpMsg);
//test
- GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpSourceVertextId,
- tmpDestVertexId,tmpMsg);
+ //GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId.getBytes(),
+ // tmpDestVertexId.getBytes(),tmpMsg);
}
}
//path node sends message back to head node
@@ -90,53 +90,48 @@
tmpMsg = msgIterator.next();
if(!tmpMsg.isRear()){
if(GraphVertexOperation.isPathVertex(getVertexValue())){
- tmpSourceVertextId = tmpMsg.getSourceVertexId();
- tmpNeighberByte = getVertexValue().get();
- tmpMsg.setNeighberInfo(tmpNeighberByte); //set neighber
- tmpChainVertexId = tmpMsg.getChainVertexId();
- if(tmpChainVertexId.length == 0){
+ tmpDestVertexId.set(tmpMsg.getSourceVertexId(), 0, numBytes);
+ tmpMsg.setNeighberInfo(getVertexValue().get()); //set neighber
+ if(tmpMsg.getLengthOfChain() == 0){
tmpMsg.setLengthOfChain(GraphVertexOperation.k);
- tmpMsg.setChainVertexId(tmpVertextId);
+ tmpMsg.setChainVertexId(tmpVertextId.getBytes());
}
else{
tmpMsg.incrementLength();
tmpMsg.setChainVertexId(GraphVertexOperation.updateChainVertexId(
- tmpChainVertexId,
+ tmpMsg.getChainVertexId(),
tmpMsg.getLengthOfChain()-1,
- tmpVertextId));
+ tmpVertextId.getBytes()));
deleteVertex(getVertexId());
}
- sendMsg(new BytesWritable(tmpSourceVertextId),tmpMsg);
+ sendMsg(tmpDestVertexId,tmpMsg);
//test
- GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId,
- tmpSourceVertextId,tmpMsg);
+ GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId.getBytes(),
+ tmpDestVertexId.getBytes(),tmpMsg);
}
else if(GraphVertexOperation.isRear(getVertexValue())){
- tmpSourceVertextId = tmpMsg.getSourceVertexId();
- tmpMsg.setSourceVertexId(tmpVertextId);
+ tmpDestVertexId.set(tmpMsg.getSourceVertexId(), 0, numBytes);
+ tmpMsg.setSourceVertexId(tmpVertextId.getBytes());
tmpMsg.setRear(true);
- sendMsg(new BytesWritable(tmpSourceVertextId),tmpMsg);
+ sendMsg(tmpDestVertexId,tmpMsg);
//test
try {
writer.write("It is Rear!\r\n");
} catch (IOException e) { e.printStackTrace(); }
- GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId,
- tmpSourceVertextId,tmpMsg);
+ GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId.getBytes(),
+ tmpDestVertexId.getBytes(),tmpMsg);
}
}
else{
- tmpVertexValue = GraphVertexOperation.updateRightNeighberByVertexId(getVertexValue().get(),
- tmpMsg.getSourceVertexId());
- //setVertexValue(new ByteWritable(tmpVertexValue));
- //setVertexId(new BytesWritable(tmpMsg.getChainVertexId()));
- //addVertex(new BytesWritable(tmpMsg.getChainVertexId()),new ByteWritable(tmpVertexValue));
+ tmpVertexValue.set(GraphVertexOperation.updateRightNeighberByVertexId(getVertexValue().get(),
+ tmpMsg.getSourceVertexId()));
try {
GraphVertexOperation.flushChainToFile(tmpMsg.getChainVertexId(),
- tmpMsg.getLengthOfChain(),tmpVertextId);
+ tmpMsg.getLengthOfChain(),tmpVertextId.getBytes());
} catch (IOException e) { e.printStackTrace(); }
//test
- GraphVertexOperation.testLastMessageCommunication(writer,getSuperstep(),tmpVertextId,
- tmpSourceVertextId,tmpMsg);
+ GraphVertexOperation.testLastMessageCommunication(writer,getSuperstep(),tmpVertextId.getBytes(),
+ tmpDestVertexId.getBytes(),tmpMsg);
}
}
@@ -145,26 +140,24 @@
else if(getSuperstep()%2 == 1){
if (msgIterator.hasNext()){
tmpMsg = msgIterator.next();
- tmpNeighberByte = tmpMsg.getNeighberInfo();
- tmpChainVertexId = tmpMsg.getChainVertexId();
if(!tmpMsg.isRear()){
- byte[] lastKmer = GraphVertexOperation.getLastKmer(tmpChainVertexId,
+ byte[] lastKmer = GraphVertexOperation.getLastKmer(tmpMsg.getChainVertexId(),
tmpMsg.getLengthOfChain());
- tmpDestVertexId = GraphVertexOperation.getDestVertexId(lastKmer, tmpNeighberByte);
- tmpSourceVertextId = tmpVertextId;
- tmpMsg.setSourceVertexId(tmpSourceVertextId);
- sendMsg(new BytesWritable(tmpDestVertexId),tmpMsg);
+ tmpDestVertexId.set(GraphVertexOperation.getDestVertexId(lastKmer,
+ tmpMsg.getNeighberInfo()), 0, numBytes);
+ tmpMsg.setSourceVertexId(tmpVertextId.getBytes());
+ sendMsg(tmpDestVertexId,tmpMsg);
//test
- GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId,
- tmpDestVertexId,tmpMsg);
+ GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId.getBytes(),
+ tmpDestVertexId.getBytes(),tmpMsg);
}
else{
- tmpDestVertexId = GraphVertexOperation.getDestVertexId(tmpVertextId,
- getVertexValue().get());
- sendMsg(new BytesWritable(tmpDestVertexId),tmpMsg);
+ tmpDestVertexId.set(GraphVertexOperation.getDestVertexId(tmpVertextId.getBytes(),
+ getVertexValue().get()), 0, numBytes);
+ sendMsg(tmpDestVertexId,tmpMsg);
//test
- GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId,
- tmpDestVertexId,tmpMsg);
+ GraphVertexOperation.testMessageCommunication(writer,getSuperstep(),tmpVertextId.getBytes(),
+ tmpDestVertexId.getBytes(),tmpMsg);
}
}
}
@@ -173,32 +166,6 @@
} catch (IOException e) { e.printStackTrace(); }
voteToHalt();
}
-
- private void signalTerminate() {
- Configuration conf = getContext().getConfiguration();
- try {
- IterationUtils.writeForceTerminationState(conf, BspUtils.getJobId(conf));
- writeMergeGraphResult(conf, true);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- private void writeMergeGraphResult(Configuration conf, boolean terminate) {
- try {
- FileSystem dfs = FileSystem.get(conf);
- String pathStr = IterationUtils.TMP_DIR + BspUtils.getJobId(conf) + "MergeGraph";
- Path path = new Path(pathStr);
- if (!dfs.exists(path)) {
- FSDataOutputStream output = dfs.create(path, true);
- output.writeBoolean(terminate);
- output.flush();
- output.close();
- }
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
/**
* @param args
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/GenerateSequenceFile.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/GenerateSequenceFile.java
index 9cae8b2..fa2cd56 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/GenerateSequenceFile.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/GenerateSequenceFile.java
@@ -414,8 +414,8 @@
* AGCATGCTAT
*/
- //generateSequenceFileFromGeneCode3("AGCATGCTAT");//GTCGATT //before T: GGACG
- generateSequenceFileFromGeneCode15("AAAAAAAAAAAAAGCATGCTATAAAAAAAAAAAA");
+ generateSequenceFileFromGeneCode3("AGCATGCTAT");//GTCGATT //before T: GGACG
+ //generateSequenceFileFromGeneCode15("AAAAAAAAAAAAAGCATGCTATAAAAAAAAAAAA");
}
public static void generateSequenceFileFromGeneCode3(String s) throws IOException{
Configuration conf = new Configuration();
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/generateSmallFile.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/generateSmallFile.java
index 2909cfe..0d1416e 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/generateSmallFile.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/SequenceFile/generateSmallFile.java
@@ -44,8 +44,8 @@
// TODO Auto-generated method stub
Path dir = new Path("data/webmap");
Path inFile = new Path(dir, "part-1");
- Path outFile = new Path(dir, "part-1-out-10000");
- generateNumOfLinesFromBigFile(inFile,outFile,10000);
+ Path outFile = new Path(dir, "part-1-out-1000000");
+ generateNumOfLinesFromBigFile(inFile,outFile,1000000);
}
}
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/TestLoadGraphVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/TestLoadGraphVertex.java
index 30e6b9a..085d3be 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/TestLoadGraphVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/TestLoadGraphVertex.java
@@ -44,49 +44,11 @@
*/
public class TestLoadGraphVertex extends Vertex<BytesWritable, ByteWritable, NullWritable, MessageWritable>{
- //private byte[] tmpVertexId;
- //private BytesWritable vid;
- //private TestLoadGraphVertex newVertex;
- //private MessageWritable tmpMsg = new MessageWritable();
/**
* For test, just output original file
*/
@Override
public void compute(Iterator<MessageWritable> msgIterator) {
- /*deleteVertex(getVertexId());
- tmpVertexId = getVertexId().getBytes();
- String a1 = "100100";
- byte[] b1 = BitwiseOperation.convertBinaryStringToBytes(a1);
- String a2 = "000000"; //"001001";
- byte[] b2 = BitwiseOperation.convertBinaryStringToBytes(a2);
- String valueString = "00000000";
- byte value = BitwiseOperation.convertBinaryStringToByte(valueString);
- if(getSuperstep() == 1 && Arrays.equals(b1,tmpVertexId)){
- newVertex = new TestLoadGraphVertex();
- vid.set(new BytesWritable(b2));
- newVertex.setVertexId(vid);
- newVertex.setVertexValue(getVertexValue());
- addVertex(vid, newVertex);
- //vertex.initialize(new BytesWritable(b2), new ByteWritable(value), null, null);
- //addVertex(new BytesWritable(b2),this.createdNewLiveVertex());
- deleteVertex(getVertexId());
- }*/
- /*String a2 = "100111";
- byte[] b2 = BitwiseOperation.convertBinaryStringToBytes(a2);
- String a3 = "11111111";
- byte[] b3 = BitwiseOperation.convertBinaryStringToBytes(a3);
- byte[] bb1 = getVertexId().getBytes();
- if(getSuperstep() == 1 && Arrays.equals(b1,bb1)){
- //addVertex(new BytesWritable(b3),new ByteWritable(bb1[0]));
- deleteVertex(new BytesWritable(b1));
- }
- else if(getSuperstep() == 2){
- if(msgIterator.hasNext()){
- tmpMsg = msgIterator.next();
- byte[] b = tmpMsg.getChainVertexId();
- setVertexValue(new ByteWritable(b[0]));
- }
- }*/
voteToHalt();
}
@@ -95,7 +57,7 @@
*/
public static void main(String[] args) throws Exception {
//final int k = Integer.parseInt(args[0]);
- PregelixJob job = new PregelixJob(MergeGraphVertex.class.getSimpleName());
+ PregelixJob job = new PregelixJob(TestLoadGraphVertex.class.getSimpleName());
job.setVertexClass(TestLoadGraphVertex.class);
/**
* BinaryInput and BinaryOutput
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/example/client/Client.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/example/client/Client.java
index cdcf852..beea890 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/example/client/Client.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/pregelix/example/client/Client.java
@@ -46,21 +46,6 @@
@Option(name = "-plan", usage = "query plan choice", required = false)
public Plan planChoice = Plan.OUTER_JOIN;
- @Option(name = "-vnum", usage = "number of vertices", required = false)
- public long numVertices;
-
- @Option(name = "-enum", usage = "number of vertices", required = false)
- public long numEdges;
-
- @Option(name = "-source-vertex", usage = "source vertex id, for shortest paths/reachibility only", required = false)
- public long sourceId;
-
- @Option(name = "-dest-vertex", usage = "dest vertex id, for reachibility only", required = false)
- public long destId;
-
- @Option(name = "-num-iteration", usage = "max number of iterations, for pagerank job only", required = false)
- public long numIteration = -1;
-
@Option(name = "-runtime-profiling", usage = "whether to do runtime profifling", required = false)
public String profiling = "false";
}
@@ -81,8 +66,6 @@
for (int i = 1; i < inputs.length; i++)
FileInputFormat.addInputPaths(job, inputs[0]);
FileOutputFormat.setOutputPath(job, new Path(options.outputPath));
- job.getConfiguration().setLong(PregelixJob.NUM_VERTICE, options.numVertices);
- job.getConfiguration().setLong(PregelixJob.NUM_EDGES, options.numEdges);
return options;
}
diff --git a/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobGen/JobGenerator.java b/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobGen/JobGenerator.java
index 8151f65..c2f52bf 100644
--- a/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobGen/JobGenerator.java
+++ b/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobGen/JobGenerator.java
@@ -100,9 +100,9 @@
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
- //genBinaryLoadGraph();
+ genBinaryLoadGraph();
//genMergeGraph();
- genLogAlgorithmForMergeGraph();
+ //genLogAlgorithmForMergeGraph();
//genSequenceLoadGraph();
//genBasicBinaryLoadGraph();
}
diff --git a/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobRun/RunJobTestSuite.java b/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobRun/RunJobTestSuite.java
index 4cce065..7de6be6 100644
--- a/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobRun/RunJobTestSuite.java
+++ b/genomix/genomix-pregelix/src/test/java/edu/uci/ics/pregelix/JobRun/RunJobTestSuite.java
@@ -41,7 +41,7 @@
private static final String PATH_TO_ONLY = "src/test/resources/only.txt";
private static final String FILE_EXTENSION_OF_RESULTS = "result";
- private static final String DATA_PATH = "data/webmap/part-1-out-10000";//sequenceFileMergeTest
+ private static final String DATA_PATH = "data/webmap/part-1-out-500000";//sequenceFileMergeTest
private static final String HDFS_PATH = "/webmap/";
private static final String HYRACKS_APP_NAME = "pregelix";