hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1397963 - in /hama/trunk: examples/src/main/java/org/apache/hama/examples/GradientDescentExample.java ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
Date Sat, 13 Oct 2012 22:18:28 GMT
Author: tommaso
Date: Sat Oct 13 22:18:28 2012
New Revision: 1397963

URL: http://svn.apache.org/viewvc?rev=1397963&view=rev
Log:
[HAMA-651] - fixed bug in input size reading and removed fixed bsp tasks no. in example

Modified:
    hama/trunk/examples/src/main/java/org/apache/hama/examples/GradientDescentExample.java
    hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java

Modified: hama/trunk/examples/src/main/java/org/apache/hama/examples/GradientDescentExample.java
URL: http://svn.apache.org/viewvc/hama/trunk/examples/src/main/java/org/apache/hama/examples/GradientDescentExample.java?rev=1397963&r1=1397962&r2=1397963&view=diff
==============================================================================
--- hama/trunk/examples/src/main/java/org/apache/hama/examples/GradientDescentExample.java
(original)
+++ hama/trunk/examples/src/main/java/org/apache/hama/examples/GradientDescentExample.java
Sat Oct 13 22:18:28 2012
@@ -17,8 +17,6 @@
  */
 package org.apache.hama.examples;
 
-import java.io.IOException;
-
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -33,6 +31,8 @@ import org.apache.hama.ml.regression.Gra
 import org.apache.hama.ml.regression.VectorDoubleFileInputFormat;
 import org.apache.hama.ml.writable.VectorWritable;
 
+import java.io.IOException;
+
 /**
  * A {@link GradientDescentBSP} job example
  */
@@ -59,7 +59,6 @@ public class GradientDescentExample {
     bsp.setOutputValueClass(DoubleWritable.class);
     bsp.setOutputFormat(TextOutputFormat.class);
     FileOutputFormat.setOutputPath(bsp, TMP_OUTPUT);
-    bsp.setNumBspTask(3);
 
     long startTime = System.currentTimeMillis();
     if (bsp.waitForCompletion(true)) {

Modified: hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
URL: http://svn.apache.org/viewvc/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java?rev=1397963&r1=1397962&r2=1397963&view=diff
==============================================================================
--- hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java (original)
+++ hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java Sat
Oct 13 22:18:28 2012
@@ -215,7 +215,7 @@ public class GradientDescentBSP extends 
     DoubleWritable value = new DoubleWritable();
     peer.readNext(key, value);
     peer.reopenInput(); // reset input to start
-    if (key == null) {
+    if (key.getVector() == null) {
       throw new IOException("cannot read input vector size");
     }
     return key.getVector().getLength();



Mime
View raw message