Look here.
https://github.com/basho/riak_kv/blob/master/src/riak_kv_get_fsm.erl

prepare(timeout, StateData=#state{bkey=BKey={Bucket,_Key}}) ->
    {ok, Ring} = riak_core_ring_manager:get_my_ring(),
    BucketProps = riak_core_bucket:get_bucket(Bucket, Ring),
    DocIdx = riak_core_util:chash_key(BKey),
    N = proplists:get_value(n_val,BucketProps),
    UpNodes = riak_core_node_watcher:nodes(riak_kv),
    Preflist2 = riak_core_apl:get_apl_ann(DocIdx, N, Ring, UpNodes).


Just do riak attach and enter the code b hand.

Preflist2 is what you need. Actually it have vnode names, but correspondign
vnodes are trivial to locate.




On Thu, May 10, 2012 at 11:48 PM, Sam Lang <[email protected]> wrote:

>
> Hello,
>
> Is there a way to query a riak object to get its current locations, i.e.
> which nodes/vnodes in the ring own the object?
>
> Thanks,
> -sam
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
email: [email protected]
skype: i.bogunov
phone: +7 903 131 8499
Regards, Bogunov Ilya
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to