You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/09/16 01:20:21 UTC
mem3 commit: updated refs/heads/master to d92e4c4
Repository: couchdb-mem3
Updated Branches:
refs/heads/master be490465c -> d92e4c463
Add and export n/2
Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/d92e4c46
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/d92e4c46
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/d92e4c46
Branch: refs/heads/master
Commit: d92e4c46351a9b3eb8fc649615e21dfd8e121b14
Parents: be49046
Author: Robert Newson <rn...@apache.org>
Authored: Tue Sep 16 00:19:52 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Sep 16 00:19:52 2014 +0100
----------------------------------------------------------------------
src/mem3.erl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/d92e4c46/src/mem3.erl
----------------------------------------------------------------------
diff --git a/src/mem3.erl b/src/mem3.erl
index c713161..5b7f640 100644
--- a/src/mem3.erl
+++ b/src/mem3.erl
@@ -13,7 +13,7 @@
-module(mem3).
-export([start/0, stop/0, restart/0, nodes/0, node_info/2, shards/1, shards/2,
- choose_shards/2, n/1, dbname/1, ushards/1]).
+ choose_shards/2, n/1, n/2, dbname/1, ushards/1]).
-export([get_shard/3, local_shards/1, shard_suffix/1, fold_shards/2]).
-export([sync_security/0, sync_security/1]).
-export([compare_nodelists/0, compare_shards/1]).
@@ -68,7 +68,10 @@ compare_shards(DbName) ->
-spec n(DbName::iodata()) -> integer().
n(DbName) ->
- length(mem3:shards(DbName, <<"foo">>)).
+ n(DbName, <<"foo">>).
+
+n(DbName, DocId) ->
+ length(mem3:shards(DbName, DocId)).
-spec nodes() -> [node()].
nodes() ->