You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Tarandeep Singh <ta...@gmail.com> on 2008/09/05 02:31:05 UTC

how to access counter value in Reducer ?

Hi,

How can I access a value of a counter in a reducer ?
Basically I am interested in knowing how many records I have got from file1,
file2 .. fileN
The mapper is maintaining N counters and incrementing counter-i for every
record read from ith file.

Initially I was tagging my records with file name/number and was counting in
the reducer. But I feel this is unnecessary. I don't have to iterate over
the values in the reducer, Counters can be used. But I don't see a way to
access the counters in the reducer :-(

-Taran