summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/couchdb/default.ini.tpl.in2
-rw-r--r--src/couchdb/Makefile.am4
-rw-r--r--src/couchdb/couch_replication_manager.erl (renamed from src/couchdb/couch_rep_db_listener.erl)26
3 files changed, 15 insertions, 17 deletions
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index cd3ae0aa..f5dc24af 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -60,7 +60,7 @@ stats_aggregator={couch_stats_aggregator, start, []}
stats_collector={couch_stats_collector, start, []}
uuids={couch_uuids, start, []}
auth_cache={couch_auth_cache, start_link, []}
-rep_db_changes_listener={couch_rep_db_listener, start_link, []}
+replication_manager={couch_replication_manager, start_link, []}
vhosts={couch_httpd_vhost, start_link, []}
os_daemons={couch_os_daemons, start_link, []}
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index c325440d..92f6dcf6 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -69,7 +69,7 @@ source_files = \
couch_rep_reader.erl \
couch_rep_sup.erl \
couch_rep_writer.erl \
- couch_rep_db_listener.erl \
+ couch_replication_manager.erl \
couch_server.erl \
couch_server_sup.erl \
couch_stats_aggregator.erl \
@@ -131,7 +131,7 @@ compiled_files = \
couch_rep_reader.beam \
couch_rep_sup.beam \
couch_rep_writer.beam \
- couch_rep_db_listener.beam \
+ couch_replication_manager.beam \
couch_server.beam \
couch_server_sup.beam \
couch_stats_aggregator.beam \
diff --git a/src/couchdb/couch_rep_db_listener.erl b/src/couchdb/couch_replication_manager.erl
index ef0ced0a..6101c9c5 100644
--- a/src/couchdb/couch_rep_db_listener.erl
+++ b/src/couchdb/couch_replication_manager.erl
@@ -10,7 +10,7 @@
% License for the specific language governing permissions and limitations under
% the License.
--module(couch_rep_db_listener).
+-module(couch_replication_manager).
-behaviour(gen_server).
-export([start_link/0, init/1, handle_call/3, handle_info/2, handle_cast/2]).
@@ -86,20 +86,18 @@ handle_call({restart_failure, {Props} = RepDoc, Error}, _From, State) ->
{reply, ok, State};
handle_call(Msg, From, State) ->
- ?LOG_ERROR("Replicator DB listener received unexpected call ~p from ~p",
+ ?LOG_ERROR("Replication manager received unexpected call ~p from ~p",
[Msg, From]),
{stop, {error, {unexpected_call, Msg}}, State}.
-handle_cast({rep_db_changed, NewName},
- #state{rep_db_name = NewName} = State) ->
+handle_cast({rep_db_changed, NewName}, #state{rep_db_name = NewName} = State) ->
{noreply, State};
handle_cast({rep_db_changed, _NewName}, State) ->
{noreply, restart(State)};
-handle_cast({rep_db_created, NewName},
- #state{rep_db_name = NewName} = State) ->
+handle_cast({rep_db_created, NewName}, #state{rep_db_name = NewName} = State) ->
{noreply, State};
handle_cast({rep_db_created, _NewName}, State) ->
@@ -109,7 +107,7 @@ handle_cast({set_max_retries, MaxRetries}, State) ->
{noreply, State#state{max_retries = MaxRetries}};
handle_cast(Msg, State) ->
- ?LOG_ERROR("Replicator DB listener received unexpected cast ~p", [Msg]),
+ ?LOG_ERROR("Replication manager received unexpected cast ~p", [Msg]),
{stop, {error, {unexpected_cast, Msg}}, State}.
@@ -126,7 +124,7 @@ handle_info({'EXIT', From, normal}, #state{rep_start_pids = Pids} = State) ->
{noreply, State#state{rep_start_pids = Pids -- [From]}};
handle_info(Msg, State) ->
- ?LOG_ERROR("Replicator DB listener received unexpected message ~p", [Msg]),
+ ?LOG_ERROR("Replication manager received unexpected message ~p", [Msg]),
{stop, {unexpected_msg, Msg}, State}.
@@ -369,13 +367,13 @@ stop_replication(DocId) ->
stop_all_replications() ->
- ?LOG_INFO("Stopping all ongoing replications because the replicator DB "
- "was deleted or changed", []),
+ ?LOG_INFO("Stopping all ongoing replications because the replicator"
+ " database was deleted or changed", []),
ets:foldl(
- fun({_, {RepId, _}}, _) -> couch_rep:end_replication(RepId) end,
- ok,
- ?DOC_ID_TO_REP_ID
- ),
+ fun({_, {RepId, _}}, _) ->
+ couch_rep:end_replication(RepId)
+ end,
+ ok, ?DOC_ID_TO_REP_ID),
true = ets:delete_all_objects(?REP_ID_TO_DOC_ID),
true = ets:delete_all_objects(?DOC_ID_TO_REP_ID).