org.apache.mahout.cf.taste.hadoop.pseudo
Class RecommenderReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<VarLongWritable,org.apache.hadoop.io.NullWritable,VarLongWritable,RecommendedItemsWritable>
      extended by org.apache.mahout.cf.taste.hadoop.pseudo.RecommenderReducer

public final class RecommenderReducer
extends org.apache.hadoop.mapreduce.Reducer<VarLongWritable,org.apache.hadoop.io.NullWritable,VarLongWritable,RecommendedItemsWritable>

The Reducer which takes as input the user IDs parsed out by the map phase, and for each unique user ID, computes recommendations with the configured Recommender. The results are output as RecommendedItemsWritable.

See Also:
RecommenderJob

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Constructor Summary
RecommenderReducer()
           
 
Method Summary
protected  void reduce(VarLongWritable key, Iterable<org.apache.hadoop.io.NullWritable> values, org.apache.hadoop.mapreduce.Reducer.Context context)
           
protected  void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.Reducer
cleanup, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecommenderReducer

public RecommenderReducer()
Method Detail

setup

protected void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
              throws IOException
Overrides:
setup in class org.apache.hadoop.mapreduce.Reducer<VarLongWritable,org.apache.hadoop.io.NullWritable,VarLongWritable,RecommendedItemsWritable>
Throws:
IOException

reduce

protected void reduce(VarLongWritable key,
                      Iterable<org.apache.hadoop.io.NullWritable> values,
                      org.apache.hadoop.mapreduce.Reducer.Context context)
               throws IOException,
                      InterruptedException
Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<VarLongWritable,org.apache.hadoop.io.NullWritable,VarLongWritable,RecommendedItemsWritable>
Throws:
IOException
InterruptedException


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.