码迷,mamicode.com
首页 > 其他好文 > 详细

hadoop计数器

时间:2015-09-28 17:32:54      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:

context.getCounter("ssx", "demo1").increment(1);
context.getCounter("ssx", "demo2").increment(2);

CounterGroup group=  job.getCounters().getGroup("ssx");
Iterator<Counter> iterator=  group.iterator();
while (iterator.hasNext())
     {
           Counter counter = (Counter) iterator.next();
           System.out.println(counter.getName()+":::"+counter.getValue());
       }
System.out.println("++++++++++++++++++++++");
Counter counters=job.getCounters().findCounter("ssx", "demo1"); 
long value=counters.getValue();//
System.out.println("demo1的值"+value);

 

hadoop计数器

标签:

原文地址:http://www.cnblogs.com/52hadoop/p/4844499.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!