usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [21/42] git commit: Fixes off by 1 error when using the start parameter in collection traversal
Date Wed, 05 Feb 2014 01:21:31 GMT
Fixes off by 1 error when using the start parameter in collection traversal


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

Branch: refs/pull/27/merge
Commit: acc95d131b33cc56dd0df3979bd75a40fc867678
Parents: b05edcd
Author: Todd Nine <tnine@apigee.com>
Authored: Tue Jan 28 19:24:13 2014 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Tue Jan 28 19:33:27 2014 -0700

----------------------------------------------------------------------
 .../org/usergrid/persistence/cassandra/CassandraService.java    | 5 +++--
 .../org/usergrid/persistence/cassandra/RelationManagerImpl.java | 3 ++-
 stack/tools/src/main/java/org/usergrid/tools/EntityCleanup.java | 2 +-
 .../src/main/java/org/usergrid/tools/UniqueIndexCleanup.java    | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/acc95d13/stack/core/src/main/java/org/usergrid/persistence/cassandra/CassandraService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/usergrid/persistence/cassandra/CassandraService.java
b/stack/core/src/main/java/org/usergrid/persistence/cassandra/CassandraService.java
index 7edc530..6e166b6 100644
--- a/stack/core/src/main/java/org/usergrid/persistence/cassandra/CassandraService.java
+++ b/stack/core/src/main/java/org/usergrid/persistence/cassandra/CassandraService.java
@@ -1047,7 +1047,7 @@ public class CassandraService {
      * @throws Exception the exception
      */
     public IndexScanner getIdList( Keyspace ko, Object key, UUID start, UUID finish, int
count, boolean reversed,
-                                   IndexBucketLocator locator, UUID applicationId, String
collectionName )
+                                   IndexBucketLocator locator, UUID applicationId, String
collectionName, boolean keepFirst )
             throws Exception {
 
         if ( count <= 0 ) {
@@ -1058,7 +1058,8 @@ public class CassandraService {
             start = null;
         }
 
-        final boolean skipFirst = start != null;
+
+        final boolean skipFirst = start != null && !keepFirst;
 
         IndexScanner scanner =
                 new IndexBucketScanner( this, locator, ENTITY_ID_SETS, applicationId, IndexType.COLLECTION,
key, start,

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/acc95d13/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
b/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
index 7eb7693..577f803 100644
--- a/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
+++ b/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
@@ -2123,10 +2123,11 @@ public class RelationManagerImpl implements RelationManager {
                 startId = UUID_PARSER.parse( slice.getCursor() ).getUUID();
             }
 
+
             IndexScanner indexScanner = cass.getIdList( cass.getApplicationKeyspace( applicationId
),
                     key( headEntity.getUuid(), DICTIONARY_COLLECTIONS, collectionName ),
startId, null,
                     queryProcessor.getPageSizeHint( node ), query.isReversed(), indexBucketLocator,
applicationId,
-                    collectionName );
+                    collectionName, node.isForceKeepFirst() );
 
             this.results.push( new SliceIterator( slice, indexScanner, UUID_PARSER ) );
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/acc95d13/stack/tools/src/main/java/org/usergrid/tools/EntityCleanup.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/usergrid/tools/EntityCleanup.java b/stack/tools/src/main/java/org/usergrid/tools/EntityCleanup.java
index d886f70..f090a23 100644
--- a/stack/tools/src/main/java/org/usergrid/tools/EntityCleanup.java
+++ b/stack/tools/src/main/java/org/usergrid/tools/EntityCleanup.java
@@ -124,7 +124,7 @@ public class EntityCleanup extends ToolBase {
 
                 IndexScanner scanner = cass.getIdList( cass.getApplicationKeyspace( applicationId
),
                         key( applicationId, DICTIONARY_COLLECTIONS, collectionName ), null,
null, PAGE_SIZE, false,
-                        indexBucketLocator, applicationId, collectionName );
+                        indexBucketLocator, applicationId, collectionName, false );
 
                 SliceIterator itr = new SliceIterator( null, scanner, new UUIDIndexSliceParser()
);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/acc95d13/stack/tools/src/main/java/org/usergrid/tools/UniqueIndexCleanup.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/usergrid/tools/UniqueIndexCleanup.java b/stack/tools/src/main/java/org/usergrid/tools/UniqueIndexCleanup.java
index f46a882..1b5dff7 100644
--- a/stack/tools/src/main/java/org/usergrid/tools/UniqueIndexCleanup.java
+++ b/stack/tools/src/main/java/org/usergrid/tools/UniqueIndexCleanup.java
@@ -179,7 +179,7 @@ public class UniqueIndexCleanup extends ToolBase {
 
                 IndexScanner scanner = cass.getIdList( cass.getApplicationKeyspace( applicationId
),
                         key( applicationId, DICTIONARY_COLLECTIONS, collectionName ), null,
null, PAGE_SIZE, false,
-                        indexBucketLocator, applicationId, collectionName );
+                        indexBucketLocator, applicationId, collectionName, false );
 
                 SliceIterator itr = new SliceIterator( null, scanner, new UUIDIndexSliceParser()
);
 


Mime
View raw message