You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by dl...@apache.org on 2011/09/23 01:46:23 UTC

svn commit: r1174452 - in /mahout/trunk/core/src: main/java/org/apache/mahout/math/hadoop/stochasticsvd/qr/QRFirstStep.java test/java/org/apache/mahout/math/hadoop/stochasticsvd/LocalSSVDSolverDenseTest.java

Author: dlyubimov
Date: Thu Sep 22 23:46:22 2011
New Revision: 1174452

URL: http://svn.apache.org/viewvc?rev=1174452&view=rev
Log:
MAHOUT-814 (patch rev.1)

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/qr/QRFirstStep.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/stochasticsvd/LocalSSVDSolverDenseTest.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/qr/QRFirstStep.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/qr/QRFirstStep.java?rev=1174452&r1=1174451&r2=1174452&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/qr/QRFirstStep.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/qr/QRFirstStep.java Thu Sep 22 23:46:22 2011
@@ -54,7 +54,8 @@ import com.google.common.io.Closeables;
  * 
  */
 @SuppressWarnings("deprecation")
-public class QRFirstStep implements Closeable, OutputCollector<Writable, Vector> {
+public class QRFirstStep implements Closeable,
+    OutputCollector<Writable, Vector> {
 
   public static final String PROP_K = "ssvd.k";
   public static final String PROP_P = "ssvd.p";
@@ -259,7 +260,9 @@ public class QRFirstStep implements Clos
       // then at least it is always sequential.
       String taskTmpDir = System.getProperty("java.io.tmpdir");
       FileSystem localFs = FileSystem.getLocal(jobConf);
-      tempQPath = new Path(new Path(taskTmpDir), "q-temp.seq");
+      tempQPath =
+        new Path(new Path(taskTmpDir),
+                 String.format("q-temp-%d.seq", System.currentTimeMillis()));
       tempQw =
         SequenceFile.createWriter(localFs,
                                   jobConf,
@@ -277,7 +280,6 @@ public class QRFirstStep implements Clos
   @Override
   public void collect(Writable key, Vector vw) throws IOException {
     map(key, vw);
-
   }
 
 }

Modified: mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/stochasticsvd/LocalSSVDSolverDenseTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/stochasticsvd/LocalSSVDSolverDenseTest.java?rev=1174452&r1=1174451&r2=1174452&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/stochasticsvd/LocalSSVDSolverDenseTest.java (original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/stochasticsvd/LocalSSVDSolverDenseTest.java Thu Sep 22 23:46:22 2011
@@ -44,9 +44,9 @@ public class LocalSSVDSolverDenseTest ex
   private static final double s_epsilon = 1.0E-10d;
 
   // I actually never saw errors more than 3% worst case for this test,
-  // but since it's non-deterministic test, it still may ocasionally produce
+  // but since it's non-deterministic test, it still may occasionally produce
   // bad results with a non-zero probability, so i put this pct% for error
-  // margin higher so it never fails.
+  // margin high enough so it (almost) never fails.
   private static final double s_precisionPct = 10;
 
   @Test
@@ -112,9 +112,6 @@ public class LocalSSVDSolverDenseTest ex
 
     Path svdOutPath = new Path(tempDirPath, "SSVD-out");
 
-    // make sure we wipe out previous test results, just a convenience
-    fs.delete(svdOutPath, true);
-
     // Solver starts here:
     System.out.println("Input prepared, starting solver...");