mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r985331 - in /mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity: RowSimilarityJob.java SimilarityMatrixEntryKey.java
Date Fri, 13 Aug 2010 19:32:53 GMT
Author: srowen
Date: Fri Aug 13 19:32:53 2010
New Revision: 985331

URL: http://svn.apache.org/viewvc?rev=985331&view=rev
Log:
MAHOUT-477

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/RowSimilarityJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/RowSimilarityJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/RowSimilarityJob.java?rev=985331&r1=985330&r2=985331&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/RowSimilarityJob.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/RowSimilarityJob.java
Fri Aug 13 19:32:53 2010
@@ -32,6 +32,7 @@ import org.apache.hadoop.mapreduce.Mappe
 import org.apache.hadoop.mapreduce.Reducer;
 import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
 import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
+import org.apache.hadoop.mapreduce.lib.partition.HashPartitioner;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.mahout.common.AbstractJob;
 import org.apache.mahout.math.RandomAccessSparseVector;
@@ -167,7 +168,7 @@ public class RowSimilarityJob extends Ab
                                IntWritable.class,
                                VectorWritable.class,
                                SequenceFileOutputFormat.class);
-      asMatrix.setPartitionerClass(SimilarityMatrixEntryKey.SimilarityMatrixEntryKeyPartitioner.class);
+      asMatrix.setPartitionerClass(HashPartitioner.class);
       asMatrix.setGroupingComparatorClass(SimilarityMatrixEntryKey.SimilarityMatrixEntryKeyGroupingComparator.class);
       asMatrix.getConfiguration().setInt(MAX_SIMILARITIES_PER_ROW, maxSimilaritiesPerRow);
       asMatrix.waitForCompletion(true);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java?rev=985331&r1=985330&r2=985331&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
Fri Aug 13 19:32:53 2010
@@ -23,9 +23,7 @@ import java.io.IOException;
 
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.io.WritableComparator;
-import org.apache.hadoop.mapreduce.Partitioner;
 import org.apache.mahout.math.Varint;
-import org.apache.mahout.math.hadoop.DistributedRowMatrix.MatrixEntryWritable;
 import org.apache.mahout.math.hadoop.similarity.RowSimilarityJob.EntriesToVectorsReducer;
 
 /**
@@ -114,14 +112,6 @@ public class SimilarityMatrixEntryKey im
     }
   }
 
-  public static class SimilarityMatrixEntryKeyPartitioner
-      extends Partitioner<SimilarityMatrixEntryKey,MatrixEntryWritable> {
-    @Override
-    public int getPartition(SimilarityMatrixEntryKey key, MatrixEntryWritable value, int
numPartitions) {
-      return (key.hashCode() * 127) % numPartitions;
-    }
-  }
-
   public static class SimilarityMatrixEntryKeyGroupingComparator extends WritableComparator
{
 
     protected SimilarityMatrixEntryKeyGroupingComparator() {



Mime
View raw message