summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_btree.erl6
-rw-r--r--src/couchdb/couch_db.erl4
-rw-r--r--src/couchdb/couch_query_servers.erl8
-rw-r--r--src/couchdb/couch_view.erl10
4 files changed, 14 insertions, 14 deletions
diff --git a/src/couchdb/couch_btree.erl b/src/couchdb/couch_btree.erl
index f01234c1..b9374f91 100644
--- a/src/couchdb/couch_btree.erl
+++ b/src/couchdb/couch_btree.erl
@@ -64,7 +64,7 @@ final_reduce(Reduce, {[], []}) ->
final_reduce(_Bt, {[], [Red]}) ->
Red;
final_reduce(Reduce, {[], Reductions}) ->
- Reduce(combine, Reductions);
+ Reduce(rereduce, Reductions);
final_reduce(Reduce, {KVs, Reductions}) ->
Red = Reduce(reduce, KVs),
final_reduce(Reduce, {[], [Red | Reductions]}).
@@ -289,7 +289,7 @@ modify_node(Bt, RootPointerInfo, Actions, QueryOutput) ->
reduce_node(#btree{reduce=nil}, _NodeType, _NodeList) ->
[];
reduce_node(#btree{reduce=R}, kp_node, NodeList) ->
- R(combine, [Red || {_K, {_P, Red}} <- NodeList]);
+ R(rereduce, [Red || {_K, {_P, Red}} <- NodeList]);
reduce_node(#btree{reduce=R}, kv_node, NodeList) ->
R(reduce, NodeList).
@@ -658,7 +658,7 @@ test_btree(KeyValues) ->
ReduceFun =
fun(reduce, KVs) ->
length(KVs);
- (combine, Reds) ->
+ (rereduce, Reds) ->
lists:sum(Reds)
end,
Btree1 = set_options(Btree, [{reduce, ReduceFun}]),
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index 844c9260..66b18976 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -440,13 +440,13 @@ btree_by_id_join(Id, {Seq, Deleted, Tree}) ->
btree_by_id_reduce(reduce, FullDocInfos) ->
% count the number of deleted documents
length([1 || #full_doc_info{deleted=false} <- FullDocInfos]);
-btree_by_id_reduce(combine, Reds) ->
+btree_by_id_reduce(rereduce, Reds) ->
lists:sum(Reds).
btree_by_seq_reduce(reduce, DocInfos) ->
% count the number of deleted documents
length(DocInfos);
-btree_by_seq_reduce(combine, Reds) ->
+btree_by_seq_reduce(rereduce, Reds) ->
lists:sum(Reds).
init_db(DbName, Filepath, Fd, Header) ->
diff --git a/src/couchdb/couch_query_servers.erl b/src/couchdb/couch_query_servers.erl
index 1fb2462c..ffacbc26 100644
--- a/src/couchdb/couch_query_servers.erl
+++ b/src/couchdb/couch_query_servers.erl
@@ -17,7 +17,7 @@
-export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2,code_change/3,stop/0]).
-export([start_doc_map/2, map_docs/2, stop_doc_map/1]).
--export([reduce/3, combine/3]).
+-export([reduce/3, rereduce/3]).
-export([test/0, test/1]).
-include("couch_db.hrl").
@@ -141,15 +141,15 @@ group_reductions_results(List) ->
[Heads | group_reductions_results(Tails)]
end.
-combine(_Lang, [], _ReducedValues) ->
+rereduce(_Lang, [], _ReducedValues) ->
{ok, []};
-combine(Lang, RedSrcs, ReducedValues) ->
+rereduce(Lang, RedSrcs, ReducedValues) ->
Port = get_linked_port(Lang),
Grouped = group_reductions_results(ReducedValues),
Results = lists:zipwith(
fun(FunSrc, Values) ->
{true, {Result}} =
- prompt(Port, {"combine", {FunSrc}, list_to_tuple(Values)}),
+ prompt(Port, {"rereduce", {FunSrc}, list_to_tuple(Values)}),
Result
end, RedSrcs, Grouped),
diff --git a/src/couchdb/couch_view.erl b/src/couchdb/couch_view.erl
index c44a9ba8..ee493c7d 100644
--- a/src/couchdb/couch_view.erl
+++ b/src/couchdb/couch_view.erl
@@ -115,9 +115,9 @@ fold_reduce({reduce, NthRed, Lang, #view{btree=Bt, reduce_funs=RedFuns}}, Dir, S
fun(reduce, KVs) ->
{ok, Reduced} = couch_query_servers:reduce(Lang, [FunSrc], KVs),
{0, PreResultPadding ++ Reduced ++ PostResultPadding};
- (combine, Reds) ->
+ (rereduce, Reds) ->
UserReds = [[lists:nth(NthRed, UserRedsList)] || {_, UserRedsList} <- Reds],
- {ok, Reduced} = couch_query_servers:combine(Lang, [FunSrc], UserReds),
+ {ok, Reduced} = couch_query_servers:rereduce(Lang, [FunSrc], UserReds),
{0, PreResultPadding ++ Reduced ++ PostResultPadding}
end,
WrapperFun = fun({GroupedKey, _}, PartialReds, Acc0) ->
@@ -154,7 +154,7 @@ reduce_to_count(Reductions) ->
couch_btree:final_reduce(
fun(reduce, KVs) ->
{length(KVs), []};
- (combine, Reds) ->
+ (rereduce, Reds) ->
{lists:sum([Count0 || {Count0, _} <- Reds]), []}
end, Reductions),
Count.
@@ -485,10 +485,10 @@ disk_group_to_mem(Db, Fd, #group{id_btree=IdState,def_lang=Lang,views=Views}=Gro
fun(reduce, KVs) ->
{ok, Reduced} = couch_query_servers:reduce(Lang, FunSrcs, KVs),
{length(KVs), Reduced};
- (combine, Reds) ->
+ (rereduce, Reds) ->
Count = lists:sum([Count0 || {Count0, _} <- Reds]),
UserReds = [UserRedsList || {_, UserRedsList} <- Reds],
- {ok, Reduced} = couch_query_servers:combine(Lang, FunSrcs, UserReds),
+ {ok, Reduced} = couch_query_servers:rereduce(Lang, FunSrcs, UserReds),
{Count, Reduced}
end,
{ok, Btree} = couch_btree:open(BtreeState, Fd,