ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] AMashenkov commented on a change in pull request #6917: IGNITE-12189 Implementation correct limit for TextQuery
Date Thu, 03 Oct 2019 14:37:19 GMT
AMashenkov commented on a change in pull request #6917: IGNITE-12189 Implementation correct
limit for TextQuery
URL: https://github.com/apache/ignite/pull/6917#discussion_r331064296
 
 

 ##########
 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:
   Is it possible to rewrite this with no adding 'total' field, but using CAS-loop or cnt.getAndUpdate()
?

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