hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jason hadoop <jason.had...@gmail.com>
Subject Re: Accessing static variables in map function
Date Fri, 10 Jul 2009 03:24:02 GMT
To clarify all of the writers.
Store the values you wish to share with your map tasks, in the JobConf
object.

In the configure method of your mapper class, unpack the variables and store
them in class fields of the mapper class.

Then use them as needed in the map method of your mapper class.

On Thu, Jul 9, 2009 at 1:07 PM, Ted Dunning <ted.dunning@gmail.com> wrote:

> Use the configuration object.
>
> Remember that the outer class is replicated all across the known universe.
> Your command line arguments only exist on your original machine.
>
> On Thu, Jul 9, 2009 at 11:35 AM, <smarthrish@yahoo.co.in> wrote:
>
> >
> > Hey Ram.
> > The problem is i initialize these variables in the run function after
> >  receiving the cmd line arguments .
> > I want to access the same vars  in the mpa function.
> > Is there a diff way other than passing the variables through a Conf
> object
> >  ?
> >
> >
>



-- 
Pro Hadoop, a book to guide you from beginner to hadoop mastery,
http://www.amazon.com/dp/1430219424?tag=jewlerymall
www.prohadoopbook.com a community for Hadoop Professionals

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message