create svn dir
git-svn-id: https://hyracks.googlecode.com/svn/branches/fullstack_genomix@2773 123451ca-8445-de46-9d55-352943316053
diff --git a/genomix/genomix-hadoop/actual/conf.xml b/genomix/genomix-hadoop/actual/conf.xml
index b3ca482..a24987c 100755
--- a/genomix/genomix-hadoop/actual/conf.xml
+++ b/genomix/genomix-hadoop/actual/conf.xml
@@ -12,7 +12,7 @@
<property><name>dfs.namenode.logging.level</name><value>info</value></property>
<property><name>dfs.datanode.address</name><value>127.0.0.1:0</value></property>
<property><name>io.skip.checksum.errors</name><value>false</value></property>
-<property><name>fs.default.name</name><value>hdfs://localhost:49297</value></property>
+<property><name>fs.default.name</name><value>hdfs://localhost:55116</value></property>
<property><name>mapred.child.tmp</name><value>./tmp</value></property>
<property><name>fs.har.impl.disable.cache</name><value>true</value></property>
<property><name>dfs.safemode.threshold.pct</name><value>0.999f</value></property>
@@ -125,7 +125,7 @@
<property><name>mapred.map.output.compression.codec</name><value>org.apache.hadoop.io.compress.DefaultCodec</value></property>
<property><name>mapred.tasktracker.dns.interface</name><value>default</value></property>
<property><name>dfs.namenode.decommission.interval</name><value>3</value></property>
-<property><name>dfs.http.address</name><value>localhost:49298</value></property>
+<property><name>dfs.http.address</name><value>localhost:55117</value></property>
<property><name>dfs.heartbeat.interval</name><value>3</value></property>
<property><name>mapred.job.tracker</name><value>local</value></property>
<property><name>io.seqfile.sorter.recordlimit</name><value>1000000</value></property>
diff --git a/genomix/genomix-hadoop/actual/result2/.part-00000.crc b/genomix/genomix-hadoop/actual/result2/.part-00000.crc
index 190ef20..7a34e25 100755
--- a/genomix/genomix-hadoop/actual/result2/.part-00000.crc
+++ b/genomix/genomix-hadoop/actual/result2/.part-00000.crc
Binary files differ
diff --git a/genomix/genomix-hadoop/actual/result2/part-00000 b/genomix/genomix-hadoop/actual/result2/part-00000
index bd04159..1f33880 100755
--- a/genomix/genomix-hadoop/actual/result2/part-00000
+++ b/genomix/genomix-hadoop/actual/result2/part-00000
@@ -1,6 +1,6 @@
1 33 1
3 1 1
-4 153 1
+4 -103 2
12 18 1
16 18 1
19 16 1
diff --git a/genomix/genomix-hadoop/expected/result2 b/genomix/genomix-hadoop/expected/result2
index 6ead1cc..bc7bc64 100755
--- a/genomix/genomix-hadoop/expected/result2
+++ b/genomix/genomix-hadoop/expected/result2
@@ -1,6 +1,6 @@
1 33 1
3 1 1
-4 153 1
+4 -103 2
12 18 1
16 18 1
19 16 1
diff --git a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixCombiner.java b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixCombiner.java
index 5f4d991..dadbb9a 100755
--- a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixCombiner.java
+++ b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixCombiner.java
@@ -1,24 +1,53 @@
package edu.uci.ics.graphbuilding;
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.io.IOException;
import java.util.Iterator;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.VLongWritable;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;
+/**
+ * This class implement the combiner operator of Mapreduce model
+ */
public class GenomixCombiner extends MapReduceBase implements
- Reducer<LongWritable, IntWritable, LongWritable, IntWritable> {
- public void reduce(LongWritable key, Iterator<IntWritable> values,
- OutputCollector<LongWritable, IntWritable> output, Reporter reporter) throws IOException {
- int groupByAdjList = 0;
+ Reducer<VLongWritable, ValueWritable, VLongWritable, ValueWritable> {
+ public ValueWritable vaWriter = new ValueWritable();
+
+ @Override
+ public void reduce(VLongWritable key, Iterator<ValueWritable> values,
+ OutputCollector<VLongWritable, ValueWritable> output, Reporter reporter) throws IOException {
+ byte groupByAdjList = 0;
+ int count = 0;
+ byte bytCount = 0;
while (values.hasNext()) {
//Merge By the all adjacent Nodes;
- groupByAdjList = groupByAdjList | values.next().get();
+ groupByAdjList = (byte) (groupByAdjList | values.next().getFirst());
+ count = count + 1;
}
- output.collect(key, new IntWritable(groupByAdjList));
+ if (count >= 128)
+ bytCount = (byte) 128;
+ else
+ bytCount = (byte) count;
+ vaWriter.set(groupByAdjList, bytCount);
+ output.collect(key, vaWriter);
}
}
diff --git a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixDriver.java b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixDriver.java
index 9c8a689..67c4e09 100755
--- a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixDriver.java
+++ b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixDriver.java
@@ -1,5 +1,19 @@
package edu.uci.ics.graphbuilding;
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.io.IOException;
import org.apache.hadoop.fs.FileSystem;
@@ -7,6 +21,7 @@
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
+import org.apache.hadoop.io.VLongWritable;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
@@ -16,6 +31,9 @@
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
+/**
+ * This class implement driver which start the mapreduce program for graphbuilding
+ */
@SuppressWarnings("deprecation")
public class GenomixDriver {
private static class Options {
@@ -27,11 +45,17 @@
@Option(name = "-num-reducers", usage = "the number of reducers", required = true)
public int numReducers;
+
+ @Option(name = "-kmer-size", usage = "the size of kmer", required = true)
+ public int sizeKmer;
}
- public void run(String inputPath, String outputPath, int numReducers, String defaultConfPath) throws IOException {
+ public void run(String inputPath, String outputPath, int numReducers, int sizeKmer, String defaultConfPath)
+ throws IOException {
JobConf conf = new JobConf(GenomixDriver.class);
+ conf.setInt("sizeKmer", sizeKmer);
+
if (defaultConfPath != null) {
conf.addResource(new Path(defaultConfPath));
}
@@ -41,12 +65,12 @@
conf.setReducerClass(GenomixReducer.class);
conf.setCombinerClass(GenomixCombiner.class);
- conf.setMapOutputKeyClass(LongWritable.class);
- conf.setMapOutputValueClass(IntWritable.class);
+ conf.setMapOutputKeyClass(VLongWritable.class);
+ conf.setMapOutputValueClass(ValueWritable.class);
conf.setInputFormat(TextInputFormat.class);
conf.setOutputFormat(TextOutputFormat.class);
- conf.setOutputKeyClass(LongWritable.class);
+ conf.setOutputKeyClass(VLongWritable.class);
conf.setOutputValueClass(ValueWritable.class);
FileInputFormat.setInputPaths(conf, new Path(inputPath));
FileOutputFormat.setOutputPath(conf, new Path(outputPath));
@@ -62,7 +86,7 @@
CmdLineParser parser = new CmdLineParser(options);
parser.parseArgument(args);
GenomixDriver driver = new GenomixDriver();
- driver.run(options.inputPath, options.outputPath, options.numReducers, null);
+ driver.run(options.inputPath, options.outputPath, options.numReducers, options.sizeKmer, null);
}
}
diff --git a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixMapper.java b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixMapper.java
index aff4e6d..367370e 100755
--- a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixMapper.java
+++ b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixMapper.java
@@ -1,85 +1,94 @@
package edu.uci.ics.graphbuilding;
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
+import org.apache.hadoop.io.VLongWritable;
+import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;
-public class GenomixMapper extends MapReduceBase implements Mapper<LongWritable, Text, LongWritable, IntWritable> {
+/**
+ * This class implement mapper operator of mapreduce model
+ */
+public class GenomixMapper extends MapReduceBase implements Mapper<LongWritable, Text, VLongWritable, ValueWritable> {
- public static final int KMER_SIZE = 3; //User Specify
- // private Text Map_Pair_Key = new Text();
+ public static int KMER_SIZE;
+ public ValueWritable outputAdjList = new ValueWritable();
+ public VLongWritable outputKmer = new VLongWritable();
- /*precursor node
+ @Override
+ public void configure(JobConf job) {
+ KMER_SIZE = Integer.parseInt(job.get("sizeKmer"));
+ }
+
+ /*succeed node
A 00000001 1
G 00000010 2
C 00000100 4
T 00001000 8
- succeed node
+ precursor node
A 00010000 16
G 00100000 32
C 01000000 64
T 10000000 128*/
- public void map(LongWritable key, Text value, OutputCollector<LongWritable, IntWritable> output, Reporter reporter)
- throws IOException {
+ @Override
+ public void map(LongWritable key, Text value, OutputCollector<VLongWritable, ValueWritable> output,
+ Reporter reporter) throws IOException {
/* A 00
G 01
C 10
T 11*/
- try {
- String geneLine = value.toString(); // Read the Real Gene Line
- Pattern genePattern = Pattern.compile("[AGCT]+");
- Matcher geneMatcher = genePattern.matcher(geneLine);
- boolean isValid = geneMatcher.matches();
- if (isValid == true) {
- long kmerValue = 0;
- long PreMarker = -1;
- //Initialization: get the first kmer of this geneLine
- for (int i = 0; i < KMER_SIZE; i++) {
- kmerValue = (kmerValue << 2);
- switch (geneLine.charAt(i)) {
- case 'A':
- kmerValue = kmerValue + 0;
- break;
- case 'G':
- kmerValue = kmerValue + 1;
- break;
- case 'C':
- kmerValue = kmerValue + 2;
- break;
- case 'T':
- kmerValue = kmerValue + 3;
- break;
- }
- }
- int i;
- //Get the next kmer by shiftint one letter every time
- for (i = KMER_SIZE; i < geneLine.length(); i++) {
- LongWritable outputKmer = new LongWritable(kmerValue);
- int kmerAdjList = 0;
- //Get the precursor node using the premarker
+ String geneLine = value.toString(); // Read the Real Gene Line
+ Pattern genePattern = Pattern.compile("[AGCT]+");
+ Matcher geneMatcher = genePattern.matcher(geneLine);
+ boolean isValid = geneMatcher.matches();
+ int i = 0;
+ if (isValid == true) {
+ long kmerValue = 0;
+ long PreMarker = -1;
+ byte count = 0;
+ //Get the next kmer by shiftint one letter every time
+ for (i = 0; i < geneLine.length(); i++) {
+ byte kmerAdjList = 0;
+ if (i >= KMER_SIZE) {
+ outputKmer.set(kmerValue);
switch ((int) PreMarker) {
case -1:
- kmerAdjList = kmerAdjList + 0;
+ kmerAdjList = (byte) (kmerAdjList + 0);
break;
case 0:
- kmerAdjList = kmerAdjList + 16;
+ kmerAdjList = (byte) (kmerAdjList + 16);
break;
case 16:
- kmerAdjList = kmerAdjList + 32;
+ kmerAdjList = (byte) (kmerAdjList + 32);
break;
case 32:
- kmerAdjList = kmerAdjList + 64;
+ kmerAdjList = (byte) (kmerAdjList + 64);
break;
case 48:
- kmerAdjList = kmerAdjList + 128;
+ kmerAdjList = (byte) (kmerAdjList + 128);
break;
}
//Update the premarker
@@ -91,51 +100,53 @@
kmerValue = kmerValue << 2;
reset = ~(reset << KMER_SIZE * 2);
kmerValue = kmerValue & reset;
- switch (geneLine.charAt(i)) {
- case 'A':
- kmerAdjList = kmerAdjList + 1;
- kmerValue = kmerValue + 0;
- break;
- case 'G':
- kmerAdjList = kmerAdjList + 2;
- kmerValue = kmerValue + 1;
- break;
- case 'C':
- kmerAdjList = kmerAdjList + 4;
- kmerValue = kmerValue + 2;
- break;
- case 'T':
- kmerAdjList = kmerAdjList + 8;
- kmerValue = kmerValue + 3;
- break;
- }
- IntWritable outputAdjList = new IntWritable(kmerAdjList);
+ }
+ switch (geneLine.charAt(i)) {
+ case 'A':
+ kmerAdjList = (byte) (kmerAdjList + 1);
+ kmerValue = kmerValue + 0;
+ break;
+ case 'G':
+ kmerAdjList = (byte) (kmerAdjList + 2);
+ kmerValue = kmerValue + 1;
+ break;
+ case 'C':
+ kmerAdjList = (byte) (kmerAdjList + 4);
+ kmerValue = kmerValue + 2;
+ break;
+ case 'T':
+ kmerAdjList = (byte) (kmerAdjList + 8);
+ kmerValue = kmerValue + 3;
+ break;
+ }
+ if (i >= KMER_SIZE) {
+ outputAdjList.set(kmerAdjList, count);
output.collect(outputKmer, outputAdjList);
}
- // arrive the last letter of this gene line
- if (i == geneLine.length()) {
- int kmerAdjList = 0;
- switch ((int) PreMarker) {
- case 0:
- kmerAdjList = kmerAdjList + 16;
- break;
- case 16:
- kmerAdjList = kmerAdjList + 32;
- break;
- case 32:
- kmerAdjList = kmerAdjList + 64;
- break;
- case 48:
- kmerAdjList = kmerAdjList + 128;
- break;
- }
- IntWritable outputAdjList = new IntWritable(kmerAdjList);
- LongWritable outputKmer = new LongWritable(kmerValue);
- output.collect(outputKmer, outputAdjList);
- }
+ if (i < KMER_SIZE - 1)
+ kmerValue = (kmerValue << 2);
}
- } catch (Exception e) {
- System.out.println("Exception:" + e);
+ // arrive the last letter of this gene line
+ if (i == geneLine.length()) {
+ byte kmerAdjList = 0;
+ switch ((int) PreMarker) {
+ case 0:
+ kmerAdjList = (byte) (kmerAdjList + 16);
+ break;
+ case 16:
+ kmerAdjList = (byte) (kmerAdjList + 32);
+ break;
+ case 32:
+ kmerAdjList = (byte) (kmerAdjList + 64);
+ break;
+ case 48:
+ kmerAdjList = (byte) (kmerAdjList + 128);
+ break;
+ }
+ outputAdjList.set(kmerAdjList, count);
+ outputKmer.set(kmerValue);
+ output.collect(outputKmer, outputAdjList);
+ }
}
}
-}
+}
\ No newline at end of file
diff --git a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixReducer.java b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixReducer.java
index 244d058..7358ae0 100755
--- a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixReducer.java
+++ b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/GenomixReducer.java
@@ -1,26 +1,51 @@
package edu.uci.ics.graphbuilding;
-
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.io.IOException;
import java.util.Iterator;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.VLongWritable;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;
-
+/**
+ * This class implement reducer operator of mapreduce model
+ */
public class GenomixReducer extends MapReduceBase implements
- Reducer<LongWritable, IntWritable, LongWritable, ValueWritable> {
- public void reduce(LongWritable key, Iterator<IntWritable> values,
- OutputCollector<LongWritable, ValueWritable> output, Reporter reporter) throws IOException {
- int groupByAdjList = 0;
- int count = 0;
- while (values.hasNext()) {
- //Merge By the all adjacent Nodes;
- groupByAdjList = groupByAdjList | values.next().get();
- count++;
- }
- output.collect(key, new ValueWritable(groupByAdjList, count));
- }
+Reducer<VLongWritable, ValueWritable, VLongWritable, ValueWritable> {
+ValueWritable valWriter = new ValueWritable();
+@Override
+public void reduce(VLongWritable key, Iterator<ValueWritable> values,
+ OutputCollector<VLongWritable, ValueWritable> output, Reporter reporter) throws IOException {
+byte groupByAdjList = 0;
+int count = 0;
+byte bytCount = 0;
+while (values.hasNext()) {
+ //Merge By the all adjacent Nodes;
+ ValueWritable geneValue = values.next();
+ groupByAdjList = (byte) (groupByAdjList | geneValue.getFirst());
+ count = count + (int)geneValue.getSecond();
+}
+if(count >= 128)
+ bytCount = (byte)128;
+else
+ bytCount = (byte)count;
+valWriter.set(groupByAdjList, bytCount);
+output.collect(key, valWriter);
+}
}
diff --git a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/ValueWritable.java b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/ValueWritable.java
index 3adac3c..87d9be6 100755
--- a/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/ValueWritable.java
+++ b/genomix/genomix-hadoop/src/main/java/edu/uci/ics/graphbuilding/ValueWritable.java
@@ -1,49 +1,65 @@
package edu.uci.ics.graphbuilding;
-
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.WritableComparable;
-
+/**
+ * This class override the writablecomparable class which contain int varable
+ */
public class ValueWritable implements WritableComparable<ValueWritable> {
- private int first;
- private int second;
+ private byte first;
+ private byte second;
public ValueWritable() {
}
- public ValueWritable(int first, int second) {
+ public ValueWritable(byte first, byte second) {
set(first, second);
}
- public void set(int first, int second) {
+ public void set(byte first, byte second) {
this.first = first;
this.second = second;
}
- public int getFirst() {
+ public byte getFirst() {
return first;
}
- public int getSecond() {
+ public byte getSecond() {
return second;
}
+ @Override
public void write(DataOutput out) throws IOException {
- out.writeInt(first);
- out.writeInt(second);
+ out.writeByte(first);
+ out.writeByte(second);
}
-
+ @Override
public void readFields(DataInput in) throws IOException {
- first = in.readInt();
- second = in.readInt();
+ first = in.readByte();
+ second = in.readByte();
}
-
+ @Override
public int hashCode() {
- return first + second;
+ return (int) first + (int) second;
}
-
+ @Override
public boolean equals(Object o) {
if (o instanceof ValueWritable) {
ValueWritable tp = (ValueWritable) o;
@@ -51,11 +67,11 @@
}
return false;
}
-
+ @Override
public String toString() {
return Integer.toString(first) + "\t" + Integer.toString(second);
}
-
+ @Override
public int compareTo(ValueWritable tp) {
int cmp;
if (first == tp.first)
diff --git a/genomix/genomix-hadoop/src/test/java/edu/uci/ics/graphbuilding/GraphBuildingTest.java b/genomix/genomix-hadoop/src/test/java/edu/uci/ics/graphbuilding/GraphBuildingTest.java
index 783ecf4..0095fe9 100755
--- a/genomix/genomix-hadoop/src/test/java/edu/uci/ics/graphbuilding/GraphBuildingTest.java
+++ b/genomix/genomix-hadoop/src/test/java/edu/uci/ics/graphbuilding/GraphBuildingTest.java
@@ -1,5 +1,18 @@
package edu.uci.ics.graphbuilding;
-
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
@@ -15,7 +28,9 @@
import org.junit.Test;
import edu.uci.ics.utils.TestUtils;
-
+/**
+ * This class test the correctness of graphbuilding program
+ */
public class GraphBuildingTest {
private static final String ACTUAL_RESULT_DIR = "actual";
@@ -39,7 +54,7 @@
// run graph transformation tests
GenomixDriver tldriver = new GenomixDriver();
- tldriver.run(HDFS_PATH, RESULT_PATH, 2, HADOOP_CONF_PATH);
+ tldriver.run(HDFS_PATH, RESULT_PATH, 2, 3, HADOOP_CONF_PATH);
dumpResult();
TestUtils.compareWithResult(new File(DUMPED_RESULT), new File(EXPECTED_PATH));
diff --git a/genomix/genomix-hadoop/src/test/java/edu/uci/ics/utils/TestUtils.java b/genomix/genomix-hadoop/src/test/java/edu/uci/ics/utils/TestUtils.java
index 0455b14..e63aa5b 100755
--- a/genomix/genomix-hadoop/src/test/java/edu/uci/ics/utils/TestUtils.java
+++ b/genomix/genomix-hadoop/src/test/java/edu/uci/ics/utils/TestUtils.java
@@ -1,9 +1,24 @@
package edu.uci.ics.utils;
-
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
-
+/**
+ * This class offer the service for graphbuildingtest.class
+ */
public class TestUtils {
public static void compareWithResult(File expectedFile, File actualFile) throws Exception {
BufferedReader readerExpected = new BufferedReader(new FileReader(expectedFile));