hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vibhooti Verma <verma.vibho...@gmail.com>
Subject Re: how to access HDFS file system.
Date Tue, 03 Aug 2010 11:31:02 GMT
hi Sanjiv,
you can simply intializae  Path (org.apache.hadoop.fs.Path) with your
desired filename you want to create/open and then get a Filesystem
((org.apache.hadoop.fs.Path)) object. Filesystem object can do the rest for
you.

Example code snippet:
Path tmp = new Path("/tmp"); //initializing the Path object
FileSystem fs =  tmp.getFileSystem();  //  Getting fs object
Boolean flag =  fs.exists("/input") // you can make use of fs to all the
filesystem related operations.

Hope it helps.
Vibhooti


On Tue, Aug 3, 2010 at 3:48 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.
>
>


-- 
cheers,
Vibhooti

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