You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sm...@apache.org on 2013/06/10 04:40:26 UTC

svn commit: r1491329 - /mahout/trunk/core/src/main/java/org/apache/mahout/clustering/topdown/postprocessor/ClusterOutputPostProcessor.java

Author: smarthi
Date: Mon Jun 10 02:40:26 2013
New Revision: 1491329

URL: http://svn.apache.org/r1491329
Log:
MAHOUT-1103: properly partition the data for MapReduce - code cleanup based on review, instantiate Maps with Maps.newHashMap()

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/topdown/postprocessor/ClusterOutputPostProcessor.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/topdown/postprocessor/ClusterOutputPostProcessor.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/topdown/postprocessor/ClusterOutputPostProcessor.java?rev=1491329&r1=1491328&r2=1491329&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/topdown/postprocessor/ClusterOutputPostProcessor.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/topdown/postprocessor/ClusterOutputPostProcessor.java Mon Jun 10 02:40:26 2013
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.clustering.topdown.postprocessor;
 
+import com.google.common.collect.Maps;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -34,7 +35,6 @@ import org.apache.mahout.common.iterator
 import org.apache.mahout.math.VectorWritable;
 
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -53,7 +53,7 @@ public final class ClusterOutputPostProc
   private final FileSystem fileSystem;
   private final Configuration conf;
   private final Path clusterPostProcessorOutput;
-  private final Map<String, Path> postProcessedClusterDirectories = new HashMap<String, Path>();
+  private final Map<String, Path> postProcessedClusterDirectories = Maps.newHashMap();
   private long uniqueVectorId = 0L;
   private final Map<String, SequenceFile.Writer> writersForClusters;
 
@@ -63,7 +63,7 @@ public final class ClusterOutputPostProc
     this.clusterPostProcessorOutput = output;
     this.clusteredPoints = PathDirectory.getClusterOutputClusteredPoints(clusterOutputToBeProcessed);
     this.conf = hadoopConfiguration;
-    this.writersForClusters = new HashMap<String, SequenceFile.Writer>();
+    this.writersForClusters = Maps.newHashMap();
     fileSystem = clusteredPoints.getFileSystem(conf);
   }