AMashenkov commented on a change in pull request #9081:
URL: https://github.com/apache/ignite/pull/9081#discussion_r655451676
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
##########
@@ -146,40 +137,50 @@ public GridCacheQueryBean query() {
/**
* @return If fields query.
*/
- boolean fields() {
+ public boolean fields() {
return false;
}
- /** {@inheritDoc} */
- @Override public boolean onDone(Collection<R> res, Throwable err) {
- cctx.time().removeTimeoutObject(this);
-
- return super.onDone(res, err);
- }
-
/** {@inheritDoc} */
@Override public R next() {
try {
- R next = unmaskNull(internalIterator().next());
+ if (!limitDisabled && cnt == capacity)
+ return null;
- cnt.decrementAndGet();
+ checkError();
+
+ R next = null;
+
+ if (reducer().hasNext()) {
+ next = unmaskNull(reducer().next());
+
+ if (!limitDisabled) {
+ cnt++;
+
+ // Exceed limit, stop page loading and cancel queries.
+ if (cnt == capacity)
+ cancel();
+ }
+ }
+
+ checkError();
return next;
}
- catch (NoSuchElementException ignored) {
- return null;
- }
catch (IgniteCheckedException e) {
throw CU.convertToCacheException(e);
}
}
+ /** @return Cache query results reducer. */
Review comment:
```suggestion
/**
* @return Cache query results reducer.
*/
```
--
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]