hadoop-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shrijeet Paliwal <shrij...@rocketfuel.com>
Subject Re: Loading conf file sitting in HDFS
Date Fri, 29 Oct 2010 19:38:36 GMT
I got it working by doing this (passing inputstream):

conf.addResource(hdfs.open(apath));

Would still be interested in knowing insights if any one wants to share.

-Shrijeet

On Fri, Oct 29, 2010 at 12:18 PM, Shrijeet Paliwal
<shrijeet@rocketfuel.com>wrote:

> Hello All,
> I am trying to load a conf file located in hdfs.
> I was hoping following would work:
>
> Path apath = new Path(conf.get("fs.default.name"),
> "/home/shrijeet/blah.xml");
> conf.addResource(apath);
>
> But I get following exception,
>
> Exception in thread "main" java.lang.RuntimeException:
> hdfs://localhost:8020/home/shrijeet/blah.xml not found
>         at
> org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1297)
>         at
> org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1227)
>
>
> File does exist however,
>
> [12:20][shrijeet@shrijeet-desktop]~$ hadoop dfs -ls
> hdfs://localhost:8020/home/shrijeet/blah.xml
> Found 1 items
> -rw-r--r--   1 shrijeet shrijeet        488 2010-10-29 12:16
> /home/shrijeet/blah.xml
>
> Thoughts?
>
> -Shrijeet
>

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