Commits

Anonymous committed 566afcf

backends now store under {Bucket,Key} instead of hashed "Storekey"

only ets backend is converted, as of this commit

  • Participants
  • Parent commits f0e19c1

Comments (0)

Files changed (6)

src/riak_ets_backend.erl

 -behaviour(gen_server).
 
 -include_lib("eunit/include/eunit.hrl").
--export([start/1,stop/1,get/2,put/4,list/1,list_bucket/2,delete/2]).
+-export([start/1,stop/1,get/2,put/3,list/1,list_bucket/2,delete/2]).
 
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
 	 terminate/2, code_change/3]).
 
 %% @private
 handle_call(stop,_From,State) -> {reply, srv_stop(State), State};
-handle_call({get,Key},_From,State) -> {reply, srv_get(State,Key), State};
-handle_call({put,{B,K},Key,Val},_From,State) ->
-    {reply, srv_put(State,{B,K},Key,Val),State};
-handle_call({delete,Key},_From,State) -> {reply, srv_delete(State,Key),State};
+handle_call({get,BKey},_From,State) -> {reply, srv_get(State,BKey), State};
+handle_call({put,BKey,Val},_From,State) ->
+    {reply, srv_put(State,BKey,Val),State};
+handle_call({delete,BKey},_From,State) -> {reply, srv_delete(State,BKey),State};
 handle_call(list,_From,State) -> {reply, srv_list(State), State};
 handle_call({list_bucket,Bucket},_From,State) ->
     {reply, srv_list_bucket(State, Bucket), State}.
 % get(state(), Key :: binary()) ->
 %   {ok, Val :: binary()} | {error, Reason :: term()}
 % key must be 160b
-get(SrvRef, Key) -> gen_server:call(SrvRef,{get,Key}).
-srv_get(State, Key) ->
-    case ets:lookup(State#state.t,Key) of
+get(SrvRef, BKey) -> gen_server:call(SrvRef,{get,BKey}).
+srv_get(State, BKey) ->
+    case ets:lookup(State#state.t,BKey) of
         [] -> {error, notfound};
-        [{Key,{_,_,Val}}] -> {ok, Val};
+        [{BKey,Val}] -> {ok, Val};
         Err -> {error, Err}
     end.
 
 %     Val :: binary()) ->
 %   ok | {error, Reason :: term()}
 % key must be 160b
-put(SrvRef, {B,K}, Key, Val) -> gen_server:call(SrvRef,{put,{B,K},Key,Val}).
-srv_put(State,{B,K},Key,Val) ->       
-   case ets:insert(State#state.t, {Key,{B,K,Val}}) of
+put(SrvRef, BKey, Val) -> gen_server:call(SrvRef,{put,BKey,Val}).
+srv_put(State,BKey,Val) ->
+   case ets:insert(State#state.t, {BKey,Val}) of
         true -> ok;
         Err -> {error, Err}
     end.
 % delete(state(), Key :: binary()) ->
 %   ok | {error, Reason :: term()}
 % key must be 160b
-delete(SrvRef, Key) -> gen_server:call(SrvRef,{delete,Key}).
-srv_delete(State, Key) ->
-    case ets:delete(State#state.t, Key) of
+delete(SrvRef, BKey) -> gen_server:call(SrvRef,{delete,BKey}).
+srv_delete(State, BKey) ->
+    case ets:delete(State#state.t, BKey) of
         true -> ok;
         Err -> {error, Err}
     end.
 list_bucket(SrvRef, Bucket) ->
     gen_server:call(SrvRef,{list_bucket, Bucket}).
 srv_list_bucket(State, Bucket) ->
-    MList = ets:match(State#state.t,{'_',{Bucket,'$1','_'}}),
+    MList = ets:match(State#state.t,{{Bucket,'$1'},'_'}),
     list(MList,[]).
 
 %% @private

src/riak_get_fsm.erl

                 r :: pos_integer(), 
                 allowmult :: bool(), 
                 preflist :: [{pos_integer(), atom()}], 
-                storekey :: binary(), 
                 waiting_for :: [{pos_integer(), atom(), atom()}],
                 req_id :: pos_integer(), 
                 starttime :: pos_integer(), 
                 repair_sent :: list(), 
                 final_obj :: undefined|riak_object:riak_object(),
                 endtime :: pos_integer(), 
-                bucket :: riak_object:bucket(), 
-                key :: riak_object:key(), 
+                bkey :: {riak_object:bucket(), riak_object:key()},
                 ring :: riak_ring:riak_ring()
                }).
 
 %% @private
 init([Ring,Bucket,Key,R,Timeout,Client]) ->
     RealStartTime = riak_util:moment(),
-    Storekey = chash:key_of({Bucket,Key}),
-    ReqID = erlang:phash2({random:uniform(), self(), Storekey, RealStartTime}),
+    DocIdx = chash:key_of({Bucket, Key}),
+    ReqID = erlang:phash2({random:uniform(), self(), DocIdx, RealStartTime}),
     riak_eventer:notify(riak_get_fsm, get_fsm_start,
                         {ReqID, RealStartTime, Bucket, Key}),
-    Msg = {self(), Storekey, ReqID},
+    Msg = {self(), {Bucket,Key}, ReqID},
     BucketProps = riak_bucket:get_bucket(Bucket, Ring),
     N = proplists:get_value(n_val,BucketProps),
     AllowMult = proplists:get_value(allow_mult,BucketProps),
-    Preflist = riak_ring:filtered_preflist(Storekey, Ring, N),
+    Preflist = riak_ring:filtered_preflist(DocIdx, Ring, N),
     {Targets, Fallbacks} = lists:split(N, Preflist),
     {Sent1, Pangs1} = riak_util:try_cast(vnode_get, Msg, Targets),
     Sent = case length(Sent1) =:= N of   % Sent is [{Index,TargetNode,SentNode}]
     riak_eventer:notify(riak_get_fsm, get_fsm_sent,
                                 {ReqID, [{T,S} || {_I,T,S} <- Sent]}),
     StateData = #state{client=Client,n=N,r=R,allowmult=AllowMult,repair_sent=[],
-                       preflist=Preflist,storekey=Storekey,final_obj=undefined,
+                       preflist=Preflist,final_obj=undefined,
                        req_id=ReqID,replied_r=[],replied_fail=[],
                        replied_notfound=[],starttime=riak_util:moment(),
                        waiting_for=Sent,endtime=Timeout+riak_util:moment(),
-                       bucket=Bucket,key=Key, ring=Ring},
+                       bkey={Bucket,Key}, ring=Ring},
     {ok,waiting_vnode_r,StateData,Timeout}.
 
 waiting_vnode_r({r, {ok, RObj}, Idx, ReqID},
     NewStateData = StateData#state{replied_fail=Replied},
     {next_state,waiting_read_repair,NewStateData,End-riak_util:moment()};
 waiting_read_repair(timeout, StateData=#state{final_obj=Final,
-                                               replied_r=RepliedR,
-                                               storekey=Storekey,req_id=ReqID,
-                                               replied_notfound=NotFound,
-                                               ring=Ring}) ->
+                                              replied_r=RepliedR,
+                                              bkey=BKey,
+                                              req_id=ReqID,
+                                              replied_notfound=NotFound,
+                                              ring=Ring}) ->
     case Final of
         {error, notfound} ->
             maybe_finalize_delete(StateData);
         {ok,_} ->
-            maybe_do_read_repair(Ring,Final,RepliedR,NotFound,Storekey,ReqID);
+            maybe_do_read_repair(Ring,Final,RepliedR,NotFound,BKey,ReqID);
         _ -> nop
     end,
     {stop,normal,StateData}.
 
 maybe_finalize_delete(_StateData=#state{replied_notfound=NotFound,n=N,
-                                        replied_r=RepliedR,storekey=Storekey,
+                                        replied_r=RepliedR,
                                         waiting_for=Sent,req_id=ReqID,
-                                        bucket=Bucket,key=Key}) ->
+                                        bkey=BKey}) ->
     spawn(fun() ->
     IdealNodes = [{I,Node} || {I,Node,Node} <- Sent],
     case length(IdealNodes) of
                         true -> % and every response was X-Deleted, go!
                             riak_eventer:notify(riak_get_fsm,
                                                 delete_finalize_start,
-                                                {ReqID, Bucket, Key}),
+                                                {ReqID, BKey}),
                             [gen_server2:call({riak_vnode_master, Node},
                                              {vnode_del, {Idx,Node},
-                                              {Storekey,ReqID}}) ||
+                                              {BKey,ReqID}}) ||
                                 {Idx,Node} <- IdealNodes];
                         _ -> nop
                     end;
     end
     end).
 
-maybe_do_read_repair(Ring,Final,RepliedR,NotFound,Storekey,ReqID) ->
+maybe_do_read_repair(Ring,Final,RepliedR,NotFound,BKey,ReqID) ->
     Targets0 = ancestor_indices(Final, RepliedR) ++ NotFound,
     Targets = [{Idx,riak_ring:index_owner(Ring,Idx)} || Idx <- Targets0],
     {ok, FinalRObj} = Final,
-    Msg = {self(), Storekey, FinalRObj, ReqID},
+    Msg = {self(), BKey, FinalRObj, ReqID},
     case Targets of
         [] -> nop;
         _ ->

src/riak_map_executor.erl

 
 -export([wait/2]). 
 
--record(state, {bucket,key,qterm,storekey,phase_pid,vnodes,keydata,ring}).
+-record(state, {bkey,qterm,phase_pid,vnodes,keydata,ring}).
 
 % {link, Bucket, Tag, Acc}
 % {map, FunTerm, Arg, Acc}
 %% @private
 init([Ring,{{Bucket,Key},KeyData},QTerm0,PhasePid]) ->
     riak_eventer:notify(riak_map_executor, mapexec_start, start),
-    Storekey = chash:key_of({Bucket,Key}),
+    DocIdx = chash:key_of({Bucket,Key}),
     BucketProps = riak_bucket:get_bucket(Bucket, Ring),
     LinkFun = case QTerm0 of
         {link,_,_,_} -> proplists:get_value(linkfun, BucketProps);
                         {link, LB, LT, LAcc} -> {map, LinkFun, {LB, LT}, LAcc}
                     end,
             N = proplists:get_value(n_val,BucketProps),
-            Preflist = riak_ring:filtered_preflist(Storekey, Ring, N),
+            Preflist = riak_ring:filtered_preflist(DocIdx, Ring, N),
             {Targets, _} = lists:split(N, Preflist),
-            VNodes = try_vnode(QTerm, Storekey, KeyData, Targets),
+            VNodes = try_vnode(QTerm, {Bucket,Key}, KeyData, Targets),
             {ok,wait,
-             #state{bucket=Bucket,key=Key,qterm=QTerm,phase_pid=PhasePid,
-                    storekey=Storekey,vnodes=VNodes,keydata=KeyData,ring=Ring},
+             #state{bkey={Bucket,Key},qterm=QTerm,phase_pid=PhasePid,
+                    vnodes=VNodes,keydata=KeyData,ring=Ring},
              1000}
     end.
 
-try_vnode(QTerm, Storekey, KeyData, [{P,VN}|VNs]) ->
-    riak_eventer:notify(riak_map_executor, try_vnode, {QTerm,Storekey,P,VN}),
+try_vnode(QTerm, BKey, KeyData, [{P,VN}|VNs]) ->
+    riak_eventer:notify(riak_map_executor, try_vnode, {QTerm,BKey,P,VN}),
     gen_server:cast({riak_vnode_master, VN},
                     {vnode_map, {P,node()},
-                     {self(),QTerm,Storekey,KeyData}}),
+                     {self(),QTerm,BKey,KeyData}}),
     VNs.
     
 wait(timeout, StateData=#state{phase_pid=PhasePid,vnodes=[]}) ->
     gen_fsm:send_event(PhasePid, {mapexec_error, self(), "all nodes failed"}),
     {stop,normal,StateData};
 wait(timeout, StateData=
-     #state{vnodes=VNodes,qterm=QTerm,storekey=Storekey,keydata=KeyData}) ->
+     #state{vnodes=VNodes,qterm=QTerm,bkey=BKey,keydata=KeyData}) ->
     {next_state, wait, StateData#state{
-                         vnodes=try_vnode(QTerm, Storekey, KeyData, VNodes)},
+                         vnodes=try_vnode(QTerm, BKey, KeyData, VNodes)},
      1000};
 wait({mapexec_error, VN, ErrMsg},
      StateData=#state{phase_pid=PhasePid,vnodes=[]}) ->
     gen_fsm:send_event(PhasePid, {mapexec_error, self(), "all nodes failed"}),
     {stop,normal,StateData};
 wait({mapexec_error, VN, ErrMsg},StateData=
-     #state{vnodes=VNodes,qterm=QTerm,storekey=Storekey,keydata=KeyData}) ->
+     #state{vnodes=VNodes,qterm=QTerm,bkey=BKey,keydata=KeyData}) ->
     riak_eventer:notify(riak_map_executor, mapexec_vnode_err, {VN,ErrMsg}),    
     {next_state, wait, StateData#state{
-                         vnodes=try_vnode(QTerm, Storekey, KeyData, VNodes)},
+                         vnodes=try_vnode(QTerm, BKey, KeyData, VNodes)},
      1000};
 wait({mapexec_reply, RetVal, _VN}, StateData=#state{phase_pid=PhasePid}) ->
     gen_fsm:send_event(PhasePid, {mapexec_reply, RetVal, self()}),

src/riak_put_fsm.erl

                 w :: pos_integer(), 
                 dw :: non_neg_integer(), 
                 preflist :: [{pos_integer(), atom()}], 
-                storekey :: binary(), 
+                bkey :: {riak_object:bucket(), riak_object:key()},
                 waiting_for :: list(),
                 req_id :: pos_integer(), 
                 starttime :: pos_integer(), 
     Key = riak_object:key(RObj),
     riak_eventer:notify(riak_put_fsm, put_fsm_start,
                         {ReqID, RealStartTime, Bucket, Key}),
-    Storekey = chash:key_of({Bucket, Key}),
-    Msg = {self(), Storekey, RObj, ReqID},
+    DocIdx = chash:key_of({Bucket, Key}),
+    Msg = {self(), {Bucket,Key}, RObj, ReqID},
     N = proplists:get_value(n_val,BucketProps),
-    Preflist = riak_ring:filtered_preflist(Storekey, Ring, N),
+    Preflist = riak_ring:filtered_preflist(DocIdx, Ring, N),
     {Targets, Fallbacks} = lists:split(N, Preflist),
     {Sent1, Pangs1} = riak_util:try_cast(vnode_put, Msg, Targets),
     Sent = case length(Sent1) =:= N of   % Sent is [{Index,TargetNode,SentNode}]
     riak_eventer:notify(riak_put_fsm, put_fsm_sent,
                                 {ReqID, [{T,S} || {_I,T,S} <- Sent]}),
     StateData = #state{robj=RObj, client=Client, n=N, w=W, dw=DW,
-                       preflist=Preflist, storekey=Storekey, waiting_for=Sent,
+                       preflist=Preflist, bkey={Bucket,Key}, waiting_for=Sent,
                        req_id=ReqID, starttime=riak_util:moment(),
                        replied_w=[], replied_dw=[], replied_fail=[],
                        endtime=Timeout+riak_util:moment(), ring=Ring},
 
 waiting_vnode_w({w, Idx, ReqID},
                   StateData=#state{w=W,dw=DW,req_id=ReqID,client=Client,
-                                robj=RObj,replied_w=Replied0, endtime=End}) ->
+                                   replied_w=Replied0, endtime=End}) ->
     Replied = [Idx|Replied0],
     case length(Replied) >= W of
         true ->
           StateData=#state{req_id=ReqID, endtime=End}) ->
     {next_state,waiting_vnode_dw,StateData,End-riak_util:moment()};
 waiting_vnode_dw({dw, Idx, ReqID},
-                  StateData=#state{dw=DW, client=Client, robj=RObj,
+                  StateData=#state{dw=DW, client=Client,
                                    replied_dw=Replied0, endtime=End}) ->
     Replied = [Idx|Replied0],
     case length(Replied) >= DW of

src/riak_vnode.erl

                 sidekick=Sidekick,mapcache=Cache,mod=Mod,modstate=ModState}}.
 
 %% @private
-handle_cast({mapcache, Storekey,{M,F,Arg,KeyData},MF_Res},
+handle_cast({mapcache,BKey,{M,F,Arg,KeyData},MF_Res},
             State=#state{mapcache=Cache}) ->
-    KeyCache0 = case dict:find(Storekey, Cache) of
+    KeyCache0 = case dict:find(BKey, Cache) of
         error -> dict:new();
         {ok,CDict} -> CDict
     end,
     KeyCache = dict:store({M,F,Arg,KeyData},MF_Res,KeyCache0),
-    {noreply, State#state{mapcache=dict:store(Storekey,KeyCache,Cache)}};
+    {noreply, State#state{mapcache=dict:store(BKey,KeyCache,Cache)}};
 handle_cast(cache_purge, State=#state{idx=Idx}) ->
     riak_eventer:notify(riak_vnode, cache_purge, Idx),
     {noreply, State#state{mapcache=dict:new()}};
     {noreply, State};
 handle_cast(_, State=#state{active=false}) -> % below here requires "active"
     {noreply, State};
-handle_cast({map, ClientPid, QTerm, Storekey, KeyData},
+handle_cast({map, ClientPid, QTerm, BKey, KeyData},
             State=#state{mapcache=Cache,mod=Mod,modstate=ModState}) ->
     riak_eventer:notify(riak_vnode, map, QTerm),
     VNode = self(),
-    do_map(ClientPid,QTerm,Storekey,KeyData,Cache,Mod,ModState,VNode),
+    do_map(ClientPid,QTerm,BKey,KeyData,Cache,Mod,ModState,VNode),
     {noreply, State};
-handle_cast({put, FSM_pid, Storekey, RObj, ReqID},
+handle_cast({put, FSM_pid, BKey, RObj, ReqID},
             State=#state{mapcache=Cache,idx=Idx}) ->
     riak_eventer:notify(riak_vnode, put, {ReqID, Idx}),
     gen_fsm:send_event(FSM_pid, {w, Idx, ReqID}),
-    do_put(FSM_pid, Storekey, RObj, ReqID, State),
-    {noreply, State#state{mapcache=dict:erase(Storekey,Cache)}};
-handle_cast({get, FSM_pid, Storekey, ReqID}, State=#state{idx=Idx}) ->
+    do_put(FSM_pid, BKey, RObj, ReqID, State),
+    {noreply, State#state{mapcache=dict:erase(BKey,Cache)}};
+handle_cast({get, FSM_pid, BKey, ReqID}, State=#state{idx=Idx}) ->
     riak_eventer:notify(riak_vnode, get, {ReqID, Idx}),
-    do_get(FSM_pid, Storekey, ReqID, State),
+    do_get(FSM_pid, BKey, ReqID, State),
     {noreply, State};
-handle_cast({delete, Client, Storekey, ReqID}, State=#state{idx=Idx}) ->
+handle_cast({delete, Client, BKey, ReqID}, State=#state{idx=Idx}) ->
     riak_eventer:notify(riak_vnode, delete, {ReqID, Idx}),
-    do_delete(Client, Storekey, ReqID, State),
+    do_delete(Client, BKey, ReqID, State),
     {noreply, State};
 handle_cast({list_bucket, Client, Bucket, ReqID},
             State=#state{mod=Mod,modstate=ModState,idx=Idx}) ->
 %% @private
 handle_call(is_backup_node,_From,State) ->
     {reply, riak:get_app_env(backup, false), State};
-handle_call({get_binary,Storekey},
+handle_call({get_binary,BKey},
             From,State=#state{mod=Mod,modstate=ModState}) ->
-    async_get_binary(From,Storekey,Mod,ModState),
+    async_get_binary(From,BKey,Mod,ModState),
     {noreply, State};
 handle_call(list,From,State=#state{mod=Mod,modstate=ModState}) ->
     async_do_list(From,Mod,ModState),
     {noreply, State}.
 
-do_get(FSM_pid, Storekey, ReqID,
+do_get(FSM_pid, BKey, ReqID,
        _State=#state{idx=Idx,mod=Mod,modstate=ModState}) ->
-    RetVal = case do_get_binary(Storekey, Mod, ModState) of
+    RetVal = case do_get_binary(BKey, Mod, ModState) of
         {ok, Binary} -> {ok, binary_to_term(Binary)};
         X -> X
     end,
     riak_eventer:notify(riak_vnode, get_reply, ReqID),
     gen_fsm:send_event(FSM_pid, {r, RetVal, Idx, ReqID}).
 
-async_get_binary(From,Storekey,Mod,ModState) ->
+async_get_binary(From,BKey,Mod,ModState) ->
     spawn(fun() ->
-                  RetVal = do_get_binary(Storekey,Mod,ModState),
+                  RetVal = do_get_binary(BKey,Mod,ModState),
                   gen_server2:reply(From, RetVal)
           end).
 
     riak_eventer:notify(riak_vnode, keys_reply, {ReqID, FSM_pid}),
     gen_fsm:send_event(FSM_pid, {kl, RetVal,Idx,ReqID}).
 
-do_get_binary(Storekey, Mod, ModState) ->
-    Mod:get(ModState,Storekey).
+do_get_binary(BKey, Mod, ModState) ->
+    Mod:get(ModState,BKey).
 
-do_delete(Client, Storekey, ReqID,
+do_delete(Client, BKey, ReqID,
           _State=#state{idx=Idx,mod=Mod,modstate=ModState}) ->
-    case Mod:delete(ModState, Storekey) of
+    case Mod:delete(ModState, BKey) of
         ok ->
             riak_eventer:notify(riak_vnode,delete_reply,ReqID),
             gen_server2:reply(Client, {del, Idx, ReqID});
             gen_server2:reply(Client, {fail, Idx, ReqID})
     end.
 
-simple_binary_put({Bucket, Key}, Storekey, Val, Mod, ModState) ->
-    Mod:put(ModState, {Bucket, Key}, Storekey, Val).
+simple_binary_put(BKey, Val, Mod, ModState) ->
+    Mod:put(ModState, BKey, Val).
 
-do_put(FSM_pid, Storekey, RObj, ReqID,
+do_put(FSM_pid, BKey, RObj, ReqID,
        _State=#state{idx=Idx,mod=Mod,modstate=ModState}) ->
-    case syntactic_put_merge(Mod, ModState, Storekey, RObj) of
+    case syntactic_put_merge(Mod, ModState, BKey, RObj) of
         oldobj -> 
             riak_eventer:notify(riak_vnode,put_reply,ReqID),
             gen_fsm:send_event(FSM_pid, {dw, Idx, ReqID});
         {newobj, ObjToStore} ->
             Val = term_to_binary(ObjToStore, [compressed]),
-            case simple_binary_put({riak_object:bucket(RObj),
-                                    riak_object:key(RObj)},
-                                   Storekey, Val, Mod, ModState) of
+            case simple_binary_put(BKey, Val, Mod, ModState) of
                 ok ->
                     riak_eventer:notify(riak_vnode,put_reply,ReqID),
                     gen_fsm:send_event(FSM_pid, {dw, Idx, ReqID});
     end.
 
 do_map(ClientPid,{map,FunTerm,Arg,_Acc},
-       Storekey,KeyData,Cache,Mod,ModState,VNode) ->
-    riak_eventer:notify(riak_vnode, map_start, {FunTerm,Arg,Storekey}),
+       BKey,KeyData,Cache,Mod,ModState,VNode) ->
+    riak_eventer:notify(riak_vnode, map_start, {FunTerm,Arg,BKey}),
     CacheVal = case FunTerm of
         {qfun,_} -> not_cached; % live funs are not cached
         {modfun,CMod,CFun} ->
-            case dict:find(Storekey, Cache) of
+            case dict:find(BKey, Cache) of
                 error -> not_cached;
                 {ok,CDict} ->
                     case dict:find({CMod,CFun,Arg,KeyData},CDict) of
     end,
     RetVal = case CacheVal of
         not_cached ->
-             uncached_map(Storekey,Mod,ModState,FunTerm,Arg,KeyData,VNode);
+             uncached_map(BKey,Mod,ModState,FunTerm,Arg,KeyData,VNode);
         CV ->
-             riak_eventer:notify(riak_vnode,cached_map,{FunTerm,Arg,Storekey}),
+             riak_eventer:notify(riak_vnode,cached_map,{FunTerm,Arg,BKey}),
              {mapexec_reply, CV, self()}
     end,
-    riak_eventer:notify(riak_vnode, map_reply, {FunTerm,Arg,Storekey}),
+    riak_eventer:notify(riak_vnode, map_reply, {FunTerm,Arg,BKey}),
     gen_fsm:send_event(ClientPid, RetVal).
 
-uncached_map(Storekey,Mod,ModState,FunTerm,Arg,KeyData,VNode) ->
-    riak_eventer:notify(riak_vnode, uncached_map, {FunTerm,Arg,Storekey}),
-    case do_get_binary(Storekey, Mod, ModState) of
+uncached_map(BKey,Mod,ModState,FunTerm,Arg,KeyData,VNode) ->
+    riak_eventer:notify(riak_vnode, uncached_map, {FunTerm,Arg,BKey}),
+    case do_get_binary(BKey, Mod, ModState) of
         {ok, Binary} ->
             V = binary_to_term(Binary),
-            uncached_map1(V,FunTerm,Arg,Storekey,KeyData,VNode);
+            uncached_map1(V,FunTerm,Arg,BKey,KeyData,VNode);
         {error, notfound} ->
-            uncached_map1({error, notfound},FunTerm,Arg,Storekey,KeyData,VNode);
+            uncached_map1({error, notfound},FunTerm,Arg,BKey,KeyData,VNode);
         X -> {mapexec_error, self(), X}
     end.
 
-uncached_map1(V,FunTerm,Arg,Storekey,KeyData,VNode) ->
+uncached_map1(V,FunTerm,Arg,BKey,KeyData,VNode) ->
     try
         MapVal = case FunTerm of
             {qfun,F} -> F(V,KeyData,Arg);
             {modfun,M,F} ->
                 MF_Res = M:F(V,KeyData,Arg),
                 gen_server2:cast(VNode,
-                                 {mapcache, Storekey,{M,F,Arg,KeyData},MF_Res}),
+                                 {mapcache, BKey,{M,F,Arg,KeyData},MF_Res}),
                 MF_Res
         end,
         {mapexec_reply, MapVal, self()}
 code_change(_OldVsn, State, _Extra) -> {ok, State}.
 
 %% @private
-syntactic_put_merge(Mod, ModState, Storekey, Obj1) ->
-    case Mod:get(ModState, Storekey) of
+syntactic_put_merge(Mod, ModState, BKey, Obj1) ->
+    case Mod:get(ModState, BKey) of
         {error, notfound} -> {newobj, Obj1};
         {ok, Val0} ->
             Obj0 = binary_to_term(Val0),

src/riak_vnode_master.erl

     _Pid = get_vnode(Partition, State),
     {noreply, State};
 handle_cast({vnode_map, {Partition,_Node},
-             {ClientPid,QTerm,Storekey,KeyData}}, State) ->
+             {ClientPid,QTerm,BKey,KeyData}}, State) ->
     Pid = get_vnode(Partition, State),
-    gen_server2:cast(Pid, {map, ClientPid, QTerm, Storekey, KeyData}),
+    gen_server2:cast(Pid, {map, ClientPid, QTerm, BKey, KeyData}),
     % (obligation done, now the problem of the vnodes)
     {noreply, State};
 handle_cast({vnode_put, {Partition,_Node},
-             {FSM_pid,Storekey,RObj,ReqID}}, State) ->
+             {FSM_pid,BKey,RObj,ReqID}}, State) ->
     Pid = get_vnode(Partition, State),
-    gen_server2:cast(Pid, {put, FSM_pid, Storekey, RObj, ReqID}),
+    gen_server2:cast(Pid, {put, FSM_pid, BKey, RObj, ReqID}),
     % (obligation done, now the problem of the vnodes)
     {noreply, State};
 handle_cast({vnode_get, {Partition,_Node},
-             {FSM_pid,Storekey,ReqID}}, State) ->
+             {FSM_pid,BKey,ReqID}}, State) ->
     Pid = get_vnode(Partition, State),
-    gen_server2:cast(Pid, {get, FSM_pid, Storekey, ReqID}),
+    gen_server2:cast(Pid, {get, FSM_pid, BKey, ReqID}),
     % (obligation done, now the problem of the vnodes)
     {noreply, State};
 handle_cast({vnode_merkle, {RemoteVN,Partition,Merkle}}, State) ->
 handle_call(all_vnodes, _From, State) ->
     {reply, all_vnodes(State), State};
 handle_call({vnode_del, {Partition,_Node},
-             {Storekey,ReqID}}, From, State) ->
+             {BKey,ReqID}}, From, State) ->
     Pid = get_vnode(Partition, State),
-    gen_server2:cast(Pid, {delete, From, Storekey, ReqID}),
+    gen_server2:cast(Pid, {delete, From, BKey, ReqID}),
     % (obligation done, now the problem of the vnodes)
     {noreply, State}.