From 46d7b8cd7d9088cc6a5257d23679b51e962c7e30 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 20 Oct 2010 14:55:24 -0400 Subject: repair should run with R=N --- apps/mem3/src/mem3.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps/mem3/src/mem3.erl') 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(). -- cgit v1.2.3