couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [10/12] couch-index commit: updated refs/heads/1994-merge-rcouch to 7c1666b
Date Thu, 13 Feb 2014 00:01:23 GMT
add `make test` target . all erlang test pass

note: from time to time there is a timing issue on 200- test that need
to be fixed. It is most probably due to the way the indexer is
supervised.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/commit/5ae0421f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/tree/5ae0421f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/diff/5ae0421f

Branch: refs/heads/1994-merge-rcouch
Commit: 5ae0421fa3ea720e42b113f0ee4dddd9285e7447
Parents: ab90835
Author: benoitc <benoitc@apache.org>
Authored: Thu Jan 9 16:24:32 2014 +0100
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Wed Feb 12 17:58:22 2014 -0600

----------------------------------------------------------------------
 src/couch_index_server.erl | 12 +++++++-----
 src/couch_index_sup.erl    |  1 -
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/5ae0421f/src/couch_index_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_index_server.erl b/src/couch_index_server.erl
index 7a7bd55..86791db 100644
--- a/src/couch_index_server.erl
+++ b/src/couch_index_server.erl
@@ -26,7 +26,8 @@
 -define(BY_DB, couchdb_indexes_by_db).
 
 
--record(st, {root_dir}).
+-record(st, {root_dir,
+             notifier_pid}).
 
 start_link() ->
     gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
@@ -73,10 +74,13 @@ init([]) ->
     ets:new(?BY_SIG, [protected, set, named_table]),
     ets:new(?BY_PID, [private, set, named_table]),
     ets:new(?BY_DB, [protected, bag, named_table]),
-    couch_db_update_notifier:start_link(fun ?MODULE:update_notify/1),
+
+    {ok, NotifierPid} = couch_db_update_notifier:start_link(
+            fun ?MODULE:update_notify/1),
     RootDir = couch_index_util:root_dir(),
     couch_file:init_delete_dir(RootDir),
-    {ok, #st{root_dir=RootDir}}.
+    {ok, #st{root_dir=RootDir,
+             notifier_pid=NotifierPid}}.
 
 
 terminate(_Reason, _State) ->
@@ -117,7 +121,6 @@ handle_cast({reset_indexes, DbName}, State) ->
     reset_indexes(DbName, State#st.root_dir),
     {noreply, State}.
 
-
 handle_info({'EXIT', Pid, Reason}, Server) ->
     case ets:lookup(?BY_PID, Pid) of
         [{Pid, {DbName, Sig}}] ->
@@ -198,4 +201,3 @@ update_notify({ddoc_updated, {DbName, DDocId}}) ->
         ets:match_object(?BY_DB, {DbName, {DDocId, '$1'}}));
 update_notify(_) ->
     ok.
-

http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/5ae0421f/src/couch_index_sup.erl
----------------------------------------------------------------------
diff --git a/src/couch_index_sup.erl b/src/couch_index_sup.erl
index d7b1033..fd97814 100644
--- a/src/couch_index_sup.erl
+++ b/src/couch_index_sup.erl
@@ -27,4 +27,3 @@ start_link() ->
 init([]) ->
     Server = ?CHILD(couch_index_server),
     {ok, {{one_for_one, 10, 3600}, [Server]}}.
-


Mime
View raw message