couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject git commit: Revert "use couch_db calls instead of couch_btree"
Date Wed, 09 Nov 2011 18:59:43 GMT
Updated Branches:
  refs/heads/master 68c0f5a70 -> 849408452


Revert "use couch_db calls instead of couch_btree"

We can't do this without other changes since couch_db:get_design_docs
is hard coded to skip deleted documents, and that's incompatible with
how _changes is supposed to behave.

This reverts commit e41d226dca11dc8b24d6c011cc3014e6c553db42.


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

Branch: refs/heads/master
Commit: 84940845230b7ce04cc0ffee2575e0541ab607c7
Parents: 68c0f5a
Author: Randall Leeds <randall@apache.org>
Authored: Wed Nov 9 10:58:57 2011 -0800
Committer: Randall Leeds <randall@apache.org>
Committed: Wed Nov 9 10:58:57 2011 -0800

----------------------------------------------------------------------
 src/couchdb/couch_changes.erl |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/84940845/src/couchdb/couch_changes.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_changes.erl b/src/couchdb/couch_changes.erl
index 30f1d88..267f3d7 100644
--- a/src/couchdb/couch_changes.erl
+++ b/src/couchdb/couch_changes.erl
@@ -298,7 +298,7 @@ send_changes(Args, Callback, UserAcc, Db, StartSeq, Prepend, FirstRound)
->
 
 
 send_changes_doc_ids(DocIds, Db, StartSeq, Dir, Fun, Acc0) ->
-    Lookups = couch_db:get_full_doc_infos(Db, DocIds),
+    Lookups = couch_btree:lookup(Db#db.fulldocinfo_by_id_btree, DocIds),
     FullDocInfos = lists:foldl(
         fun({ok, FDI}, Acc) ->
             [FDI | Acc];
@@ -310,7 +310,12 @@ send_changes_doc_ids(DocIds, Db, StartSeq, Dir, Fun, Acc0) ->
 
 
 send_changes_design_docs(Db, StartSeq, Dir, Fun, Acc0) ->
-    FullDocInfos = couch_db:get_design_docs(Db),
+    FoldFun = fun(FullDocInfo, _, Acc) ->
+        {ok, [FullDocInfo | Acc]}
+    end,
+    KeyOpts = [{start_key, <<"_design/">>}, {end_key_gt, <<"_design0">>}],
+    {ok, _, FullDocInfos} = couch_btree:fold(
+        Db#db.fulldocinfo_by_id_btree, FoldFun, [], KeyOpts),
     send_lookup_changes(FullDocInfos, StartSeq, Dir, Db, Fun, Acc0).
 
 


Mime
View raw message