Reply
New Contributor
Posts: 2
Registered: ‎09-30-2014

Mapper and reducer accessing a shared variable/value ?

How to share a common variable/value between jobclient, map and reducer ?

 

I am doing a matrix multiplcation in map reduce. I would like both mapper and reducer to know the size of the matrix they are handling. Which is the best way a mapper and reducer can access such common values ?

 

thanks,

Jithesh

New Contributor
Posts: 2
Registered: ‎09-30-2014

Re: Mapper and reducer accessing a shared variable/value ?

// Job Client..

 
Configuration conf = new Configuration();
conf.set("dimension", "5"); // set the matrix dimension here.
 
// mapper
 
Configuration conf = context.getConfiguration();
String dimension = conf.get("dimension");
 
Or use Dist Cache..

 

Announcements