API question about conflict resolution and getValue(s)

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

API question about conflict resolution and getValue(s)

ジョハンガル

Hello,

 

I have a simple question regarding FetchValue.Response/getValue, FetchValue.Response/getValues and conflict resolution.

 

In the documentation http://docs.basho.com/riak/kv/2.2.3/developing/usage/conflict-resolution/
the described sequence is: "fetch -> getValue -> modify -> store"

does: "fetch -> getValues -> ... pick one ... -> modify -> store", work?

 

Is the causal context from the implicitly resolved object obtained from getValue, the same than the causal context in the siblings recovered with getValues?

 

 

Best regards,

Johan Gall

 

ps: riak 2.1.4, buckets with types so by default DVV enabled, com.basho.riak/riak-client "2.1.1" 


_______________________________________________
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: API question about conflict resolution and getValue(s)

Russell Brown-4
Hi,
Which client are you using?


On 6 Apr 2017, at 12:48, ジョハンガル <[hidden email]> wrote:

> Hello,
>  
> I have a simple question regarding FetchValue.Response/getValue, FetchValue.Response/getValues and conflict resolution.
>  
> In the documentation http://docs.basho.com/riak/kv/2.2.3/developing/usage/conflict-resolution/
> the described sequence is: "fetch -> getValue -> modify -> store"
> does: "fetch -> getValues -> ... pick one ... -> modify -> store", work?

The context you get from a fetch is the one you should send back with the resolved value, whatever strategy you use to converge the sibling values into a single value (even “pick one”!)

You should check the docs for the client library you use whether it handles passing the context around “behind” the scenes for you or not.

>  
> Is the causal context from the implicitly resolved object obtained from getValue, the same than the causal context in the siblings recovered with getValues?

Is there a client that implicitly resolves siblings via a call to “getValue”? Even if there is, I would hope and expect that it uses the same causal context as it fetched, and should therefore be the same as the one returned by ”getValues”. If you let use know which client you use I could probably give a more certain answer.

Russell

>  
>  
> Best regards,
> Johan Gall
>  
> ps: riak 2.1.4, buckets with types so by default DVV enabled, com.basho.riak/riak-client "2.1.1"
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: API question about conflict resolution and getValue(s)

Luke Bakken
In reply to this post by ジョハンガル
Hi Johan,

I'm assuming you're using the Java client, and the getValues method shown here:

https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/api/commands/kv/KvResponseBase.java#L80-L91

> does: "fetch -> getValues -> ... pick one ... -> modify -> store", work?

Yes. Please refer to the docs here:

https://docs.basho.com/riak/kv/2.2.3/developing/usage/conflict-resolution/java/#conflict-resolution-and-writes

Thanks -

--
Luke Bakken
Engineer
[hidden email]

On Thu, Apr 6, 2017 at 4:48 AM, ジョハンガル <[hidden email]> wrote:

>
> Hello,
>
> I have a simple question regarding FetchValue.Response/getValue, FetchValue.Response/getValues and conflict resolution.
>
> In the documentation http://docs.basho.com/riak/kv/2.2.3/developing/usage/conflict-resolution/
> the described sequence is: "fetch -> getValue -> modify -> store"
>
> does: "fetch -> getValues -> ... pick one ... -> modify -> store", work?
>
> Is the causal context from the implicitly resolved object obtained from getValue, the same than the causal context in the siblings recovered with getValues?

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