cassandra-commits mailing list archives

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

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

Benedict edited comment on CASSANDRA-9499 at 6/16/15 4:41 PM:
--------------------------------------------------------------

When I said little endian, it was a typo. Typically we use big endian, so we want any method
to assume this. I hadn't noticed that they chose to implement it was, effectively, little
endian encoding. Which is another reason to switch: it's confusing to swap between different
types of encoding, and breaks assumptions. However, if we wanted to implement this optimisation
for the current encoding scheme, we would just modify if to a shift left instead of an &,
followed by a Long.reverseBytes() (nb: admittedly without thinking about it too rigorously).
If we're going to implement a different encoding scheme, though, it's probably better to just
do that...

That said, it is a shame we didn't standardise on little endian, given our main target platform
is little endian. I know Java defaults to big endian, but the target platform is more important.
That's a much scarier change than modifying this, though, so let's not go there. Probably
ever. 


was (Author: benedict):
When I said little endian, it was a typo. Typically we use big endian, so we want any method
to assume this. I hadn't noticed that they chose to implement it was, effectively, little
endian encoding. Which is another reason to switch: it's confusing to swap between different
types of encoding, and breaks assumptions. However, if we wanted to implement this optimisation
for the current encoding scheme, we would just modify if to a shift left instead of an &,
followed by a Long.reverseBytes() (nb: admittedly without thinking about it too rigorously)

That said, it is a shame we didn't standardise on little endian, given our main target platform
is little endian. I know Java defaults to big endian, but the target platform is more important.
That's a much scarier change than modifying this, though, so let's not go there. Probably
ever. 

> 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