Skip to content

Commit

Permalink
Fix some types around coverage requests.
Browse files Browse the repository at this point in the history
* Coverage requests to multiple vnodes reconstruct the original
  sender() to include the {partition(), node()} in the "reference".
  Widened the type to include that case.
* Added an actual type for keyspace specifications.
  • Loading branch information
seancribbs committed Feb 18, 2014
1 parent bc8a30f commit ad74add
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/riak_core_vnode.hrl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-type sender_type() :: fsm | server | raw.
-type sender() :: {sender_type(), reference(), pid()} |
-type sender() :: {sender_type(), reference() | tuple(), pid()} |
%% TODO: Double-check that these special cases are kosher
{server, undefined, undefined} | % special case in
% riak_core_vnode_master.erl
Expand All @@ -8,6 +8,7 @@
ignore.
-type partition() :: non_neg_integer().
-type vnode_req() :: term().
-type keyspaces() :: [{partition(), [partition()]}].

-record(riak_vnode_req_v1, {
index :: partition(),
Expand All @@ -16,7 +17,7 @@

-record(riak_coverage_req_v1, {
index :: partition(),
keyspaces :: [{partition(), [partition()]}],
keyspaces :: keyspaces(),
sender=ignore :: sender(),
request :: vnode_req()}).

Expand Down
2 changes: 1 addition & 1 deletion src/riak_core_vnode_master.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ make_request(Request, Sender, Index) ->
request=Request}.

%% Make a request record - exported for use by legacy modules
-spec make_coverage_request(vnode_req(), [{partition(), [partition()]}], sender(), partition()) -> #riak_coverage_req_v1{}.
-spec make_coverage_request(vnode_req(), keyspaces(), sender(), partition()) -> #riak_coverage_req_v1{}.
make_coverage_request(Request, KeySpaces, Sender, Index) ->
#riak_coverage_req_v1{index=Index,
keyspaces=KeySpaces,
Expand Down

0 comments on commit ad74add

Please sign in to comment.