You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/10/03 14:54:42 UTC

[GitHub] [ignite] shuliga commented on a change in pull request #6917: IGNITE-12189 Implementation correct limit for TextQuery

shuliga commented on a change in pull request #6917: IGNITE-12189 Implementation correct limit for TextQuery
URL: https://github.com/apache/ignite/pull/6917#discussion_r331086517
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
 ##########
 @@ -327,9 +334,14 @@ protected void onNodeLeft(UUID evtNodeId) {
     protected void enqueue(Collection<?> col) {
         assert Thread.holdsLock(this);
 
-        queue.add((Collection<R>)col);
-
-        cnt.addAndGet(col.size());
+        if(limit <= 0 || total.addAndGet(col.size()) <= limit) {
 
 Review comment:
   'total' counter was added because 'cnt' used here as queue size indicator and is incremented on inserts and decremented when item is consumed. So we cannot rely on it as on total counter.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services