diff options
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/Makefile.am | 4 | ||||
-rw-r--r-- | src/couchdb/couch_replication_manager.erl (renamed from src/couchdb/couch_rep_db_listener.erl) | 26 |
2 files changed, 14 insertions, 16 deletions
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). |