davisp commented on a change in pull request #3127:
URL: https://github.com/apache/couchdb/pull/3127#discussion_r487142754



##########
File path: src/couch_views/src/couch_views_batch.erl
##########
@@ -0,0 +1,80 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_views_batch).
+
+
+-export([
+    start/1,
+    success/3,
+    failure/1
+]).
+
+
+-include_lib("couch_mrview/include/couch_mrview.hrl").
+
+
+-callback start(
+            Mrst::#mrst{},
+            State::term()
+        ) -> {NewState::term(), BatchSize::pos_integer()}.
+
+-callback success(
+            Mrst::#mrst{},
+            TxSize::non_neg_integer(),
+            DocsRead::non_neg_integer(),

Review comment:
       A map function can emit 0 or more rows for each of the defined views. 
For every doc we have a result set regardless of whether it has rows or not 
(because we have to remember we may be removing a document from a view). 
Regardless of whether a doc emits rows or not, it still has an entry in 
`MappedDocs` and `length(DocAcc) == length(MappedDocs)`.
   
   I could see counting up the number of rows emitted for each document as 
maybe being an interesting value to have access to.

##########
File path: src/couch_views/src/couch_views_batch.erl
##########
@@ -0,0 +1,80 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_views_batch).
+
+
+-export([
+    start/1,
+    success/3,
+    failure/1
+]).
+
+
+-include_lib("couch_mrview/include/couch_mrview.hrl").
+
+
+-callback start(
+            Mrst::#mrst{},
+            State::term()
+        ) -> {NewState::term(), BatchSize::pos_integer()}.
+
+-callback success(
+            Mrst::#mrst{},
+            TxSize::non_neg_integer(),
+            DocsRead::non_neg_integer(),

Review comment:
       A map function can emit 0 or more rows for each of the defined views. 
For every doc we have a result set regardless of whether it has rows or not 
(because we have to remember we may be removing a document from a view). 
Regardless of whether a doc emits rows or not, it still has an entry in 
`MappedDocs` and `length(DocAcc) == length(MappedDocs)`.
   
   I could see counting up the number of rows emitted for each document as 
maybe being an interesting value to have access to.

##########
File path: src/couch_views/src/couch_views_batch.erl
##########
@@ -0,0 +1,80 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_views_batch).
+
+
+-export([
+    start/1,
+    success/3,
+    failure/1
+]).
+
+
+-include_lib("couch_mrview/include/couch_mrview.hrl").
+
+
+-callback start(
+            Mrst::#mrst{},
+            State::term()
+        ) -> {NewState::term(), BatchSize::pos_integer()}.
+
+-callback success(
+            Mrst::#mrst{},
+            TxSize::non_neg_integer(),
+            DocsRead::non_neg_integer(),

Review comment:
       A map function can emit 0 or more rows for each of the defined views. 
For every doc we have a result set regardless of whether it has rows or not 
(because we have to remember we may be removing a document from a view). 
Regardless of whether a doc emits rows or not, it still has an entry in 
`MappedDocs` and `length(DocAcc) == length(MappedDocs)`.
   
   I could see counting up the number of rows emitted for each document as 
maybe being an interesting value to have access to.

##########
File path: src/couch_views/src/couch_views_batch.erl
##########
@@ -0,0 +1,80 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_views_batch).
+
+
+-export([
+    start/1,
+    success/3,
+    failure/1
+]).
+
+
+-include_lib("couch_mrview/include/couch_mrview.hrl").
+
+
+-callback start(
+            Mrst::#mrst{},
+            State::term()
+        ) -> {NewState::term(), BatchSize::pos_integer()}.
+
+-callback success(
+            Mrst::#mrst{},
+            TxSize::non_neg_integer(),
+            DocsRead::non_neg_integer(),

Review comment:
       A map function can emit 0 or more rows for each of the defined views. 
For every doc we have a result set regardless of whether it has rows or not 
(because we have to remember we may be removing a document from a view). 
Regardless of whether a doc emits rows or not, it still has an entry in 
`MappedDocs` and `length(DocAcc) == length(MappedDocs)`.
   
   I could see counting up the number of rows emitted for each document as 
maybe being an interesting value to have access to.

##########
File path: src/couch_views/src/couch_views_batch.erl
##########
@@ -0,0 +1,80 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_views_batch).
+
+
+-export([
+    start/1,
+    success/3,
+    failure/1
+]).
+
+
+-include_lib("couch_mrview/include/couch_mrview.hrl").
+
+
+-callback start(
+            Mrst::#mrst{},
+            State::term()
+        ) -> {NewState::term(), BatchSize::pos_integer()}.
+
+-callback success(
+            Mrst::#mrst{},
+            TxSize::non_neg_integer(),
+            DocsRead::non_neg_integer(),

Review comment:
       A map function can emit 0 or more rows for each of the defined views. 
For every doc we have a result set regardless of whether it has rows or not 
(because we have to remember we may be removing a document from a view). 
Regardless of whether a doc emits rows or not, it still has an entry in 
`MappedDocs` and `length(DocAcc) == length(MappedDocs)`.
   
   I could see counting up the number of rows emitted for each document as 
maybe being an interesting value to have access to.

##########
File path: src/couch_views/src/couch_views_batch.erl
##########
@@ -0,0 +1,80 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_views_batch).
+
+
+-export([
+    start/1,
+    success/3,
+    failure/1
+]).
+
+
+-include_lib("couch_mrview/include/couch_mrview.hrl").
+
+
+-callback start(
+            Mrst::#mrst{},
+            State::term()
+        ) -> {NewState::term(), BatchSize::pos_integer()}.
+
+-callback success(
+            Mrst::#mrst{},
+            TxSize::non_neg_integer(),
+            DocsRead::non_neg_integer(),

Review comment:
       A map function can emit 0 or more rows for each of the defined views. 
For every doc we have a result set regardless of whether it has rows or not 
(because we have to remember we may be removing a document from a view). 
Regardless of whether a doc emits rows or not, it still has an entry in 
`MappedDocs` and `length(DocAcc) == length(MappedDocs)`.
   
   I could see counting up the number of rows emitted for each document as 
maybe being an interesting value to have access to.

##########
File path: src/couch_views/src/couch_views_batch.erl
##########
@@ -0,0 +1,80 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_views_batch).
+
+
+-export([
+    start/1,
+    success/3,
+    failure/1
+]).
+
+
+-include_lib("couch_mrview/include/couch_mrview.hrl").
+
+
+-callback start(
+            Mrst::#mrst{},
+            State::term()
+        ) -> {NewState::term(), BatchSize::pos_integer()}.
+
+-callback success(
+            Mrst::#mrst{},
+            TxSize::non_neg_integer(),
+            DocsRead::non_neg_integer(),

Review comment:
       A map function can emit 0 or more rows for each of the defined views. 
For every doc we have a result set regardless of whether it has rows or not 
(because we have to remember we may be removing a document from a view). 
Regardless of whether a doc emits rows or not, it still has an entry in 
`MappedDocs` and `length(DocAcc) == length(MappedDocs)`.
   
   I could see counting up the number of rows emitted for each document as 
maybe being an interesting value to have access to.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to