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 4356418D86 for ; Wed, 10 Feb 2016 22:30:21 +0000 (UTC) Received: (qmail 96289 invoked by uid 500); 10 Feb 2016 22:30:21 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 96181 invoked by uid 500); 10 Feb 2016 22:30:21 -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 96121 invoked by uid 99); 10 Feb 2016 22:30:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2016 22:30:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E4F85DFE01; Wed, 10 Feb 2016 22:30:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chewbranca@apache.org To: commits@couchdb.apache.org Date: Wed, 10 Feb 2016 22:30:21 -0000 Message-Id: In-Reply-To: <8806c501720e4c31acd90efe3737249c@git.apache.org> References: <8806c501720e4c31acd90efe3737249c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] couch commit: updated refs/heads/2938-use-ddoc-cache-in-filtered-changes to fabc25f Use ddoc_cache and new fetch rpc format Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/fabc25f3 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/fabc25f3 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/fabc25f3 Branch: refs/heads/2938-use-ddoc-cache-in-filtered-changes Commit: fabc25f351e2a30d2f7d8ba2131595707b156e22 Parents: 010704a Author: Russell Branca Authored: Thu Jan 21 22:57:18 2016 +0000 Committer: Russell Branca Committed: Wed Feb 10 22:20:44 2016 +0000 ---------------------------------------------------------------------- src/couch_changes.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/fabc25f3/src/couch_changes.erl ---------------------------------------------------------------------- diff --git a/src/couch_changes.erl b/src/couch_changes.erl index 7547aef..0d418e8 100644 --- a/src/couch_changes.erl +++ b/src/couch_changes.erl @@ -229,9 +229,12 @@ configure_filter(FilterName, Style, Req, Db) -> FilterNameParts = string:tokens(FilterName, "/"), case [?l2b(couch_httpd:unquote(Part)) || Part <- FilterNameParts] of [DName, FName] -> - {ok, DDoc} = open_ddoc(Db, <<"_design/", DName/binary>>), + DesignId = <<"_design/", DName/binary>>, + {ok, DDoc} = ddoc_cache:open_doc(fabric:dbname(Db), DesignId), check_member_exists(DDoc, [<<"filters">>, FName]), - {custom, Style, Req, DDoc, FName}; + DIR = fabric_util:doc_id_and_rev(DDoc), + {fetch, Style, Req, DIR, FName}; + [] -> {default, Style}; _Else ->