-
Notifications
You must be signed in to change notification settings - Fork 183
Add sibling-resolution functions. #257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
A resolver function takes a RiakObject and (hopefully) resolves its siblings into a single sibling. Resolvers are invoked automatically when fetching an object returns siblings. The resolver can be set on the client, the bucket, or the individual object. If the object in conflict has no resolver, the bucket's resolver will be used, and then the client's resolver if the bucket has none. The default resolver does no resolution. Also included (but not assigned) is a resolver that selects the latest sibling based on the `last_modified` property; see riak/resolver.py for more details.
else: | ||
raise TypeError("resolver is not a function") | ||
|
||
def _set_resolver(self, value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would do the typecheck on the setter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we are first looking at the bucket, then going to the _client, so I understand why @seancribbs put it in the getter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with a little paranoia.
Nope.
|
+1, belatedly
|
Thanks! |
Add sibling-resolution functions.
Last words before we bid a fond farewell to the 1.4 release? like @evanmcc i'm good with it. |
A resolver function takes a RiakObject and (hopefully) resolves its siblings into a single sibling. Resolvers are invoked automatically when fetching an object returns siblings.
The resolver can be set on the client, the bucket, or the individual object. If the object in conflict has no resolver, the bucket's resolver will be used, and then the client's resolver if the bucket has none.
The default resolver does no resolution. Also included (but not assigned) is a resolver that selects the latest sibling based on the
last_modified
property; see riak/resolver.py for more details.