order of siblings
nico.meyer at adition.com
Sun Mar 25 08:46:32 EDT 2012
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
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.
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:
> ...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?
> riak-users mailing list
> riak-users at lists.basho.com
More information about the riak-users