The Datastax post on counters says:
"Prior to 0.8, Cassandra had no simple and efficient way to count. By
“counting,” we mean here to provide an atomic increment operation in a
single column value, as opposed to counting the number of columns in a row,
or rows in a column family, both of which were already supported."

So, maybe there's a way you can count the # of columns in the row in the
application side before you create a new column. You'll pretty much have to
add the count + delete + add logic to the application.

You might also want to use expiring columns, but depends on your use case.

http://www.datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters



On Mon, Jul 18, 2011 at 3:56 PM, aaron morton <aa...@thelastpickle.com>wrote:

> There is no support for a feature like that, and i doubt it would ever be
> supported. For one there there are no locks during a write, so it's not
> possible to definitively say there are 100 columns at a particular instance
> of time.
>
> You would need to read all columns and delete the ones you no longer need.
>
> You could also try Redis.
>
> Cheers
>
>
> -----------------
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 19 Jul 2011, at 03:22, JKnight JKnight wrote:
>
> > Dear all,
> >
> > I want to keep only 100 column of a key: when I add a column for a key,
> if the number column of key is 100, another column (by order) will be
> deleted.
> >
> > Does Cassandra have setting for that?
> >
> > --
> > Best regards,
> > JKnight
>
>

Reply via email to