[ 
https://issues.apache.org/jira/browse/HDFS-14111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16718160#comment-16718160
 ] 

Todd Lipcon commented on HDFS-14111:
------------------------------------

Thanks for the links to those other initiatives, Steve. I think, while they'd 
be useful improvements, it would be nice to also treat this as a libhdfs bug 
and see if we can make an internal change to fix the issue without requiring 
callers to move to a new API. It's worth noting that the issue here is with 
libhdfs rather than with HDFS itself, as far as I can understand from the code 
-- i.e. using the Java open() API _does not_ trigger an eager read from offset 
0, but the libhdfs C equivalent _does_.

> hdfsOpenFile on HDFS causes unnecessary IO from file offset 0
> -------------------------------------------------------------
>
>                 Key: HDFS-14111
>                 URL: https://issues.apache.org/jira/browse/HDFS-14111
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client, libhdfs
>    Affects Versions: 3.2.0
>            Reporter: Todd Lipcon
>            Priority: Major
>
> hdfsOpenFile() calls readDirect() with a 0-length argument in order to check 
> whether the underlying stream supports bytebuffer reads. With DFSInputStream, 
> the read(0) isn't short circuited, and results in the DFSClient opening a 
> block reader. In the case of a remote block, the block reader will actually 
> issue a read of the whole block, causing the datanode to perform unnecessary 
> IO and network transfers in order to fill up the client's TCP buffers. This 
> causes performance degradation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to