cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vlad Paiu <vladp...@opensips.org>
Subject Re: Cassandra Counters and TTL
Date Mon, 07 Nov 2011 09:12:19 GMT
Hello,

Thanks for your answer. See my reply in-line.

On 11/04/2011 01:46 PM, Amit Chavan wrote:
>
> Answers inline.
>
> On Fri, Nov 4, 2011 at 4:59 PM, Vlad Paiu <vladpaiu@opensips.org 
> <mailto:vladpaiu@opensips.org>> wrote:
>
>     Hello,
>
>     I'm a new user of Cassandra and I think it's great.
>     Still, while developing my APP using Cassandra, I got stuck with
>     some things and I'm not really sure that Cassandra can handle them
>     at the moment.
>
>     So, first of all, does Cassandra allow for Counters and regular
>     Keys to be located in the same ColumnFamily ?
>
> What do you mean when you say "regular Keys"? If you are hinting at 
> columns apart from counters, then the answer is *no*: only counters 
> can exist in a CounterColumnFamily and other column families cannot 
> hold counters.
Yes, this is what I was asking. Thanks for the answer.
>
>
>     Secondly, is there any way to dynamically set the TTL for a key ?
>     In the sense that I have a key, I initially set it with no TTL,
>     but after a while I decide that it should expire in 100 seconds.
>     Can Cassandra do this ?
>
> TTL is not for one key, it is for one column.

When I was saying 'Key' I actually meant to say column. Seems I'm not 
yet very acquainted with Cassandra terminology. So in the end, can you 
dynamically alter the TTL of a Column ?

>
>     3. Can counters have a TTL ?
>
> No. Currently, counters do not (or if I am correct - cannot) have TTL.
>
>
Ok. Any info if this will be implemented anytime soon ?

>     4. Is there any way to atomically reset a counter ? I read on the
>     website that the only way to do it is read the variable value, and
>     then set it to -value, which seems rather bogus to me.
>
> I think that is the only way to reset a counter. I would like to know 
> if there is another way.
>
Ok then, waiting for someone to confirm. It's bad that you cannot 
atomically reset a counter value, as a two-way resetting might lead to 
undetermined behaviour.

Also, can I set the counter to a specific value, without keeping state 
on the client ? For example, if the client does not know the current 
counter value is 3. Can it set the counter value to 10, without first 
getting the counter value, and then incrementing by 7 ?

> Background: I am using Cassandra since the past two months. Hope the 
> community corrects me if I am wrong.
>
>
>     Regards,
>
>     -- 
>     Vlad Paiu
>     OpenSIPS Developer
>
>
>
>
> -- 
> Regards
> Amit S. Chavan
>
>
>

Regards,

Vlad Paiu
OpenSIPS Developer



Mime
View raw message