Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> Accessing local filesystem with org.apache.hadoop.fs.FileSystem


Copy link to this message
-
RE: Accessing local filesystem with org.apache.hadoop.fs.FileSystem
Please try like this to access the local file system.

FileSystem fileSystem = FileSystem.getLocal(conf);
FSDataInputStream i = fileSystem.open(p);
Thanks
Devaraj
________________________________________
From: [EMAIL PROTECTED] [[EMAIL PROTECTED]] on behalf of Ashwanth Kumar [[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2012 5:46 PM
To: [EMAIL PROTECTED]
Subject: Re: Accessing local filesystem with org.apache.hadoop.fs.FileSystem

Did you try adding file:// in front of the path?

On Wed, Apr 4, 2012 at 5:43 PM, Pedro Costa <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
 I'm trying to open a local file with the FileSystem class.

FileSystem rfs = FileSystem.get(conf);
FSDataInputStream i = srcFs.open(p);
but I get file not found. The path is correct, but I think that my class is accessing hdfs, instead of my local filesystem. Can I use the FileSystem to access local filesystem?

--
Best regards,

--

Ashwanth Kumar / ashwanthkumar.in<http://ashwanthkumar.in/>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB