usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [03/10] incubator-usergrid git commit: Removed collections from query, it shouldn't care about this module.
Date Fri, 20 Mar 2015 13:41:53 GMT
Removed collections from query, it shouldn't care about this module.


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

Branch: refs/heads/USERGRID-405
Commit: 72ec19d563c4e2a9f9e3842038162aeb8f038222
Parents: 12c2a1a
Author: Todd Nine <tnine@apigee.com>
Authored: Thu Mar 19 10:54:05 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Thu Mar 19 10:54:05 2015 -0600

----------------------------------------------------------------------
 stack/corepersistence/collection/pom.xml        |  14 +-
 .../impl/EntityVersionCleanupTask.java          |  13 +-
 .../mvcc/stage/write/WriteCommit.java           |   2 +-
 .../mvcc/stage/write/WriteUniqueVerify.java     |   8 +-
 .../MvccEntitySerializationStrategyImpl.java    |   3 +-
 .../MvccEntitySerializationStrategyV3Impl.java  |   3 +-
 .../UniqueValueSerializationStrategyImpl.java   |   8 -
 .../migration/MvccEntityDataMigrationImpl.java  |   2 +-
 .../collection/util/EntityUtils.java            |  72 -----
 .../mvcc/stage/AbstractEntityStageTest.java     |   2 +-
 .../mvcc/stage/AbstractMvccEntityStageTest.java |   2 +-
 .../mvcc/stage/TestEntityGenerator.java         |   2 +-
 ...MvccEntitySerializationStrategyImplTest.java |   4 +-
 ...ccEntitySerializationStrategyV1ImplTest.java |   4 +-
 ...ccEntitySerializationStrategyV2ImplTest.java |   2 +-
 .../impl/SerializationComparison.java           |   4 +-
 .../collection/util/InvalidEntityGenerator.java |   1 +
 stack/corepersistence/model/pom.xml             |   1 -
 .../persistence/model/util/EntityUtils.java     |  72 +++++
 stack/corepersistence/queryindex/pom.xml        |   6 -
 .../persistence/index/query/EntityResults.java  | 108 -------
 .../persistence/index/query/Results.java        | 148 ---------
 .../persistence/index/utils/ListUtils.java      |   6 +-
 .../index/guice/TestIndexModule.java            |   3 +-
 .../impl/EntityConnectionIndexImplTest.java     | 306 -------------------
 .../persistence/index/impl/EntityIndexTest.java |  32 +-
 26 files changed, 119 insertions(+), 709 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 3a89a8e..a4e7219 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -24,10 +24,10 @@
         <artifactId>chop-maven-plugin</artifactId>
         <version>${chop.version}</version>
 
-        
+
         NOTE: you should be putting most of these variables into your settings.xml
         as an automatically activated profile.
-        
+
 
         <configuration>
           <accessKey>${aws.s3.key}</accessKey>
@@ -48,11 +48,11 @@
           <runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
           <runnerCount>6</runnerCount>
           <securityGroupExceptions>
-            
+
             Add your own IP address as an exception to allow access
             but please do this in the settings.xml file .. essentially
             all parameters should be in the settings.xml file.
-            
+
             <param>${myip.address}/32:24981</param>
             <param>${myip.address}/32:22</param>
           </securityGroupExceptions>
@@ -81,13 +81,7 @@
 
 
 
-    <!-- lang utils for setting uuids etc -->
 
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-lang3</artifactId>
-      <version>${commons.lang.version}</version>
-    </dependency>
 
     <!-- tests -->
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCleanupTask.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCleanupTask.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCleanupTask.java
index 55d135b..b245528 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCleanupTask.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCleanupTask.java
@@ -25,15 +25,10 @@ import java.util.UUID;
 
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
-import org.apache.usergrid.persistence.collection.MvccEntity;
-import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
+
 import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
-import org.apache.usergrid.persistence.collection.serialization.impl.UniqueValueImpl;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
-import org.apache.usergrid.persistence.core.guice.ProxyImpl;
-import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.field.Field;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -42,15 +37,11 @@ import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.event.EntityVersionDeleted;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
-import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
-import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.LogEntryIterator;
 import org.apache.usergrid.persistence.core.rx.ObservableIterator;
 import org.apache.usergrid.persistence.core.task.Task;
 import org.apache.usergrid.persistence.model.entity.Id;
 
-import com.google.inject.Inject;
-import com.google.inject.assistedinject.Assisted;
 import com.netflix.astyanax.Keyspace;
 import com.netflix.astyanax.MutationBatch;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
index 8889b2f..65ba0b4 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
@@ -36,7 +36,7 @@ import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
 import org.apache.usergrid.persistence.collection.serialization.impl.UniqueValueImpl;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.guice.ProxyImpl;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
index 5bdf3b9..548127c 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
@@ -19,22 +19,18 @@ package org.apache.usergrid.persistence.collection.mvcc.stage.write;
 
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 import com.netflix.astyanax.model.ConsistencyLevel;
-import com.netflix.hystrix.Hystrix;
 import com.netflix.hystrix.HystrixCommand;
 import com.netflix.hystrix.HystrixCommandGroupKey;
 import com.netflix.hystrix.HystrixThreadPoolProperties;
-import com.netflix.hystrix.strategy.concurrency.HystrixRequestVariableLifecycle;
 
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.astyanax.CassandraConfig;
-import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
index 5bc9f56..e1445e3 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
@@ -23,7 +23,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
@@ -41,7 +40,7 @@ import org.apache.usergrid.persistence.collection.exception.CollectionRuntimeExc
 import org.apache.usergrid.persistence.collection.exception.DataCorruptionException;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.astyanax.ColumnNameIterator;
 import org.apache.usergrid.persistence.core.astyanax.ColumnParser;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
index ace076b..a5046f6 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
@@ -24,7 +24,7 @@ import org.apache.usergrid.persistence.collection.exception.EntityTooLargeExcept
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.astyanax.ColumnParser;
 import org.apache.usergrid.persistence.core.astyanax.FieldBuffer;
@@ -55,7 +55,6 @@ import com.netflix.astyanax.model.Row;
 import com.netflix.astyanax.model.Rows;
 import com.netflix.astyanax.serializers.AbstractSerializer;
 import com.netflix.astyanax.serializers.BooleanSerializer;
-import com.netflix.astyanax.util.TimeUUIDUtils;
 
 import rx.Observable;
 import rx.Scheduler;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
index 108f2e8..c95650c 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
@@ -33,14 +33,10 @@ import org.slf4j.LoggerFactory;
 import org.apache.cassandra.db.marshal.BytesType;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.MvccEntity;
-import org.apache.usergrid.persistence.collection.exception.DataCorruptionException;
-import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSet;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
 import org.apache.usergrid.persistence.core.astyanax.ColumnNameIterator;
 import org.apache.usergrid.persistence.core.astyanax.ColumnParser;
 import org.apache.usergrid.persistence.core.astyanax.ColumnTypes;
@@ -48,13 +44,10 @@ import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
 import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
-import org.apache.usergrid.persistence.core.migration.schema.Migration;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
-import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.field.Field;
 
-import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.inject.Inject;
 import com.netflix.astyanax.ColumnListMutation;
@@ -64,7 +57,6 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 import com.netflix.astyanax.model.Column;
 import com.netflix.astyanax.model.Row;
 import com.netflix.astyanax.query.RowQuery;
-import com.netflix.astyanax.serializers.AbstractSerializer;
 import com.netflix.astyanax.util.RangeBuilder;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
index bd4eafc..f87b5fd 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
@@ -38,7 +38,7 @@ import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV3Impl;
 import org.apache.usergrid.persistence.collection.serialization.impl.UniqueValueImpl;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationException;
 import org.apache.usergrid.persistence.core.migration.data.DataMigration;
 import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/util/EntityUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/util/EntityUtils.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/util/EntityUtils.java
deleted file mode 100644
index 20edb66..0000000
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/util/EntityUtils.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.apache.usergrid.persistence.collection.util;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Collection;
-import java.util.UUID;
-import org.apache.usergrid.persistence.model.field.Field;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-
-import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-
-/**
- * @author tnine
- */
-public class EntityUtils {
-
-
-    private static final java.lang.reflect.Field VERSION = FieldUtils.getField( Entity.class, "version", true );
-
-    private static final java.lang.reflect.Field ID = FieldUtils.getField( Entity.class, "id", true );
-
-
-    /**
-     * Set the version into the entity
-     */
-    public static void setVersion( Entity entity, UUID version ) {
-
-        try {
-            FieldUtils.writeField( VERSION, entity, version, true );
-        }
-        catch ( IllegalAccessException e ) {
-            throw new RuntimeException( "Unable to set the field " + VERSION + " into the entity", e );
-        }
-    }
-
-
-    /**
-     * Set the id into the entity
-     */
-    public static void setId( Entity entity, Id id ) {
-        try {
-            FieldUtils.writeField( ID, entity, id, true );
-        }
-        catch ( IllegalAccessException e ) {
-            throw new RuntimeException( "Unable to set the field " + ID + " into the entity", e );
-        }
-    }
-
-
-    /**
-     * Get all unique fields on an entity
-     * @param entity
-     * @return
-     */
-    public static List<Field> getUniqueFields( Entity entity ) {
-        final Collection<Field> entityFields = entity.getFields();
-
-        //preallocate to max possible for more efficient runtime
-        final List<Field> possibleFields = new ArrayList<>( entityFields.size() );
-
-        for ( Field field : entity.getFields() ) {
-            if ( field.isUnique() ) {
-                possibleFields.add( field );
-            }
-        }
-        return possibleFields;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
index c79fcdb..2546790 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
@@ -25,7 +25,7 @@ import org.junit.experimental.theories.Theory;
 import org.junit.runner.RunWith;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.collection.util.InvalidEntityGenerator;
 import org.apache.usergrid.persistence.collection.util.InvalidIdGenerator;
 import org.apache.usergrid.persistence.model.entity.Entity;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
index 6c6ea0f..dff0a83 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.collection.util.InvalidEntityGenerator;
 import org.apache.usergrid.persistence.collection.util.InvalidIdGenerator;
 import org.apache.usergrid.persistence.collection.util.InvalidMvccEntityGenerator;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
index 4713f5a..7a415f0 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
@@ -21,7 +21,7 @@ package org.apache.usergrid.persistence.collection.mvcc.stage;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.MvccEntity;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index 3c89b31..07a4b1b 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -35,7 +35,7 @@ import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.model.entity.Entity;
@@ -55,8 +55,6 @@ import com.google.common.base.Optional;
 import com.google.inject.Inject;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
-import junit.framework.Assert;
-
 import static junit.framework.TestCase.assertEquals;
 import static junit.framework.TestCase.assertFalse;
 import static junit.framework.TestCase.assertNotNull;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
index b0dba5d..ff8d743 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
@@ -31,7 +31,7 @@ import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
 import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;
@@ -49,8 +49,6 @@ import com.google.common.base.Optional;
 import com.google.inject.Inject;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
-import net.jcip.annotations.NotThreadSafe;
-
 
 @RunWith( ITRunner.class )
 @UseModules( TestCollectionModule.class )

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
index b91c453..c64940a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
@@ -31,7 +31,7 @@ import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
 import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
index 4f19f28..6383e75 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
@@ -28,7 +28,7 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.field.BooleanField;
@@ -43,7 +43,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.dataformat.smile.SmileFactory;
 
 /**
- * TODO We need to get both of these serialization methods working, and benchmark them for 
+ * TODO We need to get both of these serialization methods working, and benchmark them for
  * comparison Neither works out of the box for us without custom work.
  *
  * @author tnine

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
index 5b82ac8..9bba866 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
@@ -32,6 +32,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/model/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/pom.xml b/stack/corepersistence/model/pom.xml
index fb7419b..fe88256 100644
--- a/stack/corepersistence/model/pom.xml
+++ b/stack/corepersistence/model/pom.xml
@@ -39,7 +39,6 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
             <version>${commons.lang.version}</version>
-            <scope>test</scope>
         </dependency>
 
       <!-- the core, which includes Streaming API, shared low-level abstractions (but NOT data-binding) -->

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/EntityUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/EntityUtils.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/EntityUtils.java
new file mode 100644
index 0000000..929a563
--- /dev/null
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/EntityUtils.java
@@ -0,0 +1,72 @@
+package org.apache.usergrid.persistence.model.util;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collection;
+import java.util.UUID;
+import org.apache.usergrid.persistence.model.field.Field;
+
+import org.apache.commons.lang3.reflect.FieldUtils;
+
+import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+
+/**
+ * @author tnine
+ */
+public class EntityUtils {
+
+
+    private static final java.lang.reflect.Field VERSION = FieldUtils.getField( Entity.class, "version", true );
+
+    private static final java.lang.reflect.Field ID = FieldUtils.getField( Entity.class, "id", true );
+
+
+    /**
+     * Set the version into the entity
+     */
+    public static void setVersion( Entity entity, UUID version ) {
+
+        try {
+            FieldUtils.writeField( VERSION, entity, version, true );
+        }
+        catch ( IllegalAccessException e ) {
+            throw new RuntimeException( "Unable to set the field " + VERSION + " into the entity", e );
+        }
+    }
+
+
+    /**
+     * Set the id into the entity
+     */
+    public static void setId( Entity entity, Id id ) {
+        try {
+            FieldUtils.writeField( ID, entity, id, true );
+        }
+        catch ( IllegalAccessException e ) {
+            throw new RuntimeException( "Unable to set the field " + ID + " into the entity", e );
+        }
+    }
+
+
+    /**
+     * Get all unique fields on an entity
+     * @param entity
+     * @return
+     */
+    public static List<Field> getUniqueFields( Entity entity ) {
+        final Collection<Field> entityFields = entity.getFields();
+
+        //preallocate to max possible for more efficient runtime
+        final List<Field> possibleFields = new ArrayList<>( entityFields.size() );
+
+        for ( Field field : entity.getFields() ) {
+            if ( field.isUnique() ) {
+                possibleFields.add( field );
+            }
+        }
+        return possibleFields;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/queryindex/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/pom.xml b/stack/corepersistence/queryindex/pom.xml
index 5f01ee7..2dc40ce 100644
--- a/stack/corepersistence/queryindex/pom.xml
+++ b/stack/corepersistence/queryindex/pom.xml
@@ -92,12 +92,6 @@
 
         <!-- major dependencies -->
 
-        <dependency>
-            <groupId>${project.parent.groupId}</groupId>
-            <artifactId>collection</artifactId>
-            <version>${project.version}</version>
-            <type>jar</type>
-        </dependency>
 
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/EntityResults.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/EntityResults.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/EntityResults.java
deleted file mode 100644
index 59f20dd..0000000
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/EntityResults.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.usergrid.persistence.index.query;
-
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.UUID;
-
-import org.apache.usergrid.persistence.collection.EntityCollectionManager;
-import org.apache.usergrid.persistence.index.utils.UUIDUtils;
-import org.apache.usergrid.persistence.model.entity.Entity;
-
-
-/**
- * Loads results from candidate results.  This needs to be refactored to the calling module, 
- * and should not exist in the query index
- */
-public class EntityResults implements Iterable<Entity>, Iterator<Entity> {
-
-
-    private final CandidateResults results;
-    private final EntityCollectionManager ecm;
-    private final UUID maxVersion;
-    private final Iterator<CandidateResult> itr;
-    private Entity next = null;
-
-
-    public EntityResults( final CandidateResults results, final EntityCollectionManager ecm, final UUID maxVersion ) {
-        this.results = results;
-        this.ecm = ecm;
-        this.maxVersion = maxVersion;
-        this.itr = results.iterator();
-    }
-
-
-    @Override
-    public Iterator<Entity> iterator() {
-        return this;
-    }
-
-
-    @Override
-    public boolean hasNext() {
-       if(next == null){
-           doAdvance();
-       }
-
-       return next != null;
-    }
-
-
-    /**
-     * Advance to our next candidate so that it is available
-     */
-    private void doAdvance(){
-        while(itr.hasNext() && next == null){
-            CandidateResult candidate = itr.next();
-
-            // our candidate is > our max, we can't use it
-            if( UUIDUtils.compare( candidate.getVersion(), maxVersion ) > 0){
-                continue;
-            }
-
-            // our candidate was too new, ignore it
-            next = ecm.load( candidate.getId() ).toBlocking().single();
-        }
-    }
-
-
-    @Override
-    public Entity next() {
-        if(!hasNext()){
-            throw new NoSuchElementException("No more elements in the iterator");
-        }
-
-
-        Entity result =  next;
-
-        next = null;
-
-        return result;
-    }
-
-
-    @Override
-    public void remove() {
-        throw new UnsupportedOperationException( "Remove is not supported" );
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Results.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Results.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Results.java
deleted file mode 100644
index 89745d0..0000000
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Results.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  The ASF licenses this file to You
- * under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.  For additional information regarding
- * copyright in this work, please see the NOTICE file in the top level
- * directory of this distribution.
- */
-package org.apache.usergrid.persistence.index.query;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.usergrid.persistence.collection.EntityCollectionManager;
-import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
-import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-
-@XmlRootElement
-public class Results implements Iterable<Entity> {
-
-    private static final Logger log = LoggerFactory.getLogger(Results.class);
-
-    private String cursor = null;
-
-    private final Query query;
-    private final List<Id> ids = new ArrayList<Id>();
-
-    private Entity entity = null;
-    private List<Entity> entities = null;
-
-    private final List<CandidateResult> candidates;
-
-    final EntityCollectionManagerFactory ecmf;
-
-
-    public Results( Query query, List<CandidateResult> candidates, 
-            EntityCollectionManagerFactory ecmf ) {
-
-        this.query = query;
-        this.candidates = candidates;
-        this.ecmf = ecmf;
-        for ( CandidateResult candidate : candidates ) {
-            ids.add( candidate.getId() );
-        }
-    }
-
-
-    public boolean hasCursor() {
-        return cursor != null;
-    }
-
-
-    public String getCursor() {
-        return cursor;
-    }
-
-
-    public void setCursor(String cursor) {
-        this.cursor = cursor;
-    }
-
-
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    public Query getQuery() {
-        return query;
-    }
-
-
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    public List<Id> getIds() {
-        return Collections.unmodifiableList(ids);
-    }
-
-
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    public List<Entity> getEntities() {
-        return getEntities(false);
-    }
-
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    public List<Entity> getEntities(Boolean takeAllVersions) {
-
-        if ( entities == null ) {
-
-            entities = new ArrayList<Entity>();
-
-            EntityCollectionManager ecm = null;
-
-            for ( CandidateResult candidate : candidates ) {
-
-                Entity entity = ecm.load( candidate.getId() ).toBlocking().last();
-                if ( !takeAllVersions && candidate.getVersion().compareTo(entity.getVersion()) == -1) {
-                    log.debug("   Stale hit {} version {}", entity.getId(), entity.getVersion() );
-                    continue;
-                }
-
-                entities.add(entity);
-            }
-        }
-
-        return Collections.unmodifiableList( entities );
-    }
-
-
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    public Entity getEntity() {
-        if ( size() > 0 ) {
-            return getEntities().get(0);
-        }
-        return null;
-    }
-
-
-    public int size() {
-        return ids.size();
-    }
-
-
-    public boolean isEmpty() {
-        return ids.isEmpty();
-    }
-
-
-    @Override
-    public Iterator<Entity> iterator() {
-        return getEntities().iterator();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
index 6c7b480..d588476 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
@@ -22,13 +22,11 @@ import java.util.Collection;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
-import org.apache.usergrid.persistence.model.entity.Id;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.commons.lang.math.NumberUtils;
+
 
 public class ListUtils extends org.apache.commons.collections.ListUtils {
     private static final Logger LOG = LoggerFactory.getLogger( ListUtils.class );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
index 23dfe06..4cf46d6 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
@@ -21,9 +21,8 @@ package org.apache.usergrid.persistence.index.guice;
 
 import org.safehaus.guicyfig.GuicyFigModule;
 
-import org.apache.usergrid.persistence.collection.guice.CollectionModule;
-import org.apache.usergrid.persistence.core.guice.TestModule;
 import org.apache.usergrid.persistence.core.guice.CommonModule;
+import org.apache.usergrid.persistence.core.guice.TestModule;
 
 
 public class TestIndexModule extends TestModule {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
deleted file mode 100644
index a399809..0000000
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  The ASF licenses this file to You
- * under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.  For additional information regarding
- * copyright in this work, please see the NOTICE file in the top level
- * directory of this distribution.
- */
-package org.apache.usergrid.persistence.index.impl;
-
-
-import java.io.IOException;
-import java.util.HashMap;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
-import org.apache.usergrid.persistence.core.test.UseModules;
-import org.apache.usergrid.persistence.index.EntityIndex;
-import org.apache.usergrid.persistence.index.EntityIndexBatch;
-import org.apache.usergrid.persistence.index.EntityIndexFactory;
-import org.apache.usergrid.persistence.index.IndexScope;
-import org.apache.usergrid.persistence.index.SearchTypes;
-import org.apache.usergrid.persistence.index.exceptions.QueryParseException;
-import org.apache.usergrid.persistence.index.guice.TestIndexModule;
-import org.apache.usergrid.persistence.index.query.CandidateResult;
-import org.apache.usergrid.persistence.index.query.CandidateResults;
-import org.apache.usergrid.persistence.index.query.Query;
-import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
-
-import com.google.inject.Inject;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-
-@RunWith( EsRunner.class )
-@UseModules( { TestIndexModule.class } )
-public class EntityConnectionIndexImplTest extends BaseIT {
-
-    private static final Logger log = LoggerFactory.getLogger( EntityConnectionIndexImplTest.class );
-
-    //    @ClassRule
-    //    public static ElasticSearchResource es = new ElasticSearchResource();
-
-
-    @Inject
-    public EntityIndexFactory ecif;
-
-
-    @Test
-    public void testBasicOperation() throws IOException, InterruptedException {
-
-        Id appId = new SimpleId( "application" );
-        ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
-
-        // create a muffin
-        Entity muffin = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), "muffin" ) );
-
-        muffin = EntityIndexMapUtils.fromMap( muffin, new HashMap<String, Object>() {{
-            put( "size", "Large" );
-            put( "flavor", "Blueberry" );
-            put( "stars", 5 );
-        }} );
-        EntityUtils.setVersion( muffin, UUIDGenerator.newTimeUUID() );
-
-        Entity egg = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), "egg" ) );
-
-        egg = EntityIndexMapUtils.fromMap( egg, new HashMap<String, Object>() {{
-            put( "size", "Large" );
-            put( "type", "scramble" );
-            put( "stars", 5 );
-        }} );
-        EntityUtils.setVersion( egg, UUIDGenerator.newTimeUUID() );
-
-        Entity oj = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), "juice" ) );
-
-        oj = EntityIndexMapUtils.fromMap( oj, new HashMap<String, Object>() {{
-            put( "size", "Large" );
-            put( "type", "pulpy" );
-            put( "stars", 3 );
-        }} );
-        EntityUtils.setVersion( oj, UUIDGenerator.newTimeUUID() );
-
-
-        // create a person who likes muffins
-        Id personId = new SimpleId( UUIDGenerator.newTimeUUID(), "person" );
-
-
-        assertNotNull( personId );
-        assertNotNull( personId.getType() );
-        assertNotNull( personId.getUuid() );
-
-        // index connection of "person Dave likes Large Blueberry muffin"
-
-        IndexScope searchScope = new IndexScopeImpl( personId, "likes" );
-
-        //create another scope we index in, want to be sure these scopes are filtered
-        IndexScope otherIndexScope =
-                new IndexScopeImpl( new SimpleId( UUIDGenerator.newTimeUUID(), "animal" ), "likes" );
-
-        EntityIndex personLikesIndex = ecif.createEntityIndex( applicationScope );
-        personLikesIndex.initializeIndex();
-
-        EntityIndexBatch batch = personLikesIndex.createBatch();
-
-        //add to both scopes
-
-        //add a muffin
-        batch.index( searchScope, muffin );
-        batch.index( otherIndexScope, muffin );
-
-        //add the eggs
-        batch.index( searchScope, egg );
-        batch.index( otherIndexScope, egg );
-
-        //add the oj
-        batch.index( searchScope, oj );
-        batch.index( otherIndexScope, oj );
-
-        batch.execute().get();
-        personLikesIndex.refresh();
-
-
-        Thread.sleep( 2000 );
-
-        // now, let's search for muffins
-        CandidateResults likes = personLikesIndex
-                .search( searchScope, SearchTypes.fromTypes( muffin.getId().getType() ), Query.fromQL( "select *" ) );
-        assertEquals( 1, likes.size() );
-        assertEquals( muffin.getId(), likes.get( 0 ).getId() );
-
-        // now, let's search for egg
-        likes = personLikesIndex
-                .search( searchScope, SearchTypes.fromTypes( egg.getId().getType() ), Query.fromQL( "select *" ) );
-        assertEquals( 1, likes.size() );
-        assertEquals( egg.getId(), likes.get( 0 ).getId() );
-
-        // search for OJ
-        likes = personLikesIndex
-                .search( searchScope, SearchTypes.fromTypes( oj.getId().getType() ), Query.fromQL( "select *" ) );
-        assertEquals( 1, likes.size() );
-        assertEquals( oj.getId(), likes.get( 0 ).getId() );
-
-
-        //now lets search for all explicitly
-        likes = personLikesIndex.search( searchScope,
-                SearchTypes.fromTypes( muffin.getId().getType(), egg.getId().getType(), oj.getId().getType() ),
-                Query.fromQL( "select *" ) );
-        assertEquals( 3, likes.size() );
-        assertContains( egg.getId(), likes );
-        assertContains( muffin.getId(), likes );
-        assertContains( oj.getId(), likes );
-
-        //now lets search for all explicitly
-        likes = personLikesIndex.search( searchScope, SearchTypes.allTypes(), Query.fromQL( "select *" ) );
-        assertEquals( 3, likes.size() );
-        assertContains( egg.getId(), likes );
-        assertContains( muffin.getId(), likes );
-        assertContains( oj.getId(), likes );
-
-
-        //now search all entity types with a query that returns a subset
-        likes = personLikesIndex.search( searchScope,
-                SearchTypes.fromTypes( muffin.getId().getType(), egg.getId().getType(), oj.getId().getType() ),
-                Query.fromQL( "select * where stars = 5" ) );
-        assertEquals( 2, likes.size() );
-        assertContains( egg.getId(), likes );
-        assertContains( muffin.getId(), likes );
-
-
-        //now search with no types, we should get only the results that match
-        likes = personLikesIndex
-                .search( searchScope, SearchTypes.allTypes(), Query.fromQL( "select * where stars = 5" ) );
-        assertEquals( 2, likes.size() );
-        assertContains( egg.getId(), likes );
-        assertContains( muffin.getId(), likes );
-    }
-
-
-    @Test
-    public void testDelete() throws IOException, InterruptedException {
-
-        Id appId = new SimpleId( "application" );
-        ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
-
-        // create a muffin
-        Entity muffin = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), "muffin" ) );
-
-        muffin = EntityIndexMapUtils.fromMap( muffin, new HashMap<String, Object>() {{
-            put( "size", "Large" );
-            put( "flavor", "Blueberry" );
-            put( "stars", 5 );
-        }} );
-        EntityUtils.setVersion( muffin, UUIDGenerator.newTimeUUID() );
-
-        Entity egg = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), "egg" ) );
-
-        egg = EntityIndexMapUtils.fromMap( egg, new HashMap<String, Object>() {{
-            put( "size", "Large" );
-            put( "type", "scramble" );
-            put( "stars", 5 );
-        }} );
-        EntityUtils.setVersion( egg, UUIDGenerator.newTimeUUID() );
-
-        Entity oj = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), "juice" ) );
-
-        oj = EntityIndexMapUtils.fromMap( oj, new HashMap<String, Object>() {{
-            put( "size", "Large" );
-            put( "type", "pulpy" );
-            put( "stars", 3 );
-        }} );
-        EntityUtils.setVersion( oj, UUIDGenerator.newTimeUUID() );
-
-
-        // create a person who likes muffins
-        Id personId = new SimpleId( UUIDGenerator.newTimeUUID(), "person" );
-
-
-        assertNotNull( personId );
-        assertNotNull( personId.getType() );
-        assertNotNull( personId.getUuid() );
-
-        // index connection of "person Dave likes Large Blueberry muffin"
-
-        IndexScope searchScope = new IndexScopeImpl( personId, "likes" );
-
-        //create another scope we index in, want to be sure these scopes are filtered
-        IndexScope otherIndexScope =
-                new IndexScopeImpl( new SimpleId( UUIDGenerator.newTimeUUID(), "animal" ), "likes" );
-
-        EntityIndex personLikesIndex = ecif.createEntityIndex( applicationScope );
-        personLikesIndex.initializeIndex();
-
-        EntityIndexBatch batch = personLikesIndex.createBatch();
-
-        //add to both scopes
-
-        //add a muffin
-        batch.index( searchScope, muffin );
-        batch.index( otherIndexScope, muffin );
-
-        //add the eggs
-        batch.index( searchScope, egg );
-        batch.index( otherIndexScope, egg );
-
-        //add the oj
-        batch.index( searchScope, oj );
-        batch.index( otherIndexScope, oj );
-
-        batch.execute().get();
-        personLikesIndex.refresh();
-
-
-        // now, let's search for muffins
-        CandidateResults likes = personLikesIndex.search( searchScope,
-                SearchTypes.fromTypes( muffin.getId().getType(), egg.getId().getType(), oj.getId().getType() ),
-                Query.fromQL( "select *" ) );
-        assertEquals( 3, likes.size() );
-        assertContains( egg.getId(), likes );
-        assertContains( muffin.getId(), likes );
-        assertContains( oj.getId(), likes );
-
-
-        //now delete them
-        batch.deindex( searchScope, egg );
-        batch.deindex( searchScope, muffin );
-        batch.deindex( searchScope, oj );
-        batch.execute().get();
-        personLikesIndex.refresh();
-
-        likes = personLikesIndex.search( searchScope,
-                SearchTypes.fromTypes( muffin.getId().getType(), egg.getId().getType(), oj.getId().getType() ),
-                Query.fromQL( "select *" ) );
-        assertEquals( 0, likes.size() );
-    }
-
-
-    private void assertContains( final Id id, final CandidateResults results ) {
-        for ( CandidateResult result : results ) {
-            if ( result.getId().equals( id ) ) {
-                return;
-            }
-        }
-
-        fail( String.format( "Could not find id %s in candidate results", id ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/72ec19d5/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index ca9bf79..39a16b1 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -20,16 +20,15 @@ package org.apache.usergrid.persistence.index.impl;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
-import org.apache.usergrid.persistence.index.*;
-import org.apache.usergrid.persistence.model.field.ArrayField;
-import org.apache.usergrid.persistence.model.field.EntityObjectField;
-import org.apache.usergrid.persistence.model.field.UUIDField;
-import org.apache.usergrid.persistence.model.field.value.EntityObject;
 import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
@@ -39,11 +38,17 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.commons.lang3.time.StopWatch;
 
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.core.util.Health;
+import org.apache.usergrid.persistence.index.AliasedEntityIndex;
+import org.apache.usergrid.persistence.index.EntityIndex;
+import org.apache.usergrid.persistence.index.EntityIndexBatch;
+import org.apache.usergrid.persistence.index.EntityIndexFactory;
+import org.apache.usergrid.persistence.index.IndexScope;
+import org.apache.usergrid.persistence.index.SearchTypes;
 import org.apache.usergrid.persistence.index.guice.TestIndexModule;
 import org.apache.usergrid.persistence.index.query.CandidateResults;
 import org.apache.usergrid.persistence.index.query.Query;
@@ -51,7 +56,12 @@ import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
+import org.apache.usergrid.persistence.model.field.ArrayField;
+import org.apache.usergrid.persistence.model.field.EntityObjectField;
 import org.apache.usergrid.persistence.model.field.StringField;
+import org.apache.usergrid.persistence.model.field.UUIDField;
+import org.apache.usergrid.persistence.model.field.value.EntityObject;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.fasterxml.jackson.core.type.TypeReference;
@@ -59,7 +69,11 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.Maps;
 import com.google.inject.Inject;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 @RunWith(EsRunner.class)


Mime
View raw message