Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
MapReduce >> mail # user >> objects as key/values


Copy link to this message
-
objects as key/values
Ok.
  A very basic (stupid) question.
I am trying to compute mean using hadoop.

So my implementation is like this:

public class Mean
 public static class Pair{
  //simple class to create object
}
 public class MeanMapper<LongWritable, Text,Text, Pair>
   emit(text,pair) //where pair is (local sum, count)

 public class MeanReducer<Text, Pair, Text DoubleWritable>
    emit (text, mean)

Unfortunately such approach of creating custom class types are not working
since in job I have to set the output type for mapper/reducer...
How are custom key values pair implemented in hadoop?