Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7FE3C200C23 for ; Tue, 7 Feb 2017 14:41:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7E6F9160B3E; Tue, 7 Feb 2017 13:41:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CF111160B4B for ; Tue, 7 Feb 2017 14:41:11 +0100 (CET) Received: (qmail 41024 invoked by uid 500); 7 Feb 2017 13:41:11 -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 41005 invoked by uid 99); 7 Feb 2017 13:41:11 -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; Tue, 07 Feb 2017 13:41:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DC594DFCA3; Tue, 7 Feb 2017 13:41:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org Date: Tue, 07 Feb 2017 13:41:11 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] fabric commit: updated refs/heads/COUCHDB-3287-pluggable-storage-engines to c4ae2f5 archived-at: Tue, 07 Feb 2017 13:41:12 -0000 Update to use new pluggable storage API COUCHDB-3287 Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/c8f8a40f Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/c8f8a40f Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/c8f8a40f Branch: refs/heads/COUCHDB-3287-pluggable-storage-engines Commit: c8f8a40f3657c52c29358ee0efce7f85a15c649e Parents: 03a54cd Author: Paul J. Davis Authored: Wed Feb 10 16:38:41 2016 -0600 Committer: Paul J. Davis Committed: Tue Feb 7 07:41:02 2017 -0600 ---------------------------------------------------------------------- src/fabric_rpc.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/c8f8a40f/src/fabric_rpc.erl ---------------------------------------------------------------------- diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl index 1872de8..c6658d0 100644 --- a/src/fabric_rpc.erl +++ b/src/fabric_rpc.erl @@ -70,7 +70,7 @@ changes(DbName, Options, StartVector, DbOptions) -> {ok, Db} -> StartSeq = calculate_start_seq(Db, node(), StartVector), Enum = fun changes_enumerator/2, - Opts = [{dir,Dir}], + Opts = [doc_info, {dir,Dir}], Acc0 = #cacc{ db = Db, seq = StartSeq, @@ -81,7 +81,7 @@ changes(DbName, Options, StartVector, DbOptions) -> }, try {ok, #cacc{seq=LastSeq, pending=Pending, epochs=Epochs}} = - couch_db:changes_since(Db, StartSeq, Enum, Opts, Acc0), + couch_db:fold_changes(Db, StartSeq, Enum, Acc0, Opts), rexi:stream_last({complete, [ {seq, {LastSeq, uuid(Db), couch_db:owner_of(Epochs, LastSeq)}}, {pending, Pending} @@ -220,7 +220,7 @@ get_missing_revs(DbName, IdRevsList, Options) -> Ids = [Id1 || {Id1, _Revs} <- IdRevsList], {ok, lists:zipwith(fun({Id, Revs}, FullDocInfoResult) -> case FullDocInfoResult of - {ok, #full_doc_info{rev_tree=RevisionTree} = FullInfo} -> + #full_doc_info{rev_tree=RevisionTree} = FullInfo -> MissingRevs = couch_key_tree:find_missing(RevisionTree, Revs), {Id, MissingRevs, possible_ancestors(FullInfo, MissingRevs)}; not_found -> @@ -251,8 +251,7 @@ group_info(DbName, DDocId, DbOptions) -> reset_validation_funs(DbName) -> case get_or_create_db(DbName, []) of {ok, Db} -> - DbPid = couch_db:get_pid(Db), - gen_server:cast(DbPid, {load_validation_funs, undefined}); + couch_db:reload_validation_funs(Db); _ -> ok end. @@ -336,6 +335,8 @@ reduce_cb(complete, Acc) -> {ok, Acc}. +changes_enumerator(#full_doc_info{} = FDI, Acc) -> + changes_enumerator(couch_doc:to_doc_info(FDI), Acc); changes_enumerator(#doc_info{id= <<"_local/", _/binary>>, high_seq=Seq}, Acc) -> {ok, Acc#cacc{seq = Seq, pending = Acc#cacc.pending-1}}; changes_enumerator(DocInfo, Acc) ->