AMashenkov commented on a change in pull request #9086:
URL: https://github.com/apache/ignite/pull/9086#discussion_r639522679
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
##########
@@ -264,25 +266,7 @@ protected void onNodeLeft(UUID evtNodeId) {
protected void enqueue(Collection<?> col) {
assert Thread.holdsLock(this);
- if (limitDisabled) {
- queue.add((Collection<R>)col);
-
- cnt.addAndGet(col.size());
- }
- else {
- if (capacity >= col.size()) {
- queue.add((Collection<R>)col);
- capacity -= col.size();
-
- cnt.addAndGet(col.size());
- }
- else if (capacity > 0) {
- queue.add(new ArrayList<>((Collection<R>)col).subList(0,
capacity));
- capacity = 0;
-
- cnt.addAndGet(capacity);
- }
- }
+ queue.add((Collection<R>)col);
Review comment:
I wrote nothing about an empty collection.
I just noticed, that when we detect 'limit was reached' in this method,
then it looks safe to call onDone() to finish this future and prevent
internalIterator().loadPage() from being called.
--
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]