summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-03-08 18:37:20 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2011-03-08 18:37:20 +0000
commit9198a5df96a2768c27ebb7be89bcef6f43c87407 (patch)
tree1cfdd010e8f1b4dae9231e55d9a21d744d16da04
parent56341aa7286262584c81b590a231b7d6e8d3a007 (diff)
downloadcouchdb-9198a5df96a2768c27ebb7be89bcef6f43c87407.tar.gz
Renamed module couch_rep_db_listener to couch_replication_manager
This new name is more appropriate since it describes more precisely what the modules does. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1079475 13f79535-47bb-0310-9956-ffa450edef68
-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 88020e103..8207d6ebb 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, []}
os_daemons={couch_os_daemons, start_link, []}
[httpd_global_handlers]
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index 27ded8a49..559cdfafe 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -67,8 +67,8 @@ source_files = \
couch_primary_sup.erl \
couch_query_servers.erl \
couch_ref_counter.erl \
- couch_rep_db_listener.erl \
couch_rep_sup.erl \
+ couch_replication_manager.erl \
couch_replication_notifier.erl \
couch_replicator.erl \
couch_replicator_doc_copier.erl \
@@ -135,8 +135,8 @@ compiled_files = \
couch_primary_sup.beam \
couch_query_servers.beam \
couch_ref_counter.beam \
- couch_rep_db_listener.beam \
couch_rep_sup.beam \
+ couch_replication_manager.beam \
couch_replication_notifier.beam \
couch_replicator.beam \
couch_replicator_doc_copier.beam \
diff --git a/src/couchdb/couch_rep_db_listener.erl b/src/couchdb/couch_replication_manager.erl
index 40cb3ac75..f968f5637 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]).
@@ -91,20 +91,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) ->
@@ -114,7 +112,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}.
@@ -131,7 +129,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}.
@@ -368,13 +366,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_replicator:cancel_replication(RepId) end,
- ok,
- ?DOC_ID_TO_REP_ID
- ),
+ fun({_, {RepId, _}}, _) ->
+ couch_replicator:cancel_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).