You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Pavel Yaskevich (JIRA)" <ji...@apache.org> on 2011/07/19 21:02:58 UTC

[jira] [Created] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
--------------------------------------------------------------------

                 Key: CASSANDRA-2921
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Pavel Yaskevich
            Assignee: Pavel Yaskevich
             Fix For: 1.0


Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich commented on CASSANDRA-2921:
--------------------------------------------

CompactionManager.scrubOne still needs mark() and reset() methods seems like we won't be able to avoid having random I/O in BRAF.Writer

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Hudson commented on CASSANDRA-2921:
-----------------------------------

Integrated in Cassandra #970 (See [https://builds.apache.org/job/Cassandra/970/])
    split BRAF into RandomAccessReader and SequentialWriter
patch by pyaskevich and jbellis for CASSANDRA-2921

jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1149628
Files : 
* /cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/sstable/KeyIterator.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java
* /cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java
* /cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
* /cassandra/trunk/test/long/org/apache/cassandra/db/LongTableTest.java
* /cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
* /cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
* /cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java
* /cassandra/trunk/src/java/org/apache/cassandra/utils/CLibrary.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/SequentialWriter.java
* /cassandra/trunk/src/java/org/apache/cassandra/cache/AutoSavingCache.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/BufferedSegmentedFile.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
* /cassandra/trunk/test/unit/org/apache/cassandra/io/sstable/SSTableWriterCommutativeTest.java
* /cassandra/trunk/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java
* /cassandra/trunk/test/unit/org/apache/cassandra/io/sstable/SSTableTest.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java


> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: 2921-v3.txt, CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921-v4.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Updated] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich updated CASSANDRA-2921:
---------------------------------------

    Attachment: CASSANDRA-2921.patch

rebased with latest trunk (last commit 647e3e5a3106667e79c23e22fb7abfb0241dc5f4)

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Updated] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich updated CASSANDRA-2921:
---------------------------------------

    Attachment: CASSANDRA-2921-v2.patch

BRAF classes renamed to Reader/Writer, reBuffer, seek, close methods moved to AbstractRandomAccessFile class as common ones for both reader and writer.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Jonathan Ellis commented on CASSANDRA-2921:
-------------------------------------------

By "just extend OutputStream" i just meant in the class definition, i agree that you probably need RAF internally.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich commented on CASSANDRA-2921:
--------------------------------------------

AbstractDataOutput extends OutputStream

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Issue Comment Edited] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich edited comment on CASSANDRA-2921 at 7/20/11 3:57 PM:
---------------------------------------------------------------------

Ok, I will rename to Reader/Writer and extend Writer from DataOutputStream.

      was (Author: xedin):
    Ok, I will rename to Reader/Writer and extend Writer from BufferedOutputStream
  
> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Updated] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Jonathan Ellis updated CASSANDRA-2921:
--------------------------------------

    Attachment: 2921-v3.txt

v3 attached. BRAF.Reader -> RandomAccessReader; BRAF.Writer -> SequentialWriter.  SW wraps itself in a DOS, instead of extending ADO (which is no longer needed).

(I avoided bare Reader/Writer names since there are so many similar classes that we'd have to use fully qualified class names in places which is ugly.)

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: 2921-v3.txt, CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Jonathan Ellis commented on CASSANDRA-2921:
-------------------------------------------

bq. I think we should stay with Reader/Writer introduced by v2 here to support full (expected) BRAF functionality

I don't understand.  Your second patch changes Writer to a Stream which is the right direction to take this IMO.  If we're going to stick with Writer and Reader both exposing the same RAF interface I don't think there's much point in splitting them up.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Updated] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich updated CASSANDRA-2921:
---------------------------------------

    Attachment: CASSANDRA-2921-make-Writer-a-stream.patch

Patch changes a BRAF.Writer: instead of extending AbstractRandomAccessFile it expends AbstractDataOutput (new class) and introduces mark() and resetAndTruncate(...) methods to satisfy scrub and CommitLong requirements.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Jonathan Ellis commented on CASSANDRA-2921:
-------------------------------------------

There's no reason to have Reader and Writer live in the same outer class anymore.  Let's split them up.

Similarly, no reason to split ARAF out from Reader.

Writer should probably just extend OutputStream, and let caller wrap in DOS if they want instead of pulling in that Harmony code (if we can get rid of it, great).


> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich commented on CASSANDRA-2921:
--------------------------------------------

Ok, I will rename to Reader/Writer and extend Writer from BufferedOutputStream

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Jonathan Ellis commented on CASSANDRA-2921:
-------------------------------------------

Do we even need Writer?  since we don't seek on write anymore, can we just use a BufferedOutputStream?

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich commented on CASSANDRA-2921:
--------------------------------------------

Yes, we still need a Writer because we need to be able to skip I/O cache on demand, also having that class will make it easier to extend BRAF by CDF from CASSANDRA-47.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich commented on CASSANDRA-2921:
--------------------------------------------

bq. I don't understand. Your second patch changes Writer to a Stream which is the right direction to take this IMO. If we're going to stick with Writer and Reader both exposing the same RAF interface I don't think there's much point in splitting them up.

Second patch used to have random I/O writer but my point is - if we want to support BRAF lets do both Reader and Writer and do SequentialWriter in the separate file. But if you really think we should remove write functionality from BRAF, I'm okay with that, will attach v4 patch with some minor changes to your v3 soon.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: 2921-v3.txt, CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Updated] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich updated CASSANDRA-2921:
---------------------------------------

    Attachment: CASSANDRA-2921-v4.patch

Renamed static writer/reader methods to open. Changed cache skipping so it works correctly for sequential I/O.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: 2921-v3.txt, CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921-v4.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich commented on CASSANDRA-2921:
--------------------------------------------

I think we should stay with Reader/Writer introduced by v2 here to support full (expected) BRAF functionality. In the separate issue we can create an in-house implementation of FileOutputStream with support of mark(), resetAndTruncate(...) and truncate(...) methods and replace BRAF.Writer with it where needed, that should be a better design.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Pavel Yaskevich commented on CASSANDRA-2921:
--------------------------------------------

Can we go only with v2 patch by now? I'm a bit concerned about design of the Writer: it should be able to seek back if we want to support resetAndTruncate() so there is no way to go away from using RAF inside of Writer that I see. I have tried to use FileOutputStream and it's channel but it didn't go so well.

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921-make-Writer-a-stream.patch, CASSANDRA-2921-v2.patch, CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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

        

[jira] [Commented] (CASSANDRA-2921) Split BufferedRandomAccessFile (BRAF) into Input and Output classes

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

Jonathan Ellis commented on CASSANDRA-2921:
-------------------------------------------

Okay.  I still think we should have Input and Writer (let's make these symmetrical: Input and Output, or Reader and Writer) expose interfaces more specific to what we want to do.

Specifically, Writer shouldn't extend RAF since we're not supporting seeking anymore.  We don't need to wrap one either (we can still get the fd for CLibrary from FileChannel.fileDescriptor, for instance).

> Split BufferedRandomAccessFile (BRAF) into Input and Output classes 
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-2921
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2921
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 1.0
>
>         Attachments: CASSANDRA-2921.patch
>
>
> Split BRAF into Input and Output classes to void complexity related to random I/O in "write" mode that we don't need any more, see CASSANDRA-2879. And make implementation more clean and reusable.

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