couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [1/2] couch-mrview commit: updated refs/heads/master to 5899436
Date Tue, 22 Nov 2016 15:34:58 GMT
Repository: couchdb-couch-mrview
Updated Branches:
  refs/heads/master f4aaf8de5 -> 5899436ae


Remove side effect from accumulate_more


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

Branch: refs/heads/master
Commit: b7362d0473769fd52716309562dd5eddf9544d07
Parents: f4aaf8d
Author: Eric Avdey <eiri@eiri.ca>
Authored: Fri Nov 18 15:04:32 2016 -0400
Committer: Eric Avdey <eiri@eiri.ca>
Committed: Tue Nov 22 10:40:01 2016 -0400

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/b7362d04/src/couch_mrview_updater.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_updater.erl b/src/couch_mrview_updater.erl
index 645f02b..0ceaa40 100644
--- a/src/couch_mrview_updater.erl
+++ b/src/couch_mrview_updater.erl
@@ -244,18 +244,18 @@ accumulate_writes(State, W, Acc0) ->
             {stop, {Seq, ViewKVs, DocIdKVs, Seqs, Log}};
         {ok, Info} ->
             {_, _, NewIds, _, _} = Acc = merge_results(Info, Seq, ViewKVs, DocIdKVs, Seqs,
Log),
-            case accumulate_more(length(NewIds)) of
+            case accumulate_more(length(NewIds), Acc) of
                 true -> accumulate_writes(State, W, Acc);
                 false -> {ok, Acc}
             end
     end.
 
 
-accumulate_more(NumDocIds) ->
+accumulate_more(NumDocIds, Acc) ->
     % check if we have enough items now
     MinItems = config:get("view_updater", "min_writer_items", "100"),
     MinSize = config:get("view_updater", "min_writer_size", "16777216"),
-    {memory, CurrMem} = process_info(self(), memory),
+    CurrMem = ?term_size(Acc),
     NumDocIds < list_to_integer(MinItems)
         andalso CurrMem < list_to_integer(MinSize).
 


Mime
View raw message