From dc4f15e586112742cf54628e937e0f776022c953 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Sat, 10 Jul 2010 15:50:17 -0400 Subject: thank you dialyzer --- src/fabric_all_databases.erl | 2 +- src/fabric_util.erl | 2 +- src/fabric_view.erl | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fabric_all_databases.erl b/src/fabric_all_databases.erl index 97685f4e..e16429b1 100644 --- a/src/fabric_all_databases.erl +++ b/src/fabric_all_databases.erl @@ -6,7 +6,7 @@ -include_lib("mem3/include/mem3.hrl"). %% @doc gets all databases in the cluster. --spec all_databases(binary() | []) -> [binary()]. +-spec all_databases(string()) -> {ok, [binary()]}. all_databases([]) -> Dbs = ets:foldl(fun(#shard{dbname=DbName}, AccIn) -> new_acc(DbName, AccIn) diff --git a/src/fabric_util.erl b/src/fabric_util.erl index 3c27f19e..e928c5ff 100644 --- a/src/fabric_util.erl +++ b/src/fabric_util.erl @@ -28,7 +28,7 @@ receive_loop(Workers, Keypos, Fun, Acc0) -> %% @doc set up the receive loop with an overall timeout -spec receive_loop([any()], integer(), function(), any(), timeout(), timeout()) -> - {ok, any()}. + {ok, any()} | timeout | {error, any()}. receive_loop(RefPartMap, Keypos, Fun, Acc0, infinity, PerMsgTO) -> process_mailbox(RefPartMap, Keypos, Fun, Acc0, nil, PerMsgTO); receive_loop(RefPartMap, Keypos, Fun, Acc0, GlobalTimeout, PerMsgTO) -> diff --git a/src/fabric_view.erl b/src/fabric_view.erl index 6817a5b0..4f29abf7 100644 --- a/src/fabric_view.erl +++ b/src/fabric_view.erl @@ -9,7 +9,7 @@ -include_lib("couch/include/couch_db.hrl"). %% @doc looks for a fully covered keyrange in the list of counters --spec is_progress_possible([{#shard{}, non_neg_integer()}]) -> boolean(). +-spec is_progress_possible([{#shard{}, term()}]) -> boolean(). is_progress_possible([]) -> false; is_progress_possible(Counters) -> @@ -37,7 +37,8 @@ is_progress_possible(Counters) -> end, Tail0, Rest), Result =:= complete. --spec remove_overlapping_shards(#shard{}, [#shard{}]) -> [#shard{}]. +-spec remove_overlapping_shards(#shard{}, [{#shard{}, any()}]) -> + [{#shard{}, any()}]. remove_overlapping_shards(#shard{range=[A,B]} = Shard0, Shards) -> fabric_dict:filter(fun(#shard{range=[X,Y]} = Shard, _Value) -> if Shard =:= Shard0 -> -- cgit v1.2.3