hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Casey Brotherton (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-5696) Examples for httpfs REST API incorrect on apache.org
Date Sat, 21 Dec 2013 02:56:10 GMT
Casey Brotherton created HDFS-5696:

             Summary: Examples for httpfs REST API incorrect on apache.org
                 Key: HDFS-5696
                 URL: https://issues.apache.org/jira/browse/HDFS-5696
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: documentation
    Affects Versions: 2.2.0
         Environment: NA
            Reporter: Casey Brotherton
            Priority: Minor

The examples provided for the httpfs REST API are incorrect.

>From the documentation:
HttpFS is a separate service from Hadoop NameNode.
HttpFS itself is Java web-application and it runs using a preconfigured Tomcat bundled with
HttpFS binary distribution.
HttpFS HTTP web-service API calls are HTTP REST calls that map to a HDFS file system operation.
For example, using the curl Unix command:
$ curl http://httpfs-host:14000/webhdfs/v1/user/foo/README.txt returns the contents of the
HDFS /user/foo/README.txt file.
$ curl http://httpfs-host:14000/webhdfs/v1/user/foo?op=list returns the contents of the HDFS
/user/foo directory in JSON format.
$ curl -X POST http://httpfs-host:14000/webhdfs/v1/user/foo/bar?op=mkdirs creates the HDFS
/user/foo.bar directory.
The commands have incorrect "op"erations. ( Verified through source code in HttpFSFileSystem.java
In addition, although the webhdfs documentation specifies user.name as optional, on my cluster,
each action required a "user.name"
It should be included in the short examples to allow for the greatest chance of success.
Three examples rewritten:
curl -i -L "http://httpfs-host:14000/webhdfs/v1/user/foo/README.txt?op=open&user.name=hdfsuser"
curl -i "http://httpfs-host:14000/webhdfs/v1/user/foo/?op=liststatus&user.name=hdfsuser"
curl -i -X PUT "http://httpfs-host:14000/webhdfs/v1/user/foo/bar?op=mkdirs&user.name=hdfsuser"
Not sure what the convention should be for specifying the user.name. Use hdfs? or a name that
is obviously an example?
It would also be beneficial if the HTTPfs page linked to the webhdfs documentation page in
the text instead of just on the menu sidebar.


This message was sent by Atlassian JIRA

View raw message