combiner
作者:互联网
定义:
继承Reducer类,Combiner就是一个Reducer,但是处理的是某一个map的输出数据
数据写出到reducer了
job.setCombinerClass(WCCombiner.class);
// 输入类型是map阶段的输出类型,输出类型一般是map阶段的输出类型
class WCCombiner extends Reducer<Text, LongWritable, Text, LongWritable> {
@Override
protected void reduce(Text key, Iterable<LongWritable> values, Context context) {
合并操作
}
}
标签:map,combiner,输出,Reducer,类型,class,WCCombiner 来源: https://www.cnblogs.com/jsqup/p/16534784.html