incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1202965 - in /incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples: ShortestPathVertex.java ShortestPaths.java
Date Thu, 17 Nov 2011 01:10:44 GMT
Author: edwardyoon
Date: Thu Nov 17 01:10:43 2011
New Revision: 1202965

URL: http://svn.apache.org/viewvc?rev=1202965&view=rev
Log:
ShortestPathVertex need to be WritableComparable.

Modified:
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPathVertex.java
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPaths.java

Modified: incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPathVertex.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPathVertex.java?rev=1202965&r1=1202964&r2=1202965&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPathVertex.java
(original)
+++ incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPathVertex.java
Thu Nov 17 01:10:43 2011
@@ -20,9 +20,12 @@ package org.apache.hama.examples;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
+
+import org.apache.hadoop.io.WritableComparable;
 import org.apache.hama.graph.Vertex;
 
-public final class ShortestPathVertex extends Vertex {
+public final class ShortestPathVertex extends Vertex implements
+    WritableComparable<ShortestPathVertex> {
 
   private int weight;
   private int cost = Integer.MAX_VALUE;
@@ -74,4 +77,9 @@ public final class ShortestPathVertex ex
     out.writeInt(weight);
   }
 
+  public int compareTo(ShortestPathVertex o) {
+    ShortestPathVertex that = (ShortestPathVertex) o;
+    return this.name.compareTo(that.name);
+  }
+
 }

Modified: incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPaths.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPaths.java?rev=1202965&r1=1202964&r2=1202965&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPaths.java
(original)
+++ incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ShortestPaths.java
Thu Nov 17 01:10:43 2011
@@ -203,7 +203,6 @@ public class ShortestPaths extends
     bsp.setOutputFormat(SequenceFileOutputFormat.class);
     bsp.setOutputKeyClass(Text.class);
     bsp.setOutputValueClass(IntWritable.class);
-    bsp.setNumBspTask(6);
 
     long startTime = System.currentTimeMillis();
     if (bsp.waitForCompletion(true)) {



Mime
View raw message