Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
MapReduce >> mail # user >> Re: MAP_INPUT_RECORDS counter in the reducer


+
Rahul Bhattacharjee 2013-09-18, 03:09
+
Shahab Yunus 2013-09-18, 13:46
+
Yaron Gonen 2013-09-20, 09:12
Copy link to this message
-
MAP_INPUT_RECORDS counter in the reducer
Hi,
Is there a way for the reducer to get the total number of input records to
the map phase?
For example, I want the reducer to normalize a sum by dividing it in the
number of records. I tried getting the value of that counter by using the
line:

context.getCounter(Task.Counter.MAP_INPUT_RECORDS).getValue();

in the reducer code, but I got 0.

Thanks!
Yaron
+
Shahab Yunus 2013-09-17, 13:49
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB