0

I am using eclipse to write mapreduce program. I imported hadoop library (hadoop-0.13.0-core.jar)

I imported Mapper class import org.apache.hadoop.mapred.Mapper; there is no error in this but when I wrote this program source of this is http://developer.yahoo.com/hadoop/tutorial/module3.html

public class WordCountMapper extends MapReduceBase
    implements Mapper<LongWritable, Text, Text, IntWritable> {

  private final IntWritable one = new IntWritable(1);
  private Text word = new Text();

  public void map(WritableComparable key, Writable value,
      OutputCollector output, Reporter reporter) throws IOException {

    String line = value.toString();
    StringTokenizer itr = new StringTokenizer(line.toLowerCase());
    while(itr.hasMoreTokens()) {
      word.set(itr.nextToken());
      output.collect(word, one);
    }
  }
}

it gives me error The type Mapper is not generic; it cannot be parameterized with arguments

Taryn
  • 242,637
  • 56
  • 362
  • 405
big
  • 1,888
  • 7
  • 28
  • 48

1 Answers1

1

You need to use the version 0.19 of Hadoop. There have been some changes introduced in the API and that code does work with newer versions. Not 0.20 though.

alvaro
  • 26
  • 1