ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] shuliga commented on a change in pull request #6917: IGNITE-12189 Implementation correct limit for TextQuery
Date Thu, 03 Oct 2019 14:54:42 GMT
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

Mime
View raw message