hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arun C Murthy <...@yahoo-inc.com>
Subject Re: getting Configuration object in mapper
Date Sat, 06 Dec 2008 09:19:07 GMT

On Dec 5, 2008, at 12:32 PM, Craig Macdonald wrote:

> I have a related question - I have a class which is both mapper and  
> reducer. How can I tell in configure() if the current task is map or  
> a reduce task? Parse the taskid?
>

Get the taskid, then use
http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/TaskAttemptID.html#forName(java.lang.String)
followed by
http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/TaskAttemptID.html#isMap()

Arun

Mime
View raw message