summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-07-10 15:50:17 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 01:24:19 -0400
commit6db30f462e5c77df2a4fb56cd793ecb5243ecdff (patch)
tree5682b194ef8806d6528470b08620c9b8d97757a2
parent15820b8ec6aa24fe0283879de85cebec17686868 (diff)
thank you dialyzer
-rw-r--r--include/mem3.hrl9
-rw-r--r--src/mem3.erl8
2 files changed, 12 insertions, 5 deletions
diff --git a/include/mem3.hrl b/include/mem3.hrl
index f6584f19..b9359b44 100644
--- a/include/mem3.hrl
+++ b/include/mem3.hrl
@@ -1,4 +1,11 @@
--record(shard, {name, node, dbname, range, ref}).
+% type specification hacked to suppress dialyzer warning re: match spec
+-record(shard, {
+ name :: binary() | '_',
+ node :: node() | '_',
+ dbname :: binary(),
+ range :: [non_neg_integer() | '$1' | '$2'],
+ ref :: reference() | 'undefined' | '_'
+}).
%% types
-type join_type() :: init | join | replace | leave.
diff --git a/src/mem3.erl b/src/mem3.erl
index 5610f085..1485c7fe 100644
--- a/src/mem3.erl
+++ b/src/mem3.erl
@@ -32,7 +32,7 @@ compare_nodelists() ->
end, orddict:new(), Replies),
[{non_member_nodes, AllNodes -- Nodes}, {bad_nodes, BadNodes} | Dict].
--spec compare_shards(DbName::iolist()) -> [{bad_nodes | [#shard{}], [node()]}].
+-spec compare_shards(DbName::iodata()) -> [{bad_nodes | [#shard{}], [node()]}].
compare_shards(DbName) when is_list(DbName) ->
compare_shards(list_to_binary(DbName));
compare_shards(DbName) ->
@@ -48,7 +48,7 @@ compare_shards(DbName) ->
nodes() ->
mem3_nodes:get_nodelist().
--spec shards(DbName::iolist()) -> [#shard{}].
+-spec shards(DbName::iodata()) -> [#shard{}].
shards(DbName) when is_list(DbName) ->
shards(list_to_binary(DbName));
shards(DbName) ->
@@ -61,7 +61,7 @@ shards(DbName) ->
mem3_util:load_shards_from_disk(DbName)
end.
--spec shards(DbName::iolist(), DocId::binary()) -> [#shard{}].
+-spec shards(DbName::iodata(), DocId::binary()) -> [#shard{}].
shards(DbName, DocId) when is_list(DbName) ->
shards(list_to_binary(DbName), DocId);
shards(DbName, DocId) when is_list(DocId) ->
@@ -85,7 +85,7 @@ shards(DbName, DocId) ->
mem3_util:load_shards_from_disk(DbName, DocId)
end.
--spec choose_shards(DbName::iolist(), Options::list()) -> [#shard{}].
+-spec choose_shards(DbName::iodata(), Options::list()) -> [#shard{}].
choose_shards(DbName, Options) when is_list(DbName) ->
choose_shards(list_to_binary(DbName), Options);
choose_shards(DbName, Options) ->