hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narayanan K <knarayana...@gmail.com>
Subject Passing Arguments to Map & Reducer using Job
Date Sat, 30 Jul 2011 16:32:48 GMT
Hi

I am using *Job *(
http://hadoop.apache.org/common/docs/r0.20.1/api/org/apache/hadoop/mapreduce/Job.html)
to submit a MR job on Hbase.

I want to pass some values from my main() to Map and Reduce functions.

I know how to do this using a JobConf client.

*In Main*

JobConf job = new JobConf(conf, MR.class);
job.set("Key", Value);

*In Mapper/Reducer Class*

JobConf conf;
public void configure(JobConf job)
{
  conf = job;
  val = job.get("Key");
 }

I get the value in val variable that I had set in Main, in my reducer/mapper
class using the above method.

But I tried the same with Job class instead of JobConf. There isnt a set
method for Job.

How do I pass values to map/reduce classes using Job just like I was able to
do using JobConf client?

Thanks,
Narayanan

Mime
View raw message