MapReduce案例-wordcount-Map阶段代码

public class WordCountMapper extends
	Mapper {
	
	@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阶段代码)