You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by zhang jianfeng <zj...@gmail.com> on 2009/07/09 09:16:58 UTC

Is it reasonable to archive the configuration file into hadoop18.jar

Hi all,

I found the hadoop18.jar which pig use contains configuration files, such as
hadoop-site.xml , hadoop-default.xml. These files will be archived to
pig.jar when run ant jar.

And when I use pig in embed java way, run the following code snippet:

        PigServer pig = new PigServer(ExecType.MAPREDUCE);
        pig.registerScript("scripts/Test.pig");

it will default load these configuration files. So it is not easy for me to
make configuration when I want to use my own hadoop configuration files.  So
I think it's better not put these configruation to hadoop18.jar. Let the
user provide their own configuration files.

What do you think? Or Does there exists some ways to make configuration ?


Thanks

Jeff Zhang

Re: Is it reasonable to archive the configuration file into hadoop18.jar

Posted by Daniel Dai <da...@gmail.com>.
Put hadoop-site.xml inside your classpath before pig.jar. Pig should take 
the first hadoop-site.xml in your classpath.

----- Original Message ----- 
From: "zhang jianfeng" <zj...@gmail.com>
To: <pi...@hadoop.apache.org>; <pi...@hadoop.apache.org>
Sent: Thursday, July 09, 2009 12:16 AM
Subject: Is it reasonable to archive the configuration file into 
hadoop18.jar


> Hi all,
>
> I found the hadoop18.jar which pig use contains configuration files, such 
> as
> hadoop-site.xml , hadoop-default.xml. These files will be archived to
> pig.jar when run ant jar.
>
> And when I use pig in embed java way, run the following code snippet:
>
>        PigServer pig = new PigServer(ExecType.MAPREDUCE);
>        pig.registerScript("scripts/Test.pig");
>
> it will default load these configuration files. So it is not easy for me 
> to
> make configuration when I want to use my own hadoop configuration files. 
> So
> I think it's better not put these configruation to hadoop18.jar. Let the
> user provide their own configuration files.
>
> What do you think? Or Does there exists some ways to make configuration ?
>
>
> Thanks
>
> Jeff Zhang
>