hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tjungb...@apache.org
Subject svn commit: r1342941 - in /incubator/hama/trunk: examples/src/main/java/org/apache/hama/examples/ graph/src/main/java/org/apache/hama/graph/
Date Sat, 26 May 2012 18:26:16 GMT
Author: tjungblut
Date: Sat May 26 18:26:16 2012
New Revision: 1342941

URL: http://svn.apache.org/viewvc?rev=1342941&view=rev
Log:
small fixes

Modified:
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
    incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java
    incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/AbsDiffAggregator.java
    incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java

Modified: incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java?rev=1342941&r1=1342940&r2=1342941&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
(original)
+++ incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/ExampleDriver.java
Sat May 26 18:26:16 2012
@@ -33,6 +33,7 @@ public class ExampleDriver {
       pgd.addClass("cmb", CombineExample.class, "Combine");
       pgd.addClass("bench", RandBench.class, "Random Benchmark");
       pgd.addClass("pagerank", PageRank.class, "PageRank");
+      pgd.addClass("inlnkcount", InlinkCount.class, "InlinkCount");
       pgd.driver(args);
     } catch (Throwable e) {
       e.printStackTrace();

Modified: incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java?rev=1342941&r1=1342940&r2=1342941&view=diff
==============================================================================
--- incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java
(original)
+++ incubator/hama/trunk/examples/src/main/java/org/apache/hama/examples/InlinkCount.java
Sat May 26 18:26:16 2012
@@ -77,8 +77,17 @@ public class InlinkCount extends Vertex<
 
   }
 
+  private static void printUsage() {
+    System.out.println("Usage: <input> <output> [tasks]");
+    System.exit(-1);
+  }
+
   public static void main(String[] args) throws IOException,
       InterruptedException, ClassNotFoundException {
+
+    if (args.length < 2)
+      printUsage();
+
     // Graph job configuration
     HamaConfiguration conf = new HamaConfiguration();
     GraphJob inlinkJob = new GraphJob(conf, InlinkCount.class);

Modified: incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/AbsDiffAggregator.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/AbsDiffAggregator.java?rev=1342941&r1=1342940&r2=1342941&view=diff
==============================================================================
--- incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/AbsDiffAggregator.java
(original)
+++ incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/AbsDiffAggregator.java
Sat May 26 18:26:16 2012
@@ -38,6 +38,14 @@ public class AbsDiffAggregator extends
     }
   }
 
+  // we a master aggregates he aggregated values, he calls this, so let's just
+  // sum up here.
+  @Override
+  public void aggregate(Vertex<?, DoubleWritable, ?> vertex,
+      DoubleWritable value) {
+    absoluteDifference += value.get();
+  }
+
   @Override
   public DoubleWritable getValue() {
     return new DoubleWritable(absoluteDifference);

Modified: incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java?rev=1342941&r1=1342940&r2=1342941&view=diff
==============================================================================
--- incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java (original)
+++ incubator/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java Sat
May 26 18:26:16 2012
@@ -220,10 +220,11 @@ public final class GraphJobRunner<VERTEX
               new IntWritable(Integer.MIN_VALUE));
         } else {
           if (aggregators != null) {
+            // work through the master aggregators
             for (int i = 0; i < masterAggregator.length; i++) {
               Writable lastAggregatedValue = masterAggregator[i].getValue();
               if (isAbstractAggregator[i]) {
-                final AbstractAggregator<VERTEX_VALUE, Vertex<VERTEX_ID, VERTEX_VALUE,
EDGE_VALUE_TYPE>> intern = ((AbstractAggregator<VERTEX_VALUE, Vertex<VERTEX_ID,
VERTEX_VALUE, EDGE_VALUE_TYPE>>) aggregators[i]);
+                final AbstractAggregator<VERTEX_VALUE, Vertex<VERTEX_ID, VERTEX_VALUE,
EDGE_VALUE_TYPE>> intern = ((AbstractAggregator<VERTEX_VALUE, Vertex<VERTEX_ID,
VERTEX_VALUE, EDGE_VALUE_TYPE>>) masterAggregator[i]);
                 final Writable finalizeAggregation = intern
                     .finalizeAggregation();
                 if (intern.finalizeAggregation() != null) {



Mime
View raw message