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 Shi Yu <sh...@uchicago.edu> on 2011/12/13 05:45:49 UTC
Create a single output per each mapper
Hi,
Suppose I have two mappers, each mapper is assigned 10 lines of
data. I want to set a counter for each mapper, counting and
accumulating, then output the counter value to the reducer when
the mapper finishes processing all the assigned lines. So I
want the mapper outputs values only when there is no further
incoming data (when that mapper closes). Is this doable? How?
thanks!
Shi
Re: Create a single output per each mapper
Posted by Prashant Kommireddi <pr...@gmail.com>.
Take a look at cleanup() method on Mapper.
Thanks,
Prashant
Sent from my iPhone
On Dec 12, 2011, at 8:46 PM, Shi Yu <sh...@uchicago.edu> wrote:
> Hi,
>
> Suppose I have two mappers, each mapper is assigned 10 lines of
> data. I want to set a counter for each mapper, counting and
> accumulating, then output the counter value to the reducer when
> the mapper finishes processing all the assigned lines. So I
> want the mapper outputs values only when there is no further
> incoming data (when that mapper closes). Is this doable? How?
> thanks!
>
> Shi