You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Leo Jay (JIRA)" <ji...@apache.org> on 2011/02/22 10:17:38 UTC

[jira] Created: (CASSANDRA-2213) A bug in BufferedRandomAccessFile

A bug in BufferedRandomAccessFile
---------------------------------

                 Key: CASSANDRA-2213
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2213
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 0.7.2
            Reporter: Leo Jay


The first line of BufferedRandomAccessFile.readAtMost is
{code}if (length >= bufferEnd && hitEOF){code}

I think It should be ">" instead of ">=",
Here is a test for this:{code}
    @Test
    public void testRead() throws IOException {
        File tmpFile = File.createTempFile("readtest", "bin");
        tmpFile.deleteOnExit();

        // Create the BRAF by filename instead of by file.
        BufferedRandomAccessFile rw = new BufferedRandomAccessFile(tmpFile.getPath(), "rw");
        rw.write(new byte[] {1});

        rw.seek(0);
        byte[] buffer = new byte[1];
        assert rw.read(buffer) == 1;
        assert buffer[0] == 1;
}
{code}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (CASSANDRA-2213) A bug in BufferedRandomAccessFile

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-2213.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.7.3
         Reviewer: jbellis
         Assignee: Leo Jay

committed, thanks!

> A bug in BufferedRandomAccessFile
> ---------------------------------
>
>                 Key: CASSANDRA-2213
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2213
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.2
>            Reporter: Leo Jay
>            Assignee: Leo Jay
>             Fix For: 0.7.3
>
>
> The first line of BufferedRandomAccessFile.readAtMost is
> {code}if (length >= bufferEnd && hitEOF){code}
> I think It should be ">" instead of ">=",
> Here is a test for this:{code}
>     @Test
>     public void testRead() throws IOException {
>         File tmpFile = File.createTempFile("readtest", "bin");
>         tmpFile.deleteOnExit();
>         // Create the BRAF by filename instead of by file.
>         BufferedRandomAccessFile rw = new BufferedRandomAccessFile(tmpFile.getPath(), "rw");
>         rw.write(new byte[] {1});
>         rw.seek(0);
>         byte[] buffer = new byte[1];
>         assert rw.read(buffer) == 1;
>         assert buffer[0] == 1;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2213) A bug in BufferedRandomAccessFile

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997970#comment-12997970 ] 

Hudson commented on CASSANDRA-2213:
-----------------------------------

Integrated in Cassandra-0.7 #304 (See [https://hudson.apache.org/hudson/job/Cassandra-0.7/304/])
    avoid EOFing on requests for the last bytes in a file
patch by Leo Jay; reviewed by jbellis for CASSANDRA-2213


> A bug in BufferedRandomAccessFile
> ---------------------------------
>
>                 Key: CASSANDRA-2213
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2213
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.2
>            Reporter: Leo Jay
>            Assignee: Leo Jay
>             Fix For: 0.7.3
>
>
> The first line of BufferedRandomAccessFile.readAtMost is
> {code}if (length >= bufferEnd && hitEOF){code}
> I think It should be ">" instead of ">=",
> Here is a test for this:{code}
>     @Test
>     public void testRead() throws IOException {
>         File tmpFile = File.createTempFile("readtest", "bin");
>         tmpFile.deleteOnExit();
>         // Create the BRAF by filename instead of by file.
>         BufferedRandomAccessFile rw = new BufferedRandomAccessFile(tmpFile.getPath(), "rw");
>         rw.write(new byte[] {1});
>         rw.seek(0);
>         byte[] buffer = new byte[1];
>         assert rw.read(buffer) == 1;
>         assert buffer[0] == 1;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira