[
https://issues.apache.org/jira/browse/HDFS-6369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13995294#comment-13995294
]
Colin Patrick McCabe commented on HDFS-6369:
--------------------------------------------
The calling code in {{DFSInputStream}} already takes into account where the end
of the block is. See this code in {{DFSInputStream}}:
{code}
if (pos <= targetPos && targetPos <= blockEnd) {
//
// If this seek is to a positive position in the current
// block, and this piece of data might already be lying in
// the TCP buffer, then just eat up the intervening data.
//
int diff = (int)(targetPos - pos);
if (diff <= blockReader.available()) {
...
{code}
Notice that we don't call {{available}} if {{targetPos}} is beyond {{blockEnd}}
Also, {{RemoteBlockReader}} is deprecated. See the comment at the top:
{code}
/**
* \@deprecated this is an old implementation that is being left around
* in case any issues spring up with the new {\@link RemoteBlockReader2}
implementation.
* It will be removed in the next release.
*/
{code}
We should really fix {{RemoteBlockReader2}} to support SOCKS sockets (those are
the only ones without channels, as I recall) and remove {{RemoteBlockReader}}
as the comment promised we'd do.
> RemoteBlockReader#available() should call FSInputChecker.available()
> --------------------------------------------------------------------
>
> Key: HDFS-6369
> URL: https://issues.apache.org/jira/browse/HDFS-6369
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Chen He
> Priority: Trivial
> Attachments: HDFS-6369.patch
>
>
> Currently DFSClient.TCP_WINDOW_SIZE is directly returned.
> However, FSInputChecker.available(), in the superclass, may return value
> lower than the constant.
--
This message was sent by Atlassian JIRA
(v6.2#6252)