New Counters - client support
yug3sh at yahoo.com
Thu Jul 11 03:48:16 EDT 2013
Thanks, that's helpful. Now I need to figure out if / how this is surfaced in the Java 1.1.1 client (I don't seem to see it anywhere, but maybe I'm missing something).
From: Jeremiah Peschka <jeremiah.peschka at gmail.com>
To: "riak-users at lists.basho.com" <riak-users at lists.basho.com>
Sent: Wednesday, July 10, 2013 8:50 PM
Subject: Re: New Counters - client support
If a counter doesn't exist, it's created when you increment/decrement the counter. Otherwise it returns your API's equivalent of "nothing to see".
So, in CorrugatedIron, you'd call RiakClient.IncrementCounter("bucket", "counter", 1);
After that command completes, the counter has a value of 1; assuming no other increments are made.
To initialize to a different value, simply increment/decrement the counter to the chosen value and begin from there.
Jeremiah Peschka - Founder, Brent Ozar Unlimited
MCITP: SQL Server 2008, MVP
Cloudera Certified Developer for Apache Hadoop
On Jul 10, 2013, at 8:00 PM, Y N <yug3sh at yahoo.com> wrote:
>The counters stuff looks awesome.... can't wait to use it.
>Is this already supported via the currently available clients (specifically, the Java 1.1.1 client)?
>Also, when can we expect some tutorial / documentation around using counters? I looked at the GitHub link, however, some use cases are not very clear (e.g. are all counters automatically initialized to 0? How do you initialize it to a different value)?
>riak-users mailing list
>riak-users at lists.basho.com
riak-users mailing list
riak-users at lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users