mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeast...@apache.org
Subject svn commit: r793974 - /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
Date Tue, 14 Jul 2009 16:57:36 GMT
Author: jeastman
Date: Tue Jul 14 16:57:36 2009
New Revision: 793974

URL: http://svn.apache.org/viewvc?rev=793974&view=rev
Log:
- added test that names begin with "part" to isConverged() valid file test

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java?rev=793974&r1=793973&r2=793974&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
Tue Jul 14 16:57:36 2009
@@ -299,8 +299,9 @@
    */
   private static boolean isConverged(String filePath, JobConf conf, FileSystem fs) throws
IOException {
     FileStatus[] parts = fs.listStatus(new Path(filePath));
-    for (FileStatus part : parts)
-      if (!part.getPath().getName().endsWith(".crc")) {
+    for (FileStatus part : parts) {
+      String name = part.getPath().getName();
+      if (name.startsWith("part") && !name.endsWith(".crc")) {
         SequenceFile.Reader reader = new SequenceFile.Reader(fs, part.getPath(), conf);
         Writable key;
         try {
@@ -319,6 +320,7 @@
           }
         }
       }
+    }
     return true;
   }
 }



Mime
View raw message