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 <[email protected]> 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.
>
>

Reply via email to