Repository: couchdb-mem3 Updated Branches: refs/heads/master 7f59504f0 -> ee36909f0
Rename "shard_db" option to "shards_db" and "node_db" one to "nodes_db" COUCHDB-2628 Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/c6855902 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/c6855902 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/c6855902 Branch: refs/heads/master Commit: c685590243164e6812559ad1bf9d4517f46ab2cd Parents: 7f59504 Author: Alexander Shorin <[email protected]> Authored: Thu Feb 26 21:18:30 2015 +0300 Committer: Alexander Shorin <[email protected]> Committed: Thu Feb 26 21:56:45 2015 +0300 ---------------------------------------------------------------------- src/mem3.erl | 2 +- src/mem3_nodes.erl | 4 ++-- src/mem3_shards.erl | 4 ++-- src/mem3_sync.erl | 4 ++-- src/mem3_util.erl | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/c6855902/src/mem3.erl ---------------------------------------------------------------------- diff --git a/src/mem3.erl b/src/mem3.erl index 5b7f640..bbf8ecd 100644 --- a/src/mem3.erl +++ b/src/mem3.erl @@ -89,7 +89,7 @@ shards_int(DbName, Options) when is_list(DbName) -> shards_int(DbName, Options) -> Ordered = lists:member(ordered, Options), ShardDbName = - list_to_binary(config:get("mem3", "shard_db", "dbs")), + list_to_binary(config:get("mem3", "shards_db", "dbs")), case DbName of ShardDbName when Ordered -> %% shard_db is treated as a single sharded db to support calls to db_info http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/c6855902/src/mem3_nodes.erl ---------------------------------------------------------------------- diff --git a/src/mem3_nodes.erl b/src/mem3_nodes.erl index 75d336f..00addc4 100644 --- a/src/mem3_nodes.erl +++ b/src/mem3_nodes.erl @@ -90,7 +90,7 @@ code_change(_OldVsn, #state{}=State, _Extra) -> %% internal functions initialize_nodelist() -> - DbName = config:get("mem3", "node_db", "nodes"), + DbName = config:get("mem3", "nodes_db", "nodes"), {ok, Db} = mem3_util:ensure_exists(DbName), {ok, _, Db} = couch_btree:fold(Db#db.id_tree, fun first_fold/3, Db, []), % add self if not already present @@ -115,7 +115,7 @@ first_fold(#full_doc_info{id=Id}=DocInfo, _, Db) -> {ok, Db}. listen_for_changes(Since) -> - DbName = config:get("mem3", "node_db", "nodes"), + DbName = config:get("mem3", "nodes_db", "nodes"), {ok, Db} = mem3_util:ensure_exists(DbName), Args = #changes_args{ feed = "continuous", http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/c6855902/src/mem3_shards.erl ---------------------------------------------------------------------- diff --git a/src/mem3_shards.erl b/src/mem3_shards.erl index 6d67770..e8ae3b2 100644 --- a/src/mem3_shards.erl +++ b/src/mem3_shards.erl @@ -131,7 +131,7 @@ set_max_size(Size) when is_integer(Size), Size > 0 -> handle_config_change("mem3", "shard_cache_size", SizeList, _, _) -> Size = list_to_integer(SizeList), {ok, gen_server:call(?MODULE, {set_max_size, Size}, infinity)}; -handle_config_change("mem3", "shard_db", _DbName, _, _) -> +handle_config_change("mem3", "shards_db", _DbName, _, _) -> {ok, gen_server:call(?MODULE, shard_db_changed, infinity)}; handle_config_change(_, _, _, _, _) -> {ok, nil}. @@ -264,7 +264,7 @@ changes_callback(timeout, _) -> ok. load_shards_from_disk(DbName) when is_binary(DbName) -> - X = ?l2b(config:get("mem3", "shard_db", "dbs")), + X = ?l2b(config:get("mem3", "shards_db", "dbs")), {ok, Db} = mem3_util:ensure_exists(X), try load_shards_from_db(Db, DbName) http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/c6855902/src/mem3_sync.erl ---------------------------------------------------------------------- diff --git a/src/mem3_sync.erl b/src/mem3_sync.erl index 1e5b505..fab4303 100644 --- a/src/mem3_sync.erl +++ b/src/mem3_sync.erl @@ -345,10 +345,10 @@ local_dbs() -> [nodes_db(), shards_db(), users_db()]. nodes_db() -> - ?l2b(config:get("mem3", "node_db", "nodes")). + ?l2b(config:get("mem3", "nodes_db", "nodes")). shards_db() -> - ?l2b(config:get("mem3", "shard_db", "dbs")). + ?l2b(config:get("mem3", "shards_db", "dbs")). users_db() -> ?l2b(config:get("couch_httpd_auth", "authentication_db", "_users")). http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/c6855902/src/mem3_util.erl ---------------------------------------------------------------------- diff --git a/src/mem3_util.erl b/src/mem3_util.erl index e19bf33..3937742 100644 --- a/src/mem3_util.erl +++ b/src/mem3_util.erl @@ -77,12 +77,12 @@ attach_nodes([S | Rest], Acc, [Node | Nodes], UsedNodes) -> attach_nodes(Rest, [S#shard{node=Node} | Acc], Nodes, [Node | UsedNodes]). open_db_doc(DocId) -> - DbName = ?l2b(config:get("mem3", "shard_db", "dbs")), + DbName = ?l2b(config:get("mem3", "shards_db", "dbs")), {ok, Db} = couch_db:open(DbName, []), try couch_db:open_doc(Db, DocId, [ejson_body]) after couch_db:close(Db) end. write_db_doc(Doc) -> - DbName = ?l2b(config:get("mem3", "shard_db", "dbs")), + DbName = ?l2b(config:get("mem3", "shards_db", "dbs")), write_db_doc(DbName, Doc, true). write_db_doc(DbName, #doc{id=Id, body=Body} = Doc, ShouldMutate) -> @@ -108,7 +108,7 @@ write_db_doc(DbName, #doc{id=Id, body=Body} = Doc, ShouldMutate) -> delete_db_doc(DocId) -> gen_server:cast(mem3_shards, {cache_remove, DocId}), - DbName = ?l2b(config:get("mem3", "shard_db", "dbs")), + DbName = ?l2b(config:get("mem3", "shards_db", "dbs")), delete_db_doc(DbName, DocId, true). delete_db_doc(DbName, DocId, ShouldMutate) ->
