nickva commented on code in PR #4984:
URL: https://github.com/apache/couchdb/pull/4984#discussion_r1491557803


##########
src/couch_replicator/src/couch_replicator_fabric_rpc.erl:
##########
@@ -27,16 +27,22 @@ docs(DbName, Options, Args0) ->
     Args = Args0#mrargs{skip = 0, limit = Skip + Limit},
     HealthThreshold = couch_replicator_scheduler:health_threshold(),
     {ok, Db} = couch_db:open_int(DbName, Options),
-    Acc = {DbName, FilterStates, HealthThreshold},
+    Acc =
+        case couch_util:get_value(view_row_map, Extra, false) of
+            true ->
+                {DbName, FilterStates, HealthThreshold, view_row_map};
+            false ->
+                {DbName, FilterStates, HealthThreshold, view_row_record}
+        end,
     couch_mrview:query_all_docs(Db, Args, fun docs_cb/2, Acc).
 
 docs_cb({meta, Meta}, Acc) ->
     ok = rexi:stream2({meta, Meta}),
     {ok, Acc};
-docs_cb({row, Row}, {DbName, States, HealthThreshold} = Acc) ->
+docs_cb({row, Row}, {DbName, States, HealthThreshold, Kind} = Acc) ->
     Id = couch_util:get_value(id, Row),
     Doc = couch_util:get_value(doc, Row),
-    ViewRow = #view_row{
+    ViewRow0 = #view_row{
         id = Id,
         key = couch_util:get_value(key, Row),
         value = couch_util:get_value(value, Row)

Review Comment:
   If we passed in `Extra` as an accumulator field then then we could use a 
general utility mentioned in another comment 
`fabric_util:view_row_from_props(Row = [{_, _} |_], Extra)` to produce either a 
map or view_row.
   
   If we pass in Extra in the accumulator, we could also avoid passing 
FilterState/State separate and just get `State =  
proplists:get_value(filter_states, Extra)` before calling rep_doc_state/5



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to