summaryrefslogtreecommitdiff
path: root/apps/mem3
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-10-20 14:55:24 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-10-20 14:55:24 -0400
commit46d7b8cd7d9088cc6a5257d23679b51e962c7e30 (patch)
treec64433cb41b7b3c3e4e933006676a6479eecae70 /apps/mem3
parented231d0fd1cf7647cc7a154de81e85cd584bc8b5 (diff)
repair should run with R=N
Diffstat (limited to 'apps/mem3')
-rw-r--r--apps/mem3/src/mem3.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/mem3/src/mem3.erl b/apps/mem3/src/mem3.erl
index 41118d54..1021ee5b 100644
--- a/apps/mem3/src/mem3.erl
+++ b/apps/mem3/src/mem3.erl
@@ -15,7 +15,7 @@
-module(mem3).
-export([start/0, stop/0, restart/0, nodes/0, shards/1, shards/2,
- choose_shards/2]).
+ choose_shards/2, n/1]).
-export([compare_nodelists/0, compare_shards/1]).
-include("mem3.hrl").
@@ -58,6 +58,10 @@ compare_shards(DbName) ->
end, orddict:new(), lists:zip(Replies, GoodNodes)),
[{bad_nodes, BadNodes} | Dict].
+-spec n(DbName::iodata()) -> integer().
+n(DbName) ->
+ length(mem3:shards(DbName, <<"foo">>)).
+
-spec nodes() -> [node()].
nodes() ->
mem3_nodes:get_nodelist().