Nutch conf reading

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Nutch conf reading

djames
Hello,

I need to add a parameter in the conf file of nutch.
What is the method to read the xml file in nutch?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Nutch conf reading

Dennis Kubes
You would simply add your configuration variable to most likely the
nutch-site.xml or the hadoop-site.xml file and then call it through the
configuration.get methods.

If you want to know where the code is that reads the xml file that is in
the org.apache.hadoop.conf.Configuration class in the hadoop source code.

Dennis Kubes

djames wrote:
> Hello,
>
> I need to add a parameter in the conf file of nutch.
> What is the method to read the xml file in nutch?
>
> Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Nutch conf reading

djames
Thanks for your help but where i call this methode, she could'nt be resolved. Is there an import i must do?
Reply | Threaded
Open this post in threaded view
|

Re: Nutch conf reading

Dennis Kubes
If within nutch:

Configuration conf = NutchConfiguration.create();
Object obj = conf.get("my.variable.name")... or another get method

Dennis Kubes

djames wrote:
> Thanks for your help but where i call this methode, she could'nt be resolved.
> Is there an import i must do?
Reply | Threaded
Open this post in threaded view
|

Re: Nutch conf reading

djames
Thanks you very much for your help it works fine