Remove shim couch_replicator_manager module
authorKyle Snavely <kjsnavely@gmail.com>
Thu, 20 Dec 2018 21:37:13 +0000 (16:37 -0500)
committerNick Vatamaniuc <nickva@users.noreply.github.com>
Thu, 20 Dec 2018 22:35:57 +0000 (17:35 -0500)
src/couch/src/couch_server.erl
src/couch_replicator/src/couch_replicator_manager.erl [deleted file]
src/couch_replicator/test/couch_replicator_modules_load_tests.erl [deleted file]
src/fabric/src/fabric_doc_update.erl

index c4b7bf1..619ef08 100644 (file)
@@ -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 (file)
index afccc0b..0000000
+++ /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 (file)
index a552d14..0000000
+++ /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))}.
index a4867f3..ce85aa6 100644 (file)
@@ -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),