You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Avi-h <av...@gmail.com> on 2012/08/26 14:44:10 UTC

TTL and Cassandra counters

Hello

Our current application uses Cassandra to hold the chat items for user’s
conversation and a counter of unread chat messages (per each conversation).
We use TTL to delete old chat items, but we fail to see how we can define a
call back which will trigger an update (decrease) to the counters’ value.

Please consult on how we can achieve a solution for this issue..




--
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/TTL-and-Cassandra-counters-tp7581990.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: TTL and Cassandra counters

Posted by aaron morton <aa...@thelastpickle.com>.
>  but we fail to see how we can define a
> call back which will trigger an update (decrease) to the counters’ value.
It's not possible. 

TTL kind of works in two steps. First we stop returning the column in results, later the column will be purged during compaction. So there is no "hey this timer run out" event.

> Please consult on how we can achieve a solution for this issue..
Best I could offer would be to expire the messages manually and avoid using TTL. 

Otherwise let the count get out of sync, and repair it the next time the user the messages. 

Cheers

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 27/08/2012, at 12:44 AM, Avi-h <av...@gmail.com> wrote:

> Hello
> 
> Our current application uses Cassandra to hold the chat items for user’s
> conversation and a counter of unread chat messages (per each conversation).
> We use TTL to delete old chat items, but we fail to see how we can define a
> call back which will trigger an update (decrease) to the counters’ value.
> 
> Please consult on how we can achieve a solution for this issue..
> 
> 
> 
> 
> --
> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/TTL-and-Cassandra-counters-tp7581990.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.