couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [1/4] couch-mrview commit: updated refs/heads/master to 01cff34
Date Tue, 06 May 2014 16:33:21 GMT
Repository: couchdb-couch-mrview
Updated Branches:
  refs/heads/master [created] 01cff34df


Merge remote-tracking branch 'origin/import-master'


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

Branch: refs/heads/master
Commit: 86de6ccffb3b851b31c609f4f58e4f89c9517e8c
Parents: 3a093fa deec893
Author: Robert Newson <rnewson@apache.org>
Authored: Tue May 6 16:56:00 2014 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue May 6 16:56:00 2014 +0100

----------------------------------------------------------------------
 include/couch_mrview.hrl       |   1 +
 src/couch_mrview_compactor.erl |  12 ++-
 src/couch_mrview_http.erl      |  81 +++++++++++++++++--
 src/couch_mrview_index.erl     |  21 +++++
 src/couch_mrview_show.erl      |   7 +-
 src/couch_mrview_updater.erl   |  46 +++++------
 src/couch_mrview_util.erl      | 153 ++++++++++++++++++++++++++++--------
 7 files changed, 252 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/86de6ccf/include/couch_mrview.hrl
----------------------------------------------------------------------
diff --cc include/couch_mrview.hrl
index 6a0dfd0,e4ec66d..33dd061
--- a/include/couch_mrview.hrl
+++ b/include/couch_mrview.hrl
@@@ -70,9 -70,9 +70,10 @@@
      skip = 0,
      group_level = 0,
      stale = false,
 +    multi_get = false,
      inclusive_end = true,
      include_docs = false,
+     doc_options = [],
      update_seq=false,
      conflicts,
      callback,

http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/86de6ccf/src/couch_mrview_compactor.erl
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/86de6ccf/src/couch_mrview_http.erl
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/86de6ccf/src/couch_mrview_index.erl
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/86de6ccf/src/couch_mrview_show.erl
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/86de6ccf/src/couch_mrview_updater.erl
----------------------------------------------------------------------
diff --cc src/couch_mrview_updater.erl
index 99aedd0,9604ea9..7aee110
--- a/src/couch_mrview_updater.erl
+++ b/src/couch_mrview_updater.erl
@@@ -140,44 -156,16 +156,18 @@@ map_docs(Parent, State0) -
      end.
  
  
- compute_map_results(#mrst{qserver = Qs}, Dequeued) ->
-     % Run all the non deleted docs through the view engine and
-     % then pass the results on to the writer process.
-     DocFun = fun
-         ({nil, Seq, _}, {SeqAcc, AccDel, AccNotDel}) ->
-             {erlang:max(Seq, SeqAcc), AccDel, AccNotDel};
-         ({Id, Seq, deleted}, {SeqAcc, AccDel, AccNotDel}) ->
-             {erlang:max(Seq, SeqAcc), [{Id, []} | AccDel], AccNotDel};
-         ({_Id, Seq, Doc}, {SeqAcc, AccDel, AccNotDel}) ->
-             {erlang:max(Seq, SeqAcc), AccDel, [Doc | AccNotDel]}
-     end,
-     FoldFun = fun(Docs, Acc) ->
-         lists:foldl(DocFun, Acc, Docs)
-     end,
-     {MaxSeq, DeletedResults, Docs} =
-         lists:foldl(FoldFun, {0, [], []}, Dequeued),
-     {ok, MapResultList} = couch_query_servers:map_docs_raw(Qs, Docs),
-     NotDeletedResults = lists:zipwith(
-         fun(#doc{id = Id}, MapResults) -> {Id, MapResults} end,
-         Docs,
-         MapResultList),
-     AllMapResults = DeletedResults ++ NotDeletedResults,
-     update_task(length(AllMapResults)),
-     {ok, {MaxSeq, AllMapResults}}.
- 
- 
  write_results(Parent, State) ->
 -    case couch_work_queue:dequeue(State#mrst.write_queue) of
 -        closed ->
 +    case accumulate_writes(State, State#mrst.write_queue, nil) of
 +        stop ->
              Parent ! {new_state, State};
 -        {ok, Info} ->
 -            EmptyKVs = [{V#mrview.id_num, []} || V <- State#mrst.views],
 -            {Seq, ViewKVs, DocIdKeys} = merge_results(Info, 0, EmptyKVs, []),
 +        {Go, {Seq, ViewKVs, DocIdKeys}} ->
              NewState = write_kvs(State, Seq, ViewKVs, DocIdKeys),
 -            send_partial(NewState#mrst.partial_resp_pid, NewState),
 -            write_results(Parent, NewState)
 +            if Go == stop ->
 +                Parent ! {new_state, NewState};
 +            true ->
 +                send_partial(NewState#mrst.partial_resp_pid, NewState),
 +                write_results(Parent, NewState)
 +            end
      end.
  
  

http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/86de6ccf/src/couch_mrview_util.erl
----------------------------------------------------------------------


Mime
View raw message