Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop, mail # user - Re: How can we download a file using WebHDFS REST API


Copy link to this message
-
Re: How can we download a file using WebHDFS REST API
Mohammad Tariq 2013-06-03, 18:58
Hello Mustaqeem,

          I don't think this is possible through webHDFS, as others have
said. But you could use wget(courtesy Datanode API) to download the file.
Something like this :

wget http://datanode:50075/streamFile/path_of_the_file

Please note that you need to issue this command on the DN machine.

HTH

Warm Regards,
Tariq
cloudfront.blogspot.com
On Fri, May 31, 2013 at 10:39 PM, Adam Faris <[EMAIL PROTECTED]> wrote:

> As others have suggested, you need to call "&op=OPEN" and save the
> contents into a buffer which you then write to disk.    You can do this
> with curl by using '-o /my/local/file.txt' in your curl statement.
>
> -- Adam
>
> On May 31, 2013, at 10:05 AM, Arpit Gupta <[EMAIL PROTECTED]>
>  wrote:
>
> > There is no api to download a file. The client you are using to make
> these calls will have to read the contents of the file and save it on your
> local file system.
> >
> > --
> > Arpit Gupta
> > Hortonworks Inc.
> > http://hortonworks.com/
> >
> > On May 31, 2013, at 9:56 AM, Mohammad Mustaqeem <[EMAIL PROTECTED]>
> wrote:
> >
> >> This is for reading the content of the file not to download..
> >> I want to download file.
> >>
> >>
> >> On Fri, May 31, 2013 at 10:23 PM, Arpit Gupta <[EMAIL PROTECTED]>
> wrote:
> >> you will have to use the open operation to read the file and save it.
> >>
> >>
> http://hadoop.apache.org/docs/r2.0.3-alpha/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Open_and_Read_a_File
> >>
> >> --
> >> Arpit Gupta
> >> Hortonworks Inc.
> >> http://hortonworks.com/
> >>
> >> On May 30, 2013, at 11:44 PM, Mohammad Mustaqeem <
> [EMAIL PROTECTED]> wrote:
> >>
> >>> Is there any way to download a file from HDFS using WebHDFS REST API?
> >>> I have read -
> http://hadoop.apache.org/docs/r2.0.3-alpha/hadoop-project-dist/hadoop-hdfs/WebHDFS.html
> >>>
> >>> But didn't find any way to download file.
> >>>
> >>> --
> >>> With regards ---
> >>> Mohammad Mustaqeem,
> >>> M.Tech (CSE)
> >>> MNNIT Allahabad
> >>> 9026604270
> >>>
> >>>
> >>
> >>
> >>
> >>
> >> --
> >> With regards ---
> >> Mohammad Mustaqeem,
> >> M.Tech (CSE)
> >> MNNIT Allahabad
> >> 9026604270
> >>
> >>
> >
>
>