hadoop counter介绍和自定义counter

来源:互联网 发布:php好难学 编辑:程序博客网 时间:2024/06/13 07:44

示例一个counter

show code

预定义基本的数据描述和分组

public class JobCountersData {    public static final String ALL_OUTPUT_ITEMS = "All Output Items";    public static final String GROUP = "Conuter";       }

使用

context.getCounter(JobCountersData.GROUP,JobCountersData.ALL_OUTPUT_ITEMS).increment(1);


上述示例只是简单统计reduce写出数据条数,

当然可以实现其他的比如reduce端分类统计数据输出条数,只需要加上简单的预定义和判断即可。


hadoop系统也提供了自己的counter,详细介绍见:

http://langyu.iteye.com/blog/1171091


0 0
原创粉丝点击