couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [1/2] fabric commit: updated refs/heads/1993-bigcouch-couch-mrview to fa73a5d
Date Tue, 11 Mar 2014 17:10:29 GMT
Repository: couchdb-fabric
Updated Branches:
  refs/heads/1993-bigcouch-couch-mrview acc45b411 -> fa73a5dc5


Use meta everywhere instead of total_and_offset


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

Branch: refs/heads/1993-bigcouch-couch-mrview
Commit: 3eab4d6e270a3ceaba317acf869fed7b2d131e91
Parents: acc45b4
Author: Russell Branca <chewbranca@apache.org>
Authored: Tue Mar 11 13:08:02 2014 -0400
Committer: Russell Branca <chewbranca@apache.org>
Committed: Tue Mar 11 13:08:02 2014 -0400

----------------------------------------------------------------------
 src/fabric_rpc.erl           | 9 ++-------
 src/fabric_view_all_docs.erl | 4 +++-
 src/fabric_view_map.erl      | 4 +++-
 src/fabric_view_reduce.erl   | 4 ++--
 4 files changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/3eab4d6e/src/fabric_rpc.erl
----------------------------------------------------------------------
diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl
index 5727f6d..f61933b 100644
--- a/src/fabric_rpc.erl
+++ b/src/fabric_rpc.erl
@@ -180,11 +180,8 @@ get_or_create_db(DbName, Options) ->
 
 view_cb({meta, Meta}, Acc) ->
     % Map function starting
-    Total = couch_util:get_value(total, Meta),
-    Offset = couch_util:get_value(offset, Meta),
-    case rexi:sync_reply({total_and_offset, Total, Offset}) of
+    case rexi:sync_reply({meta, Meta}) of
         ok ->
-            %% {ok, Acc#vacc{total=Total, offset=Offset}};
             {ok, Acc};
         stop ->
             exit(normal);
@@ -213,9 +210,7 @@ view_cb(complete, Acc) ->
 
 reduce_cb({meta, Meta}, Acc) ->
     % Map function starting
-    Total = couch_util:get_value(total, Meta),
-    Offset = couch_util:get_value(offset, Meta),
-    case rexi:sync_reply({total_and_offset, Total, Offset}) of
+    case rexi:sync_reply({meta, Meta}) of
         ok ->
             {ok, Acc};
         stop ->

http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/3eab4d6e/src/fabric_view_all_docs.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_all_docs.erl b/src/fabric_view_all_docs.erl
index 03ed09b..65cfd46 100644
--- a/src/fabric_view_all_docs.erl
+++ b/src/fabric_view_all_docs.erl
@@ -95,7 +95,9 @@ handle_message({rexi_EXIT, Reason}, Worker, State) ->
         {error, Resp}
     end;
 
-handle_message({total_and_offset, Tot, Off}, {Worker, From}, State) ->
+handle_message({meta, Meta0}, {Worker, From}, State) ->
+    Tot = couch_util:get_value(total, Meta0, 0),
+    Off = couch_util:get_value(offset, Meta0, 0),
     #collector{
         callback = Callback,
         counters = Counters0,

http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/3eab4d6e/src/fabric_view_map.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_map.erl b/src/fabric_view_map.erl
index afcdfa0..eb30179 100644
--- a/src/fabric_view_map.erl
+++ b/src/fabric_view_map.erl
@@ -66,7 +66,9 @@ handle_message({rexi_EXIT, Reason}, Worker, State) ->
         {error, Resp}
     end;
 
-handle_message({total_and_offset, Tot, Off}, {Worker, From}, State) ->
+handle_message({meta, Meta0}, {Worker, From}, State) ->
+    Tot = couch_util:get_value(total, Meta0, 0),
+    Off = couch_util:get_value(offset, Meta0, 0),
     #collector{
         callback = Callback,
         counters = Counters0,

http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/3eab4d6e/src/fabric_view_reduce.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_reduce.erl b/src/fabric_view_reduce.erl
index 17103a5..6b40a6a 100644
--- a/src/fabric_view_reduce.erl
+++ b/src/fabric_view_reduce.erl
@@ -82,7 +82,7 @@ handle_message({rexi_EXIT, Reason}, Worker, State) ->
 %% did not get a total_and_offset call, whereas now we do. We now use this
 %% message as a clean way to indicate to couch_mrview_http:view_cb that the
 %% reduce response is starting.
-handle_message({total_and_offset, _, _}, {_Worker, From}, State) ->
+handle_message({meta, Meta}, {_Worker, From}, State) ->
     gen_server:reply(From, ok),
     #collector{
         callback = Callback,
@@ -92,7 +92,7 @@ handle_message({total_and_offset, _, _}, {_Worker, From}, State) ->
     {Go, Acc} = case get(meta_sent) of
         undefined ->
             put(meta_sent, true),
-            Callback({meta, []}, AccIn);
+            Callback({meta, Meta}, AccIn);
         _ ->
             {ok, AccIn}
     end,


Mime
View raw message