Thanks, Chris, I will have a try.

-Gang



----- 原始邮件 ----
发件人: Chris Dyer <redp...@umd.edu>
收件人: common-user@hadoop.apache.org
发送日期: 2009/12/17 (周四) 10:58:05 下午
主   题: Re: do sth after map task finish

You can write output in the mapper's close() method, which will be
called after the last line of input is processed.  When I was last
doing this (~ version 17), it was a bit of a pain, since by default
you didn't have access to the relevant output object, making it
necessary to store it in a field in the object.  I don't know if the
interfaces have been improved since then.

-Chris

2009/12/17 Gang Luo <lgpub...@yahoo.com.cn>:
> Hi all,
> most of the time, we focus on the map function to decide whether to output a 
> record and what to output. Now I want to do something at the map task level. 
> I want to output a record when a map task finish and this record should be 
> processed by reducer properly. Is there any way to output (like 
> output.collect in map function) a record outside map function?
>
> If that is impossible, to know whether I meet the last line for this map task 
> is also helpful. Does anyone know how to tell whether the line I am 
> processing now in map function is the last line for this map task?
>
> Thanks.
>
> -Gang
>


      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/

Reply via email to