Skip to content

Instantly share code, notes, and snippets.

@bsparrow435
Created July 31, 2013 20:35
Show Gist options
  • Select an option

  • Save bsparrow435/6125903 to your computer and use it in GitHub Desktop.

Select an option

Save bsparrow435/6125903 to your computer and use it in GitHub Desktop.

Revisions

  1. bsparrow435 created this gist Jul 31, 2013.
    10 changes: 10 additions & 0 deletions ring.erl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    Bucket = <<"d">>,
    Key = <<"e0c97a4cde6c">>,
    BKey = {Bucket,Key},
    {ok, Ring} = riak_core_ring_manager:get_my_ring(),
    DocIdx = riak_core_util:chash_key(BKey),
    BucketProps = riak_core_bucket:get_bucket(Bucket, Ring),
    [NValue] = [Y || {X1, Y} <- BucketProps, n_val == X1],
    UpNodes = riak_core_node_watcher:nodes(riak_kv),
    Preflist2 = riak_core_apl:get_apl_ann(DocIdx, NValue, Ring, UpNodes),
    Preflist = [{IndexNode, Type} || {IndexNode, Type} <- Preflist2].