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

Benedict commented on CASSANDRA-9499:
-------------------------------------

bq. I was, in fact, more thinking of the simpler scheme of using one bit as a 
"continuation bit"

I'm not fixated on the exact specifics of the scheme I suggested, I was mostly 
suggesting a switch to a continutationbit*s* scheme (with these bits encoded 
upfront for simplicity), as well as being strongly in favour of one encoding 
scheme.

We could, for instance, have a single continuation bit, that is expanded to, 
say, 3 bits + sign if it's set, so that we represent [0..127] in 1 byte, 
[-2048..2047] in 2 bytes, [-512K..512K] in 3 bytes etc.; or we could have two 
initial continuation bits, permitting up to 16K in 2 bytes. I would just prefer 
we settle on what we consider to be approximately the most generally useful 
scheme, and stick with that. 

I should note I'm not saying that it definitely would not help to have a 
proliferation of methods, but IMO the _likelihood_ of payoff is too low to 
spend time on (we have lots of things we know will payoff). I think it's 
somewhat more likely to harm than help, since a majority of values to be 
encoded will likely see the same size under the general scheme as they would 
under their more specific scheme, and there are negative costs associated with 
a proliferation of method calls. I'm hoping _in general_ on the project we can 
steadily prune the number of methods a typical workloads entails visiting.

> 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