[ 
https://issues.apache.org/jira/browse/CASSANDRA-8709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14355113#comment-14355113
 ] 

Joshua McKenzie commented on CASSANDRA-8709:
--------------------------------------------

bq. Why is CompressedSequentialWriter.compressed no longer final?
Oops - I re-allocated the entire WrappedByteBuffer rather than only the 
contained ByteBuffer. Fixed that - good catch.
bq. For non-direct you should always be passing buffer.position() + 
buffer.arrayOffset() for current index of the array
Fixed.
bq. In DeflateCompressor: WrappedByteBuffer might be Direct. For non-direct you 
should always be passing buffer.position() + buffer.arrayOffset() for current 
index of the array
Can it be? Right now the only users of ICompressor.compress looks to be our 
CompressedSequentialWriter or CompressorTest. The logic on construction of the 
WrappedByteBuffer in CSW checks ICompressor.useDirectOutputByteBuffers and 
won't allocate Direct buffers for a DeflateCompressor. I've added an assertion 
to confirm that dest's buffer isn't direct - let me know if my understanding of 
the users of this interface is off and I can adjust accordingly.

Branch rebased and updated w/the above things.

> Convert SequentialWriter from using RandomAccessFile to nio channel
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-8709
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8709
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Joshua McKenzie
>            Assignee: Joshua McKenzie
>              Labels: Windows
>             Fix For: 3.0
>
>
> For non-mmap'ed I/O on Windows, using nio channels will give us substantially 
> more flexibility w/regards to renaming and moving files around while writing 
> them.  This change in conjunction with CASSANDRA-4050 should allow us to 
> remove the Windows bypass code in SSTableRewriter for non-memory-mapped I/O.
> In general, migrating from instances of RandomAccessFile to nio channels will 
> help make Windows and linux behavior more consistent.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to