hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owen O'Malley (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HADOOP-3640) NativeS3FsInputStream read() method for reading a single byte is incorrect
Date Mon, 30 Jun 2008 18:53:45 GMT

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

Owen O'Malley updated HADOOP-3640:
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.19.0
     Hadoop Flags: [Reviewed]
           Status: Resolved  (was: Patch Available)

I just committed this. Thanks, Tom!

> NativeS3FsInputStream read() method for reading a single byte is incorrect
> --------------------------------------------------------------------------
>
>                 Key: HADOOP-3640
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3640
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.0
>            Reporter: Tom White
>            Assignee: Tom White
>             Fix For: 0.19.0
>
>         Attachments: hadoop-3640.patch
>
>
> From Albert Chern:
> I think there may be a bug in the read() method of NativeS3InputStream, which looks like
this:
> {code}
> public synchronized int read() throws IOException {
>     int result = in.read();
>     if (result > 0) {
>         pos += result;
>     }
>     return result;
> }
> {code}
> The return value of InputStream.read() should be the next byte in the range 0 to 255,
or -1 if there are no more bytes.  So shouldn't this method look something like this?
> {code}
> public synchronized int read() throws IOException {
>     int result = in.read();
>     if (result > -1) {
>         pos ++;
>     }
>     return result;
> }
> {code}

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


Mime
View raw message