summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Snavely <kjsnavely@gmail.com>2018-12-20 16:37:13 -0500
committerNick Vatamaniuc <nickva@users.noreply.github.com>2018-12-20 17:35:57 -0500
commite97f0297234b03b9b4a9904c7403b703a2a9a735 (patch)
treec58131018b4007b903f62e21f2fbe5063a926ea3
parent632f303a47bd89a97c831fd0532cb7541b80355d (diff)
downloadcouchdb-e97f0297234b03b9b4a9904c7403b703a2a9a735.tar.gz
Remove shim couch_replicator_manager module
-rw-r--r--src/couch/src/couch_server.erl28
-rw-r--r--src/couch_replicator/src/couch_replicator_manager.erl29
-rw-r--r--src/couch_replicator/test/couch_replicator_modules_load_tests.erl45
-rw-r--r--src/fabric/src/fabric_doc_update.erl2
4 files changed, 15 insertions, 89 deletions
diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index c4b7bf199..619ef08ea 100644
--- a/src/couch/src/couch_server.erl
+++ b/src/couch/src/couch_server.erl
@@ -160,20 +160,20 @@ maybe_add_sys_db_callbacks(DbName, Options) ->
IsUsersDb = path_ends_with(DbName, "_users")
orelse path_ends_with(DbName, UsersDbSuffix),
if
- DbName == DbsDbName ->
- [sys_db | Options];
- DbName == NodesDbName ->
- [sys_db | Options];
- IsReplicatorDb ->
- [{before_doc_update, fun couch_replicator_manager:before_doc_update/2},
- {after_doc_read, fun couch_replicator_manager:after_doc_read/2},
- sys_db | Options];
- IsUsersDb ->
- [{before_doc_update, fun couch_users_db:before_doc_update/2},
- {after_doc_read, fun couch_users_db:after_doc_read/2},
- sys_db | Options];
- true ->
- Options
+ DbName == DbsDbName ->
+ [sys_db | Options];
+ DbName == NodesDbName ->
+ [sys_db | Options];
+ IsReplicatorDb ->
+ [{before_doc_update, fun couch_replicator_docs:before_doc_update/2},
+ {after_doc_read, fun couch_replicator_docs:after_doc_read/2},
+ sys_db | Options];
+ IsUsersDb ->
+ [{before_doc_update, fun couch_users_db:before_doc_update/2},
+ {after_doc_read, fun couch_users_db:after_doc_read/2},
+ sys_db | Options];
+ true ->
+ Options
end.
path_ends_with(Path, Suffix) when is_binary(Suffix) ->
diff --git a/src/couch_replicator/src/couch_replicator_manager.erl b/src/couch_replicator/src/couch_replicator_manager.erl
deleted file mode 100644
index afccc0b9b..000000000
--- a/src/couch_replicator/src/couch_replicator_manager.erl
+++ /dev/null
@@ -1,29 +0,0 @@
-% Licensed under the Apache License, Version 2.0 (the "License"); you may not
-% use this file except in compliance with the License. You may obtain a copy of
-% the License at
-%
-% http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
--module(couch_replicator_manager).
-
-% TODO: This is a temporary proxy module to external calls (outside replicator)
-% to other replicator modules. This is done to avoid juggling multiple repos
-% during development.
-
-% NV: TODO: These functions were moved to couch_replicator_docs
-% but it is still called from fabric_doc_update. Keep it here for now
-% later, update fabric to call couch_replicator_docs instead
--export([before_doc_update/2, after_doc_read/2]).
-
-
-before_doc_update(Doc, Db) ->
- couch_replicator_docs:before_doc_update(Doc, Db).
-
-after_doc_read(Doc, Db) ->
- couch_replicator_docs:after_doc_read(Doc, Db).
diff --git a/src/couch_replicator/test/couch_replicator_modules_load_tests.erl b/src/couch_replicator/test/couch_replicator_modules_load_tests.erl
deleted file mode 100644
index a552d147b..000000000
--- a/src/couch_replicator/test/couch_replicator_modules_load_tests.erl
+++ /dev/null
@@ -1,45 +0,0 @@
-% Licensed under the Apache License, Version 2.0 (the "License"); you may not
-% use this file except in compliance with the License. You may obtain a copy of
-% the License at
-%
-% http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
--module(couch_replicator_modules_load_tests).
-
--include_lib("couch/include/couch_eunit.hrl").
-
-
-modules_load_test_() ->
- {
- "Verify that all modules loads",
- should_load_modules()
- }.
-
-
-should_load_modules() ->
- Modules = [
- couch_replicator_api_wrap,
- couch_replicator_httpc,
- couch_replicator_httpd,
- couch_replicator_manager,
- couch_replicator_scheduler,
- couch_replicator_scheduler_job,
- couch_replicator_docs,
- couch_replicator_clustering,
- couch_replicator_changes_reader,
- couch_replicator_ids,
- couch_replicator_notifier,
- couch_replicator,
- couch_replicator_worker,
- couch_replicator_utils
- ],
- [should_load_module(Mod) || Mod <- Modules].
-
-should_load_module(Mod) ->
- {atom_to_list(Mod), ?_assertMatch({module, _}, code:ensure_loaded(Mod))}.
diff --git a/src/fabric/src/fabric_doc_update.erl b/src/fabric/src/fabric_doc_update.erl
index a4867f31d..ce85aa6a9 100644
--- a/src/fabric/src/fabric_doc_update.erl
+++ b/src/fabric/src/fabric_doc_update.erl
@@ -106,7 +106,7 @@ before_doc_update(DbName, Docs, Opts) ->
{true, _} ->
%% fake db is expensive to create so we only do it if we have to
Db = fabric_util:fake_db(DbName, Opts),
- [couch_replicator_manager:before_doc_update(Doc, Db) || Doc <- Docs];
+ [couch_replicator_docs:before_doc_update(Doc, Db) || Doc <- Docs];
{_, true} ->
%% fake db is expensive to create so we only do it if we have to
Db = fabric_util:fake_db(DbName, Opts),