incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: Counters in 0.8 -- conditional?
Date Thu, 03 Feb 2011 08:29:11 GMT
>
> Thanks. Yes I know it's by no means trivial. I thought in case there was an
> index on the column on which I want to place condition, the index machinery
> itself can do the counting (i.e. when the index is updated, the counter is
> incremented). It doesn't seem too orthogonal to the current implementation,
> at least from my very limited experience.
>

It's actually not that easy in Cassandra since a main feature is that the
writes
don't imply a read. But if you want your index to count the number of row
where
foo=bar, you need when a new column foo=bar is written to know if the column
did not exist already in this row, in which cas you should not increment.
Similarly,
if you write foo=42, you need to check if the previous value was foo=bar and
if
yes decrement your index.

--
Sylvain

Mime
View raw message