Hello Michael,

the siblings returned by the Protobuf API have two properties calles 'last_mod' and 'last_mod_usec', which contain the (unix-)timestamp and the microsend part for the time on which the sibling was last modified. allow_mult_=true actually uses the contents of this field to return the newest sibling.

If the client you are using does not expose these values, you should complain to the authors. I know the official(?) python client exposes these values as metadata entries, using the constants riak.metadata.MD_LASTMOD(_USECS). After a cursory glance at the Java client, there seems to be a 'getLastModified()' method as well, which returns a Date object.

Cheers,
Nico

On 24.03.2012 19:24, Michael Radford wrote:
Is there a way to determine what Riak thinks is the last-written
sibling (or one of them), when reading from Riak with allow_mult=true
(via the erlang protobufs api)?

I'm writing some conflict resolution code, which in many cases should
fall back to the default strategy of last-writer-wins, and it would be
nice to use Riak's default ordering instead of embedding an extra
timestamp in the value.

It looks like something like the unpacking of the vclock here might work:
https://gist.github.com/1380896

...assuming the vclock entries are 1-1 with the siblings, but that's
not clear to me. Or maybe the siblings already come in a particular
order, oldest or newest first?

Thanks,
Mike

_______________________________________________
riak-users mailing list
[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