[ 
https://issues.apache.org/jira/browse/HADOOP-922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Doug Cutting updated HADOOP-922:
--------------------------------

    Status: Open  (was: Patch Available)

The call to skipTo() will still, in the worst case, cause an entire block to be 
streamed across the wire, using a lot of network bandwidth.  Before we commit 
this I'd like to see some benchmarks showing that this is faster than closing 
and re-opening the connection.

Note also that the stream buffering code already performs a similar 
optimization: if a 100k buffer is used, and one seeks within the buffer, then 
no i/o is performed on the underlying stream.  So seeks of the underlying 
stream are generally at least a few k bytes away.

> Optimize small reads and seeks
> ------------------------------
>
>                 Key: HADOOP-922
>                 URL: https://issues.apache.org/jira/browse/HADOOP-922
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.10.1
>            Reporter: dhruba borthakur
>         Assigned To: dhruba borthakur
>         Attachments: smallreadseek3.patch
>
>
> A seek on a DFSInputStream causes causes the next read to re-open the socket 
> connection to the datanode and fetch the remainder of the block all over 
> again. This is not optimal.
> A small read followed by a small positive seek could re-utilize the data 
> already fetched from the datanode as part of the previous read. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to