public class WordCountMapper extends
Mapper<LongWritable,Text,Text,LongWritable> {
@Override
public void map(LongWritable key, Text value, Context context) throws
IOException, InterruptedException {
String line = value.toString();
String[] split = line.split(",");
for (String word : split) {
context.write(new Text(word),new LongWritable(1));
}
}
}
MapReduce案例-wordcount-Map阶段代码
猜你喜欢
转载自blog.csdn.net/Leon_Jinhai_Sun/article/details/104486040
今日推荐
周排行