You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Steve Sapovits <ss...@invitemedia.com> on 2008/03/04 17:34:51 UTC
configuration access
Can someone point me to working examples of config access? I'm trying to use
the FileSystem and Configuration classes to get the 'fs.default.name' value. I see
that the Configuration object thinks it's loaded hadoop-default.xml and hadoop-site.xml
files, but no matter what I ask it for I get a default back and not what's configured.
A working example of this would probably set me straight. I tried explicitly adding
resources hard-coding the full path names of the config. files ... same thing.
--
Steve Sapovits
Invite Media - http://www.invitemedia.com
ssapovits@invitemedia.com
Re: configuration access
Posted by Steve Sapovits <ss...@invitemedia.com>.
Arun C Murthy wrote:
> Can you re-check if the right paths (for your config files) are on the
> CLASSPATH?
That was it. Thanks.
--
Steve Sapovits
Invite Media - http://www.invitemedia.com
ssapovits@invitemedia.com
Re: configuration access
Posted by Arun C Murthy <ac...@yahoo-inc.com>.
On Mar 4, 2008, at 8:34 AM, Steve Sapovits wrote:
>
> Can someone point me to working examples of config access? I'm
> trying to use
> the FileSystem and Configuration classes to get the
> 'fs.default.name' value. I see
> that the Configuration object thinks it's loaded hadoop-default.xml
> and hadoop-site.xml
> files, but no matter what I ask it for I get a default back and not
> what's configured.
Can you re-check if the right paths (for your config files) are on
the CLASSPATH?
You should be able to get the configured value via:
String fsName = conf.get("fs.default.name");
Arun
> A working example of this would probably set me straight. I tried
> explicitly adding
> resources hard-coding the full path names of the config. files ...
> same thing.
>
> --
> Steve Sapovits
> Invite Media - http://www.invitemedia.com
> ssapovits@invitemedia.com
>