hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From millec...@apache.org
Subject svn commit: r1556781 - /hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java
Date Thu, 09 Jan 2014 10:35:49 GMT
Author: millecker
Date: Thu Jan  9 10:35:49 2014
New Revision: 1556781

URL: http://svn.apache.org/r1556781
Log:
HAMA-834: Fix KMeans example (K = N issue)

Modified:
    hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java

Modified: hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java
URL: http://svn.apache.org/viewvc/hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java?rev=1556781&r1=1556780&r2=1556781&view=diff
==============================================================================
--- hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java (original)
+++ hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java Thu Jan  9 10:35:49
2014
@@ -489,17 +489,12 @@ public final class KMeansBSP
 
       dataWriter.append(vector, value);
       if (k > i) {
-        assert centerWriter != null;
         centerWriter.append(vector, value);
-      } else {
-        if (centerWriter != null) {
-          centerWriter.close();
-          centerWriter = null;
-        }
       }
       i++;
     }
     br.close();
+    centerWriter.close();
     dataWriter.close();
     return in;
   }
@@ -539,10 +534,9 @@ public final class KMeansBSP
       dataWriter.append(vector, value);
       if (k > i) {
         centerWriter.append(vector, value);
-      } else if (k == i) {
-        centerWriter.close();
       }
     }
+    centerWriter.close();
     dataWriter.close();
   }
 }



Mime
View raw message