couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject [54/57] [abbrv] git commit: updated refs/heads/1994-merge-rcouch to 868a284
Date Tue, 07 Jan 2014 00:37:14 GMT
make couch_index a standalone erlang app

With this change couch_index will be started by the release instead of
letting couchdb to start it. It also has its own supervision now.


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

Branch: refs/heads/1994-merge-rcouch
Commit: d28d6bef0e77c88d0b14e62d1b62a000a982f4db
Parents: 7778645
Author: Benoit Chesneau <benoitc@apache.org>
Authored: Mon Jan 6 23:47:49 2014 +0100
Committer: Benoit Chesneau <benoitc@apache.org>
Committed: Mon Jan 6 23:47:49 2014 +0100

----------------------------------------------------------------------
 apps/couch_index/src/couch_index.app.src |  8 +++----
 apps/couch_index/src/couch_index_app.erl | 27 ++++++++++++++++++++++++
 apps/couch_index/src/couch_index_sup.erl | 30 +++++++++++++++++++++++++++
 etc/couchdb/default.ini.tpl.in           |  1 -
 4 files changed, 60 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d28d6bef/apps/couch_index/src/couch_index.app.src
----------------------------------------------------------------------
diff --git a/apps/couch_index/src/couch_index.app.src b/apps/couch_index/src/couch_index.app.src
index 141ed9d..687a2e2 100644
--- a/apps/couch_index/src/couch_index.app.src
+++ b/apps/couch_index/src/couch_index.app.src
@@ -13,10 +13,8 @@
 {application, couch_index, [
     {description, "CouchDB Secondary Index Manager"},
     {vsn, "@version@"},
-    {modules, [
-        couch_index,
-        couch_index_server
-    ]},
+    {modules, []},
     {registered, [couch_index_server]},
-    {applications, [kernel, stdlib]}
+    {applications, [kernel, stdlib, couch]},
+    {mod, {couch_index_app, []}}
 ]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d28d6bef/apps/couch_index/src/couch_index_app.erl
----------------------------------------------------------------------
diff --git a/apps/couch_index/src/couch_index_app.erl b/apps/couch_index/src/couch_index_app.erl
new file mode 100644
index 0000000..6bafdcb
--- /dev/null
+++ b/apps/couch_index/src/couch_index_app.erl
@@ -0,0 +1,27 @@
+% 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_index_app).
+
+-behaviour(application).
+
+-include_lib("couch/include/couch_db.hrl").
+
+-export([start/2, stop/1]).
+
+start(_Type, _Args) ->
+    couch_util:start_app_deps(couch_index),
+    couch_index_sup:start_link().
+
+
+stop(_) ->
+    ok.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d28d6bef/apps/couch_index/src/couch_index_sup.erl
----------------------------------------------------------------------
diff --git a/apps/couch_index/src/couch_index_sup.erl b/apps/couch_index/src/couch_index_sup.erl
new file mode 100644
index 0000000..d7b1033
--- /dev/null
+++ b/apps/couch_index/src/couch_index_sup.erl
@@ -0,0 +1,30 @@
+% 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_index_sup).
+-behaviour(supervisor).
+
+-export([start_link/0]).
+-export([init/1]).
+
+
+%% Helper macro for declaring children of supervisor
+-define(CHILD(I), {I, {I, start_link, []}, permanent, 5000, worker, [I]}).
+
+start_link() ->
+    supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+
+init([]) ->
+    Server = ?CHILD(couch_index_server),
+    {ok, {{one_for_one, 10, 3600}, [Server]}}.
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d28d6bef/etc/couchdb/default.ini.tpl.in
----------------------------------------------------------------------
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index 3267001..500a5a1 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -133,7 +133,6 @@ reduce_limit = true
 os_process_limit = 25
 
 [daemons]
-index_server={couch_index_server, start_link, []}
 external_manager={couch_external_manager, start_link, []}
 query_servers={couch_query_servers, start_link, []}
 vhosts={couch_httpd_vhost, start_link, []}


Mime
View raw message