You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Benson Margulies <bi...@gmail.com> on 2011/02/18 19:11:16 UTC

managing a limited-length list as a value

The following is derived from the redis list operations.

The data model is that a key maps to an list of items. The operation
is to push a new item into the front, and discard any items from the
end above a threshold number of items.

of course, this can be done by reading a value, fiddling with it, and
writing it back. I write this email to wonder if there's any native
trickery to avoid having to read the value, but rather permitting some
sort of 'push' operation.

Re: managing a limited-length list as a value

Posted by Norman Maurer <no...@apache.org>.
Hi there,

there is not such an operation in cassandra. The only thing which
comes "close" is the TTL support which will "delete" columns after a
given time. See:

http://www.datastax.com/dev/blog/whats-new-cassandra-07-expiring-columns

Bye,
Norman

2011/2/18 Benson Margulies <bi...@gmail.com>:
> The following is derived from the redis list operations.
>
> The data model is that a key maps to an list of items. The operation
> is to push a new item into the front, and discard any items from the
> end above a threshold number of items.
>
> of course, this can be done by reading a value, fiddling with it, and
> writing it back. I write this email to wonder if there's any native
> trickery to avoid having to read the value, but rather permitting some
> sort of 'push' operation.
>

Re: managing a limited-length list as a value

Posted by "Wangpei (Peter)" <pe...@huawei.com>.
Maybe you can try this: use MAX-time as your column name, then get the first limit columns.

-----邮件原件-----
发件人: Benson Margulies [mailto:bimargulies@gmail.com] 
发送时间: 2011年2月19日 2:11
收件人: user@cassandra.apache.org
主题: managing a limited-length list as a value

The following is derived from the redis list operations.

The data model is that a key maps to an list of items. The operation
is to push a new item into the front, and discard any items from the
end above a threshold number of items.

of course, this can be done by reading a value, fiddling with it, and
writing it back. I write this email to wonder if there's any native
trickery to avoid having to read the value, but rather permitting some
sort of 'push' operation.