hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1560607 - in /hama/trunk/graph/src/test/java/org/apache/hama/graph: TestSubmitGraphJob.java example/PageRank.java
Date Thu, 23 Jan 2014 08:37:02 GMT
Author: edwardyoon
Date: Thu Jan 23 08:37:01 2014
New Revision: 1560607

URL: http://svn.apache.org/r1560607
Log:
Fix unit test of PageRank.

Modified:
    hama/trunk/graph/src/test/java/org/apache/hama/graph/TestSubmitGraphJob.java
    hama/trunk/graph/src/test/java/org/apache/hama/graph/example/PageRank.java

Modified: hama/trunk/graph/src/test/java/org/apache/hama/graph/TestSubmitGraphJob.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/test/java/org/apache/hama/graph/TestSubmitGraphJob.java?rev=1560607&r1=1560606&r2=1560607&view=diff
==============================================================================
--- hama/trunk/graph/src/test/java/org/apache/hama/graph/TestSubmitGraphJob.java (original)
+++ hama/trunk/graph/src/test/java/org/apache/hama/graph/TestSubmitGraphJob.java Thu Jan 23
08:37:01 2014
@@ -85,7 +85,7 @@ public class TestSubmitGraphJob extends 
     // set the defaults
     bsp.setMaxIteration(30);
 
-    bsp.registerAggregator("avg", AverageAggregator.class);
+    bsp.setAggregatorClass(AverageAggregator.class);
 
     bsp.setInputFormat(SequenceFileInputFormat.class);
     bsp.setInputKeyClass(Text.class);

Modified: hama/trunk/graph/src/test/java/org/apache/hama/graph/example/PageRank.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/test/java/org/apache/hama/graph/example/PageRank.java?rev=1560607&r1=1560606&r2=1560607&view=diff
==============================================================================
--- hama/trunk/graph/src/test/java/org/apache/hama/graph/example/PageRank.java (original)
+++ hama/trunk/graph/src/test/java/org/apache/hama/graph/example/PageRank.java Thu Jan 23
08:37:01 2014
@@ -74,7 +74,7 @@ public class PageRank {
       }
 
       // if we have not reached our global error yet, then proceed.
-      DoubleWritable globalError = (DoubleWritable) getAggregatedValue("avg");
+      DoubleWritable globalError = this.getLastAggregatedValue(0);
       if (globalError != null && this.getSuperstepCount() > 2
           && MAXIMUM_CONVERGENCE_ERROR > globalError.get()) {
         voteToHalt();
@@ -84,10 +84,7 @@ public class PageRank {
       // in each superstep we are going to send a new rank to our neighbours
       sendMessageToNeighbors(new DoubleWritable(this.getValue().get()
           / this.getEdges().size()));
-
-      this.aggregate("avg", this.getValue());
     }
-
   }
 
   public static class PagerankSeqReader
@@ -128,7 +125,7 @@ public class PageRank {
     }
 
     // error
-    pageJob.registerAggregator("avg", AverageAggregator.class);
+    pageJob.setAggregatorClass(AverageAggregator.class);
 
     // Vertex reader
     pageJob.setVertexInputReaderClass(PagerankSeqReader.class);



Mime
View raw message