首页 > 其他 > 详细

按照艺术家分组并输出某个艺术家的唯一键-值对

时间:2016-03-06 10:02:20      阅读:103      评论:0      收藏:0      [点我收藏+]
<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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!