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

Ariel Weisberg commented on CASSANDRA-9499:
-------------------------------------------

I have the proposed encoding implemented and have the beginnings of an 
efficient implementation for BufferedDataOutputStreamPlus and NIOInputStream. 
There is probably still branches or that could be removed as well as making the 
bit fiddling more efficient and clearer. I am going to try and clean it up, but 
I could use feedback.

I couldn't come up with an efficient implementation for computeUnsignedVIntSize 
(when you haven't encoded it yet).
 
I also created the branch 
https://github.com/aweisberg/cassandra/commits/C-9499-madness where I removed 
Encoded*Stream and changed the serializers to use DataInputPlus which extends 
DataInput to add the varint decoding methods. I haven't rebased that on top of 
C-9499 yet.

I am using 1s for the extension bits. I am also emitting the bytes in little 
endian order although it seems like I would need to do that at least for the 
first byte. I could emit the rest of the bytes in big endian order for the 
getLong(). Right now I have to reverse them because the ByteBuffer is big 
endian. l am wagering it is faster than swapping the settings.

> Introduce writeVInt method to DataOutputStreamPlus
> --------------------------------------------------
>
>                 Key: CASSANDRA-9499
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9499
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Ariel Weisberg
>            Priority: Minor
>             Fix For: 3.0 beta 1
>
>
> CASSANDRA-8099 really could do with a writeVInt method, for both fixing 
> CASSANDRA-9498 but also efficiently encoding timestamp/deletion deltas. It 
> should be possible to make an especially efficient implementation against 
> BufferedDataOutputStreamPlus.



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

Reply via email to