cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Fager <>
Subject Re: CounterColumn as a double
Date Mon, 27 Jun 2011 23:33:48 GMT
Longs and Doubles are both 64-bit values and are pretty easily
convertible.  Check out Double.doubleToLongBits and
Double.longBitsToDouble in the JDK; you can also read more about the
details of the conversion and get some pointers to some code in a post
I wrote last year:  (the emphasis
is on using doubles in key strings, but it should cover what you

On Mon, Jun 27, 2011 at 7:13 PM, Joseph Stein <> wrote:
> So has anyone considered using the CounterColumn for summing?
> I wanted to-do this over the weekend until I realized it was only a long :(
> so using it for things like duration (as an example for me this would have
> been great to keep track of aggregate durations of ad impressions) are not
> possible (or total costs when processing business workflows, etc,etc).
> I thought this might be a little more the speed of a first contribution too
> :) and also helps out with more functionality since a lot of real time
> analytics will need double.
> Let me know, I think it is a good feature.
> Implementing it not sure we would want to break the thrift interface I would
> suggest that I would create another interface for the double value?
> Under the hood of the thrift interface I was thinking of creating a
> CounterValue class and then setting the lValue or the dValue depending on
> which thrift function was called. I can update the thrift, add a sister
> function and re-work the entire code path of long CounterColumn.value into
> CounterValue CounterColumn.value.
> /*
> Joe Stein
> Twitter: @allthingshadoop <>
> */

View raw message