You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2011/06/28 12:02:17 UTC

[jira] [Commented] (CASSANDRA-2833) CounterColumn should have an optional binary field so that double can be incremented/decremented along with long

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

Sylvain Lebresne commented on CASSANDRA-2833:
---------------------------------------------

Do people really still use double nowadays ?! :)

I mean I'll admit that I don't see right away why you can't use long to track durations or "other values common to analytics". Don't get me wrong, that may require the client to multiply its values by some power of 10, but *not feasible* seems a bit of a strong word to me. I guess what I'm saying is that I think we should avoid being in the "let's have it because it sounds cool" (a.k.a feature creep) and make sure we stay in "let's have it because it is generally useful and solve a problem that can't be solved otherwise easily" land.  And I'm not saying that adding double support is of the former kind, but I guess I'm not yet convinced it is completely of the latter kind either.

Initial ranting being done, this is technically doable and fairly easily so.  This will add a bit of clutter internally (imho, you'd want to add a DoubleCounterType (or RealCounterType so people don't think it doubles the value each time) and subclass/refactor CounterContext somehow) but probably not too much.

> CounterColumn should have an optional binary field so that double can be incremented/decremented along with long
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2833
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2833
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Joe Stein
>
> Currently CounterColumn only has a long making it not feasible to track increment/decrement of durations or other values common to analytics represented as a double
> The change I am proposing to implement, after some discussions/advice in the irc to issues raised, is to add a new optional binary field to CounterColumn (thrift).  I was thinking we could call it *operand*
> Under the hood (src/java/org/apache/cassandra/db/CounterColumn.java) I would handle things with byte[] moving between long and double as internal helper functions with case switch on type of operand we are setting.... might also need an optional enum for type perhaps too so the client can let the server know how it should materialize the bytes for when it += the value stored
> The clients should continue to work as expected and folks looking to use this can just do so.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira