hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanel Zukan <san...@gmail.com>
Subject Re: how to access HDFS file system.
Date Tue, 03 Aug 2010 11:29:43 GMT
Check FileSystem and Configuration classes. Set 'fs.default.name' to point
to hdfs host (make sure it is prefixed with 'hdfs://') and via
FileSystem.get(conf)
you should get object for accessing hdfs, e.g.

conf = new Configuration();
conf.set("fs.default.name", "hdfs://localhost:PORT");
hdfs = FileSystem.get(conf);

// example, delete "foo.txt" from hdfs
hdfs.delete(new Path("/path/foo.txt"), false);


On Tue, Aug 3, 2010 at 12:18 PM, sanjiv.singh <sanjiv.is.on@gmail.com> wrote:
>
> Hi All,
> i want to access HDFS file sytem through map-reduce java code.
> how can specify path for HDFS in Path  constructor.
>
>
> --
> View this message in context: http://old.nabble.com/how-to-access-HDFS-file-system.-tp29333820p29333820.html
> Sent from the Hadoop core-user mailing list archive at Nabble.com.
>
>

Mime
View raw message