cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-9499) Introduce writeVInt method to DataOutputStreamPlus
Date Tue, 16 Jun 2015 00:23:01 GMT


Benedict commented on CASSANDRA-9499:

It's a real shame we can't modify the encoding, or at least, it's not worth the effort.

The implementation of read, in particular, could have a much clearer and more efficient decoding
of size if the negative value positions were inverted.

While we're touching this code, it is worth cleaning up these methods a little: there's no
point decoding the size of 1, and then deducting from it; we can just return immediately if
{{{{firstByte}} >= MIN_BYTE_VALUE // == -112}}, and always decode the size to a value in
the range [2..8]

{vIntIsNegative}}: it has three conditional expressions, and only one of them is needed, the
other two are always false (since we return those negative values up front; and we wouldn't
want to invert them anyway, I would guess)

and then {{vintDecodeSize can be made into just a ternary statement.

> Introduce writeVInt method to DataOutputStreamPlus
> --------------------------------------------------
>                 Key: CASSANDRA-9499
>                 URL:
>             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

View raw message