Created
August 25, 2014 19:38
-
-
Save alexmoore/1429bebda4ebb924c4b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FindPrimaries = fun(Bucket, Key, Ring) -> | |
BKey = {Bucket,Key}, | |
DocIdx = riak_core_util:chash_key(BKey), | |
BucketProps = riak_core_bucket:get_bucket(Bucket, Ring), | |
[NValue] = [Y || {X1, Y} <- BucketProps, n_val == X1], | |
CHBin = chashbin:create(riak_core_ring:chash(Ring)), | |
Itr = chashbin:iterator(DocIdx, CHBin), | |
{Primaries, Itr2} = chashbin:itr_pop(3, Itr), | |
Primaries | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment