incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Popescu <al...@datastax.com>
Subject Re: Is there update-in-place on maps?
Date Thu, 08 Aug 2013 05:05:02 GMT
On Wed, Aug 7, 2013 at 10:47 AM, Aaron Morton <aaron@thelastpickle.com>wrote:

> As for the atomic increment, I take the answer is 'no, there is no atomic
> increment, I have to pull the value to the client and send an update with
> the new value'.
>
> Saying "atomic increment" is probably confusing.
> You cannot have Counters, the thing most people would think about when you
> say "increment", in a collection type.
>
> You can update the values in a map server side.
>
> If you can provide a concrete example of what you want to do it may be
> easier.
>
>

I think the OP is asking if the following op is atomic:

UPDATE users SET favs['posts'] = favs['post'] + 1 WHERE id = 'smith'


:- a)

Cheers
>
> -----------------
> Aaron Morton
> Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 6/08/2013, at 10:05 PM, Andy Twigg <andy.twigg@gmail.com> wrote:
>
> Counters can be atomically incremented (
> http://wiki.apache.org/cassandra/Counters). Pick a UUID for the counter,
> and use that: c=map.get(k); c.incr()
>
>
> On 6 August 2013 11:01, Jan Algermissen <jan.algermissen@nordsc.com>wrote:
>
>>
>> On 06.08.2013, at 11:36, Andy Twigg <andy.twigg@gmail.com> wrote:
>>
>> > Store pointers to counters as map values?
>>
>> Sorry, but this fits into nothing I know about C* so far - can you
>> explain?
>>
>> Jan
>>
>>
>
>
> --
> Dr Andy Twigg
> Junior Research Fellow, St Johns College, Oxford
> Room 351, Department of Computer Science
> http://www.cs.ox.ac.uk/people/andy.twigg/
> andy.twigg@cs.ox.ac.uk | +447799647538
>
>
>


-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru

Mime
View raw message