[
https://issues.apache.org/jira/browse/HADOOP-15870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16694773#comment-16694773
]
Steve Loughran commented on HADOOP-15870:
-----------------------------------------
Now, code review
{{InputStream.available()}} declares the #of bytes which can be read *without
blocking*. This is not what is currently being calculated for S3A input stream
-it's broken. And this patch, while making it more accurate, isn't doing it
either.
We should just be doing something like
{code}
public synchronized int available() throws IOException {
checkNotClosed();
return wrappedStream != null? wrappedStream.available() : 0;
}
{code}
All the new tests will validate this behaviour
> S3AInputStream.remainingInFile should use nextReadPos
> -----------------------------------------------------
>
> Key: HADOOP-15870
> URL: https://issues.apache.org/jira/browse/HADOOP-15870
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 2.8.4, 3.1.1
> Reporter: Shixiong Zhu
> Assignee: lqjacklee
> Priority: Major
> Attachments: HADOOP-15870-002.patch
>
>
> Otherwise `remainingInFile` will not change after `seek`.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]