You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/07/03 01:22:36 UTC
incubator-usergrid git commit: Fixes bug with order by in connections
Repository: incubator-usergrid
Updated Branches:
refs/heads/USERGRID-752 b462b6ac4 -> 84d77605d
Fixes bug with order by in connections
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/84d77605
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/84d77605
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/84d77605
Branch: refs/heads/USERGRID-752
Commit: 84d77605dd1cc4d5a0b638686a2166c2430a0ca3
Parents: b462b6a
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Jul 2 17:22:34 2015 -0600
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Jul 2 17:22:34 2015 -0600
----------------------------------------------------------------------
.../query/ir/result/ConnectionShardFilter.java | 16 +++++++++-------
.../query/ir/result/SearchConnectionVisitor.java | 3 +--
.../query/ir/result/ShardFilterIterator.java | 2 +-
.../persistence/query/AbstractIteratingQueryIT.java | 3 +++
4 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84d77605/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ConnectionShardFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ConnectionShardFilter.java b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ConnectionShardFilter.java
index 39f3683..f56dc2b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ConnectionShardFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ConnectionShardFilter.java
@@ -48,15 +48,17 @@ public final class ConnectionShardFilter implements ShardFilter {
public boolean isInShard( final ScanColumn scanColumn ) {
- final UUID entityId = scanColumn.getUUID();
- final ConnectionRefImpl hashRef = new ConnectionRefImpl( searchConnection.getConnectingEntityType(), searchConnection.getConnectedEntityId(), searchConnection.getConnectionType(), searchConnection.getConnectingEntityType(), entityId );
+ //shard hashing is currently based on source. this is a placeholder for when this is fixed.
+// UUID[] indexIds = searchConnection.getIndexIds();
+//
+// final String shard = indexBucketLocator.getBucket(indexIds[ConnectionRefImpl.BY_CONNECTION_AND_ENTITY_TYPE] );
+//
+// return expectedBucket.equals( shard );
- final UUID hashId = hashRef.getConnectionSearchShardId();
+ return true;
+//
+ }
- //not for our current processing shard, discard
- final String shard = indexBucketLocator.getBucket( hashId );
- return expectedBucket.equals( shard );
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84d77605/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SearchConnectionVisitor.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SearchConnectionVisitor.java b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SearchConnectionVisitor.java
index 5505914..5949ee4 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SearchConnectionVisitor.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/SearchConnectionVisitor.java
@@ -73,8 +73,7 @@ public class SearchConnectionVisitor extends SearchVisitor {
@Override
protected IndexScanner secondaryIndexScan( QueryNode node, QuerySlice slice ) throws Exception {
- UUID
- id = ConnectionRefImpl.getIndexId( ConnectionRefImpl.BY_CONNECTION_AND_ENTITY_TYPE, headEntity,
+ final UUID id = ConnectionRefImpl.getIndexId( ConnectionRefImpl.BY_CONNECTION_AND_ENTITY_TYPE, headEntity,
connection.getConnectionType(), connection.getConnectedEntityType(), new ConnectedEntityRef[0] );
Object key = key( id, INDEX_CONNECTIONS );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84d77605/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ShardFilterIterator.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ShardFilterIterator.java b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ShardFilterIterator.java
index 3a97fb7..5406e44 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ShardFilterIterator.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/query/ir/result/ShardFilterIterator.java
@@ -103,7 +103,7 @@ public class ShardFilterIterator implements ResultIterator {
final Set<ScanColumn> results = new LinkedHashSet<ScanColumn>( );
- while(resultsIterator.hasNext()){
+ while(results.size() < pageSize && resultsIterator.hasNext() ){
final Iterator<ScanColumn> scanColumns = resultsIterator.next().iterator();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84d77605/stack/core/src/test/java/org/apache/usergrid/persistence/query/AbstractIteratingQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/AbstractIteratingQueryIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/AbstractIteratingQueryIT.java
index f6b2661..ef8c3a1 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/AbstractIteratingQueryIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/AbstractIteratingQueryIT.java
@@ -372,6 +372,7 @@ public abstract class AbstractIteratingQueryIT {
io.doSetup();
int size = 2000;
+// int size = 3;
int queryLimit = Query.MAX_LIMIT;
// the number of entities that should be written including an intersection
@@ -390,6 +391,8 @@ public abstract class AbstractIteratingQueryIT {
String name = String.valueOf( i );
boolean intersect1 = i % intersectIncrement == 0;
boolean intersect2 = i % secondIncrement == 0;
+// boolean intersect1 = i == 1;
+// boolean intersect2 = i == 1;
entity.put( "name", name );
// if we hit the increment, set this to true