Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C29AC10A2A for ; Tue, 7 Jan 2014 00:36:43 +0000 (UTC) Received: (qmail 4318 invoked by uid 500); 7 Jan 2014 00:36:33 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 2783 invoked by uid 500); 7 Jan 2014 00:36:25 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 2225 invoked by uid 99); 7 Jan 2014 00:36:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jan 2014 00:36:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B2E143840D; Tue, 7 Jan 2014 00:36:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: benoitc@apache.org To: commits@couchdb.apache.org Date: Tue, 07 Jan 2014 00:37:14 -0000 Message-Id: <471773474eb64018baf5fca30dc6e829@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [54/57] [abbrv] git commit: updated refs/heads/1994-merge-rcouch to 868a284 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 Authored: Mon Jan 6 23:47:49 2014 +0100 Committer: Benoit Chesneau 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, []}