cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ariel Weisberg (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-9499) Introduce writeVInt method to DataOutputStreamPlus
Date Fri, 19 Jun 2015 14:47:01 GMT

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

Ariel Weisberg edited comment on CASSANDRA-9499 at 6/19/15 2:46 PM:
--------------------------------------------------------------------

I have the proposed encoding implemented and have the beginnings of an efficient implementation
for BufferedDataOutputStreamPlus and NIOInputStream. There are probably still branches that
could be removed as well as bit fiddling that could be 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 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.


was (Author: aweisberg):
I have the proposed encoding implemented and have the beginnings of an efficient implementation
for BufferedDataOutputStreamPlus and NIOInputStream. There are probably still branches that
could be removed as well as bit fiddling that could be 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)

Mime
View raw message