8888 }).
8989
9090-type name () :: term ().
91+ -type seq () :: non_neg_integer ().
9192
9293% % API
9394% % @doc Start linked, registered to module name.
@@ -238,13 +239,15 @@ dumpq() ->
238239
239240% % @doc Return summary data for the objects currently in the queue.
240241% % The return value is a list of tuples of the form {SequenceNum, Key, Size}.
241- -spec summarize () -> [{integer (), string (), integer ()}].
242+ -spec summarize () -> [{seq (), riak_object : key (), non_neg_integer ()}].
242243summarize () ->
243- gen_server :call (? SERVER , summarize , infinity ).
244+ gen_server :call (? SERVER , summarize , infinity ).
244245
245246% % @doc If an object with the given Seq number is currently in the queue,
246247% % evict it and return ok.
247- evict (Seq ) -> gen_server :call (? SERVER , {evict , Seq }, infinity ).
248+ -spec evict (Seq :: seq ()) -> 'ok' .
249+ evict (Seq ) ->
250+ gen_server :call (? SERVER , {evict , Seq }, infinity ).
248251
249252% % @doc If an object with the given Seq number is currently in the queue and it
250253% % also matches the given Key, then evict it and return ok. This is a safer
@@ -254,7 +257,10 @@ evict(Seq) -> gen_server:call(?SERVER, {evict, Seq}, infinity).
254257% % given `Seq' number, then {not_found, Seq} is returned, whereas if the
255258% % object with the given `Seq' number is present but does not match the
256259% % provided `Key', then {wrong_key, Seq, Key} is returned.
257- evict (Seq , Key ) -> gen_server :call (? SERVER , {evict , Seq , Key }, infinity ).
260+ -spec evict (Seq :: seq (), Key :: riak_object :key ()) ->
261+ 'ok' | {'not_found' , integer ()} | {'wrong_key' , integer (), riak_object :key ()}.
262+ evict (Seq , Key ) ->
263+ gen_server :call (? SERVER , {evict , Seq , Key }, infinity ).
258264
259265% % @doc Signal that this node is doing down, and so a proxy process needs to
260266% % start to avoid dropping, or aborting unacked results.
@@ -359,9 +365,9 @@ handle_call(dumpq, _From, State = #state{qtab = QTab}) ->
359365
360366handle_call (summarize , _From , State = # state {qtab = QTab }) ->
361367 Fun = fun ({Seq , _NumItems , Bin , _Meta }, Acc ) ->
362- Obj = riak_repl_util :from_wire (Bin ),
363- {Key , Size } = summarize_object (Obj ),
364- Acc ++ [{Seq , Key , Size }]
368+ Obj = riak_repl_util :from_wire (Bin ),
369+ {Key , Size } = summarize_object (Obj ),
370+ Acc ++ [{Seq , Key , Size }]
365371 end ,
366372 {reply , ets :foldl (Fun , [], QTab ), State };
367373
0 commit comments