Copying counters from cluster A to B using Java client.

Russell Brown russell.brown at me.com
Wed Jan 29 06:43:46 EST 2014


On 29 Jan 2014, at 11:27, Guido Medina <guido.medina at temetra.com> wrote:

> Hi,
> 
> We are using Riak Java client 1.4.x and we want to copy all counters from cluster A to cluster B (all counters will be stored on a single to very few buckets), if I list the keys using special 2i bucket index and then treat each key as IRiakObject, will that be enough to copy counters, or will counter siblings stop me from doing that?

There shouldn’t ever be a sibling in a counter object, so that _should_ work.

However, since you've mentioned copying from cluster to cluster, expect a sales call any minute…to preempt that, let me tell you about a wonderful piece of software we sell at Basho that could solve this very problem for you…http://basho.com/riak-enterprise/

Cheers

Russell

>  Since at Riak Java client CounterObject is not an IRiakObject, it is instead an operation.
> 
> Comments at a working method:
> 
> Source bucket: Bucket from Riak client pointing to source cluster.
> Dest bucket: Bucket from Riak client pointing to dest bucket.
> 
>   protected void copyOneItem(final Bucket sourceBucket, final Bucket destBucket, final String key) throws RiakRetryFailedException
>   {
>     final IRiakObject riakObject=sourceBucket.fetch(key).execute();
>     if(riakObject!=null){
>       destBucket.store(riakObject).withoutFetch().execute();
>     }
>   }
> 
> 
> Regards,
> 
> Guido.
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140129/c3ad900c/attachment.asc>


More information about the riak-users mailing list