标签:
<strong><span style="font-size:18px;">/*** * @author YangXin * @info 按照艺术家分组并输出某个艺术家的唯一键-值对 * Mapper输出艺术家,而Reducer只输出唯一的艺术家并丢弃空的字符值。 */ package unitTwelve; import java.io.IOException; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Reducer; public class DirectoryReducer extends Reducer<Text, IntWritable, Text, IntWritable>{ @Override protected void reduce(Text artist, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException{ context.write(artist, new IntWritable(0)); } } </span></strong>
标签:
原文地址:http://blog.csdn.net/u012965373/article/details/50811625