mapreduce自定义计数器
1.枚举
声明:enum Counter
{
LINESKIP;
}
使用:context.getCounter(Counter.LINESKIP).increment(1);
2.动态声明
声明:final Counter count=context.getCounter(String groupName,String counterName)
举例:final Counter count=context.getCounter(“敏感词汇”,“党”) ;
使用:if(lines.toString.contains("党"))
count.increment(1);

浙公网安备 33010602011771号