[
https://issues.apache.org/jira/browse/HDFS-3272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502299#comment-13502299
]
Jeff Markham commented on HDFS-3272:
------------------------------------
Also, maybe refactor org.apache.hadoop.fs.http.server.HttpFSServer.get() to
@Produce based on the HTTP Accept header.
Combined with offset/length, this might be a good way to paginate through HDFS
files with standard web app frameworks. I was thinking of testing this with
some Pig scripts (submit script via Templeton, read output via WebHDFS). If
there's no objections, I'll take this one.
I'll refactor to inject the headers (@Context HttpHeaders headers) into the
aforementioned method, do headers.getAcceptableMediaTypes() and create the
response accordingly. And if no Accept header is specified, look for a mime
query parm.
> Make it possible to state MIME type for a webhdfs OPEN operation's result
> -------------------------------------------------------------------------
>
> Key: HDFS-3272
> URL: https://issues.apache.org/jira/browse/HDFS-3272
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: webhdfs
> Affects Versions: 1.0.1
> Reporter: Steve Loughran
> Priority: Minor
>
> when you do a GET from the browser with webhdfs, you get the file, but it
> comes over as a binary as the browser doesn't know what type it is. Having a
> mime mapping table and such like would be one solution, but another is simply
> to add a {{mime}} query parameter that would provide a string to be reflected
> back to the caller as the Content-Type header in the HTTP response.
> e.g.
> {code}
> http://ranier:50070/webhdfs/v1/results/Debounce/part-r-00000.csv?op=open&mime=text/csv
>
> {code}
> would generate a 307 redirect to the datanode, with the
> {code}
> http://dn1:50075/webhdfs/v1/results/Debounce/part-r-00000.csv?op=open&mime=text/csv
>
> {code}
> which would then generate the result
> {code}
> 200 OK
> Content-Type:text/csv
> GATE4,eb8bd736445f415e18886ba037f84829,55000,2007-01-14,14:01:54,
> GATE4,ec58edcce1049fa665446dc1fa690638,8030803000,2007-01-14,13:52:31,
> ...
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira