Hi pols,
>
>
> I Have set the input format to be TextInputFormat.class (is this right?)
> Please tell me what signature am I supposed to use for the Map/ reduce
> methods?
> as of now I am trying to write the Map function as
>
> public static class Map extends MapReduceBase implements
> Mapper<LongWritable, FloatWritable, Text, FloatWritable>
> {
> public void map(LongWritable key, FloatWritable value,
> OutputCollector<Text, FloatWritable> output, Reporter reporter) throws
> IOException
> { ...........
> ..........
> }
> }
>
> But I am getting an error saying text cannot be cast to longwritable.
Unfortunately no, you are wrong. The default key-value type for
TextInputFormat is <LongWritable, Text>. A type named LineRecordReader,
which implmented a method LineRecordeReader.next(LongWritable key, Text
value), is the default reader of TextInputFormat. If you wanna change the
key-value type that reveived in map function, you can define your own
InputFormat and RecordReader.
--
My research interests are distributed systems, parallel computing and
bytecode based virtual machine.
http://coderplay.javaeye.com