Re: Is there any smart ways to give arguments to mappers & reducers from a main job?

2011-02-10 Thread li ping
correct.
Just like this:

Configuration conf = new Configuration();
conf.setStrings("test", "test");
Job job = new Job(conf, "job name");

On Thu, Feb 10, 2011 at 6:42 PM, Harsh J  wrote:

> Your 'Job' must reference this Configuration object for it to take
> those values. If it does not know about it, it would not work,
> logically :-)
>
> For example, create your Configuration and set things into it, and
> only then do new Job(ConfigurationObj) to make it use your configured
> object for this job.
>
> On Thu, Feb 10, 2011 at 3:19 PM, Jun Young Kim 
> wrote:
> > Hi, all
> >
> > in my job, I wanna pass some arguments to mappers and reducers from a
> main
> > job.
> >
> > I googled some references to do that by using Configuration.
> >
> > but, it's not working.
> >
> > code)
> >
> > job)
> > Configuration conf = new Configuration();
> > conf.set("test", "value");
> >
> > mapper)
> >
> > doMap() extends Mapper... {
> > System.out.println(context.getConfiguration.get("test"));
> > /// --> this printed out "null"
> > }
> >
> > How could I do that to make it working?--
> >
> > Junyoung Kim (juneng...@gmail.com)
> >
> >
>
>
>
> --
> Harsh J
> www.harshj.com
>



-- 
-李平


Re: Is there any smart ways to give arguments to mappers & reducers from a main job?

2011-02-10 Thread Harsh J
Your 'Job' must reference this Configuration object for it to take
those values. If it does not know about it, it would not work,
logically :-)

For example, create your Configuration and set things into it, and
only then do new Job(ConfigurationObj) to make it use your configured
object for this job.

On Thu, Feb 10, 2011 at 3:19 PM, Jun Young Kim  wrote:
> Hi, all
>
> in my job, I wanna pass some arguments to mappers and reducers from a main
> job.
>
> I googled some references to do that by using Configuration.
>
> but, it's not working.
>
> code)
>
> job)
> Configuration conf = new Configuration();
> conf.set("test", "value");
>
> mapper)
>
> doMap() extends Mapper... {
> System.out.println(context.getConfiguration.get("test"));
> /// --> this printed out "null"
> }
>
> How could I do that to make it working?--
>
> Junyoung Kim (juneng...@gmail.com)
>
>



-- 
Harsh J
www.harshj.com


Is there any smart ways to give arguments to mappers & reducers from a main job?

2011-02-10 Thread Jun Young Kim

Hi, all

in my job, I wanna pass some arguments to mappers and reducers from a 
main job.


I googled some references to do that by using Configuration.

but, it's not working.

code)

job)
Configuration conf = new Configuration();
conf.set("test", "value");

mapper)

doMap() extends Mapper... {
System.out.println(context.getConfiguration.get("test"));
/// --> this printed out "null"
}

How could I do that to make it working?--

Junyoung Kim (juneng...@gmail.com)