couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject [02/43] couch-mrview commit: updated refs/heads/2971-count-distinct to f7c3c24
Date Wed, 01 Mar 2017 16:37:36 GMT
Use ioq to separately prioritise view updates

COUCHDB-3002


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/abc94a40
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/abc94a40
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/abc94a40

Branch: refs/heads/2971-count-distinct
Commit: abc94a40da81211395501d91cd5d1fb73e6afbe9
Parents: 65b7a3a
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Thu Apr 21 12:45:34 2016 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Thu Apr 21 12:45:34 2016 -0700

----------------------------------------------------------------------
 src/couch_mrview_updater.erl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/abc94a40/src/couch_mrview_updater.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_updater.erl b/src/couch_mrview_updater.erl
index 0745c2a..da7381a 100644
--- a/src/couch_mrview_updater.erl
+++ b/src/couch_mrview_updater.erl
@@ -168,7 +168,8 @@ finish_update(#mrst{doc_acc=Acc}=State) ->
     end.
 
 
-map_docs(Parent, State0) ->
+map_docs(Parent, #mrst{db_name = DbName, idx_name = IdxName} = State0) ->
+    erlang:put(io_priority, {view_update, DbName, IdxName}),
     case couch_work_queue:dequeue(State0#mrst.doc_queue) of
         closed ->
             couch_query_servers:stop_doc_map(State0#mrst.qserver),
@@ -201,11 +202,12 @@ map_docs(Parent, State0) ->
     end.
 
 
-write_results(Parent, State) ->
+write_results(Parent, #mrst{db_name = DbName, idx_name = IdxName} = State) ->
     case accumulate_writes(State, State#mrst.write_queue, nil) of
         stop ->
             Parent ! {new_state, State};
         {Go, {Seq, ViewKVs, DocIdKeys, Seqs, Log}} ->
+            erlang:put(io_priority, {view_update, DbName, IdxName}),
             NewState = write_kvs(State, Seq, ViewKVs, DocIdKeys, Seqs, Log),
             if Go == stop ->
                 Parent ! {new_state, NewState};


Mime
View raw message