usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [34/50] [abbrv] git commit: Fixes side effects of next operation
Date Fri, 13 Jun 2014 18:54:13 GMT
Fixes side effects of next operation


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2781766e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2781766e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2781766e

Branch: refs/heads/master
Commit: 2781766e1bcf867dd5e136087ab9d1d7814ec9a6
Parents: cb4dfa0
Author: Todd Nine <tnine@apigee.com>
Authored: Thu Jun 12 11:00:41 2014 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Thu Jun 12 11:00:41 2014 -0600

----------------------------------------------------------------------
 .../persistence/query/ir/result/SubtractionIterator.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2781766e/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIterator.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIterator.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIterator.java
index b4bf319..ea65cd1 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIterator.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIterator.java
@@ -79,7 +79,11 @@ public class SubtractionIterator extends MergeIterator {
 
         Set<ScanColumn> results = new LinkedHashSet<ScanColumn>( pageSize );
 
-        while ( keepIterator.hasNext() && results.size() < pageSize ) {
+        /**
+         * The order here is important.  We don't want to check the advance unless we're
less than our result size
+         * Otherwise we have issues with side effects of cursor construction.
+         */
+        while (results.size() < pageSize && keepIterator.hasNext() ) {
 
             Set<ScanColumn> keepPage = keepIterator.next();
 


Mime
View raw message