How to specify write consistency level in riak java client 0.14 version

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to specify write consistency level in riak java client 0.14 version

vijayakumar
Hi,
  I am using riak java client 0.14 version to insert records, but I am not able to locate any method or options to specify write consistency level. Store method has the following signature store(RiakObject obj). Am I missing anything else?  Kindly help me out.

Regards,
Vijayakumar
_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: How to specify write consistency level in riak java client 0.14 version

Russell Brown-2
Hi Vijayakumar,
Firstly, sorry for the slow response, this one slipped past.


On 17 Nov 2011, at 13:23, vijayakumar wrote:

> Hi,
>   I am using riak java client 0.14 version to insert records, but I am not able to locate any method or options to specify write consistency level. Store method has the following signature store(RiakObject obj). Am I missing anything else?  Kindly help me out.

Ok, so in 0.14 the PB and HTTP client don't share an interface but have mirrored signatures, really. Both have a second, overloaded store method that takes a second parameter: RequestMeta. This RequestMeta lets you set W/DW values.

Also, the 1.0.x version of the Riak Java Client has been out for a while now, and amongst other things, you get a common API for HTTP and PB. If you use the Bucket interface then you set W/DW/PW on the StoreObject builder like this:

bucket.store(myObject).w(3).dw(1).execute();

Cheers

Russell

>
> Regards,
> Vijayakumar _______________________________________________
> riak-users mailing list
> [hidden email]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


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