Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce, mail # user - MAP_INPUT_RECORDS counter in the reducer


Copy link to this message
-
MAP_INPUT_RECORDS counter in the reducer
Yaron Gonen 2013-09-17, 10:09
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