hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen O'Malley <omal...@apache.org>
Subject Re: Set variables in mapper
Date Tue, 03 Aug 2010 06:37:19 GMT

On Aug 2, 2010, at 9:17 AM, Erik Test wrote:

> I'm trying to set a variable in my mapper class by reading an  
> argument from
> the command line and then passing the entry to the mapper from main.  
> Is this
> possible?

Others have already answered with the current solution of using  
JobConf to store the value. I should also note that I plan to  
implement MAPREDUCE-1183 for 0.22. It will allow you to do this  
directly like:

job.setMapper(new MyMapper(someIntegerParameter));

which will serialize MyMapper's state, including the integer  
parameter, and store it as part of your job.

-- Owen

Mime
View raw message