Bryce, 

You have two options.

The first is just to delete the keys. As long as they are deleted at every 
replica and there are no concurrent increments, then no counters will make a 
return and change what you're counting. Counters are initialised to zero. 

The other option is to decrement/increment the counter back to zero. Here's 
some code that should do so (using the 1.4 counters API) [1]. Please test it 
out before running it in production. This of course keeps updates around, and 
will also be affected by concurrent updates (the zeroing will decrement by 
however much it observes the counter to be). The code provided won't work with 
2.0, but i can talk you through re-writing it.

Sam

[1] https://gist.github.com/lenary/334978ac1df0c21c4cc2 

-- 
Sam Elliott
Engineer
[email protected]
--


On Friday, 13 December 2013 at 4:45PM, Bryce Verdier wrote:

> Hey all,
> 
> Is there a way to use the mapreduce (with erlang code), to zero out all 
> the counters within a bucket?
> Thanks in advance,
> 
> Bryce
> 
> 
> _______________________________________________
> riak-users mailing list
> [email protected] (mailto:[email protected])
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com




_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to