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

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

I don't think the method we currently use is analogous to what protocol buffers 
is doing.

https://developers.google.com/protocol-buffers/docs/encoding#varints

The first description is of a method is just using the last bit of each byte as 
a continuation bit. We are doing a length prefix and not extension.

https://github.com/google/protobuf/blob/master/java/src/main/java/com/google/protobuf/CodedOutputStream.java#L1213

The encoding on the wire is unsigned and an additional transform (zigzag) is 
applied for signed numbers.

This sounds like it is closer to what everyone is looking for. Want a bias 
towards positive numbers? We could do unsigned with a small amount of 
additional code.

> 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