Skip to content

Instantly share code, notes, and snippets.

@bsparrow435
Created July 19, 2013 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsparrow435/6042183 to your computer and use it in GitHub Desktop.
Save bsparrow435/6042183 to your computer and use it in GitHub Desktop.
f().
Vnode = fun(Idx) ->
[{I,P}] = [ {Index,Pid} || {Mod,Index,Pid} <- gen_server:call(riak_core_vnode_manager,all_vnodes),Mod == riak_kv_vnode, Index == Idx],
{I,P}
end,
Vnodes = fun() ->
[ I || {Mod,I,P} <- gen_server:call(riak_core_vnode_manager,all_vnodes), Mod == riak_kv_vnode ]
end,
BitcaskRefState = fun(Idx) ->
{_,P} = Vnode(Idx),
{dictionary, Dict} = process_info(P, dictionary),
[{Ref,State}] = lists:filter(fun({R,S}) -> is_reference(R) end, Dict),
erlang:put(Ref,State),
{Ref,State}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment