我正在使用eclipse编写mapreduce程序。我导入了hadoop库(hadoop-0.13.0-core.jar)
我导入了 Mapper 类 import org.apache.hadoop.mapred.Mapper; 这没有错误,但是当我编写这个程序时,它的源代码是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);
}
}
}
它给了我错误类型映射器不是通用的;它不能用参数参数化