usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [1/2] incubator-usergrid git commit: Refactor of tests to use query language
Date Fri, 10 Apr 2015 16:25:57 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-536 035cb783d -> b1e0517eb


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/geo/EntityLocationRefDistanceComparatorTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/geo/EntityLocationRefDistanceComparatorTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/geo/EntityLocationRefDistanceComparatorTest.java
deleted file mode 100644
index d2cf8ad..0000000
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/geo/EntityLocationRefDistanceComparatorTest.java
+++ /dev/null
@@ -1,104 +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.geo;
-
-
-import java.util.UUID;
-
-import org.junit.Test;
-
-import org.apache.usergrid.persistence.geo.model.Point;
-import org.apache.usergrid.utils.UUIDUtils;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-
-/** @author tnine */
-public class EntityLocationRefDistanceComparatorTest {
-
-
-    @Test
-    public void locationDistanceComparator() {
-        EntityLocationRefDistanceComparator comp = new EntityLocationRefDistanceComparator();
-
-        UUID firstId = UUIDUtils.newTimeUUID();
-        UUID matchId = UUID.fromString( firstId.toString() );
-
-
-        Point zero = new Point( 0, 0 );
-
-        EntityLocationRef first = new EntityLocationRef( ( String ) null, firstId, 0, 0 );
-        first.calcDistance( zero );
-
-        EntityLocationRef second = new EntityLocationRef( ( String ) null, matchId, 0, 0 );
-        second.calcDistance( zero );
-
-        assertEquals( 0, comp.compare( first, second ) );
-
-        //now increase the distance on the second one
-
-        second = new EntityLocationRef( ( String ) null, matchId, 1, 1 );
-        second.calcDistance( zero );
-
-        assertTrue( comp.compare( first, second ) < 0 );
-
-        //set the first one to be farther
-        first = new EntityLocationRef( ( String ) null, firstId, 1, 1 );
-        first.calcDistance( zero );
-
-        second = new EntityLocationRef( ( String ) null, matchId, 0, 0 );
-        second.calcDistance( zero );
-
-        assertTrue( comp.compare( first, second ) > 0 );
-
-        //now compare by UUID.
-
-        UUID secondId = UUIDUtils.newTimeUUID();
-
-        first = new EntityLocationRef( ( String ) null, firstId, 0, 0 );
-        first.calcDistance( zero );
-
-        second = new EntityLocationRef( ( String ) null, secondId, 0, 0 );
-        second.calcDistance( zero );
-
-        assertTrue( comp.compare( first, second ) < 0 );
-
-        first = new EntityLocationRef( ( String ) null, secondId, 0, 0 );
-        first.calcDistance( zero );
-
-        second = new EntityLocationRef( ( String ) null, firstId, 0, 0 );
-        second.calcDistance( zero );
-
-        assertTrue( comp.compare( first, second ) > 0 );
-
-        //compare nulls
-
-        assertTrue( comp.compare( null, first ) > 0 );
-        assertTrue( comp.compare( first, null ) < 0 );
-
-        assertEquals( 0, comp.compare( null, null ) );
-
-
-        double less = 0;
-        double more = 1000;
-
-        int compare = Double.compare( less, more );
-
-        assertTrue( compare < 1 );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
index 8bd965c..02d3a52 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
@@ -303,8 +303,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "created" );
+        Query query = Query.fromQL("sort by  created" );
         query.setLimit( queryLimit );
 
         int count = 0;
@@ -374,9 +373,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "created" );
-        query.addEqualityFilter( "intersect", true );
+        Query query = Query.fromQL( "select * where intersect = true sort by  created" );
         query.setLimit( queryLimit );
 
         int count = 0;
@@ -446,10 +443,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "created" );
-        query.addEqualityFilter( "intersect", true );
-        query.addEqualityFilter( "intersect2", true );
+        Query query = Query.fromQL( "select * where intersect = true AND intersect2 = true sort by  created" );
         query.setLimit( queryLimit );
 
         int count = 0;
@@ -506,11 +500,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "created" );
-        // nothing will ever match this, the search should short circuit
-        query.addEqualityFilter( "intersect", true );
-        query.addEqualityFilter( "intersect2", true );
+        Query query = Query.fromQL( "select * where intersect = true AND intersect2 = true sort by  created" );
         query.setLimit( queryLimit );
 
         start = System.currentTimeMillis();
@@ -701,10 +691,8 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "created" );
+        Query query = Query.fromQL( "select * where searched = true sort by  created" );
         query.setLimit( queryLimit );
-        query.addEqualityFilter( "searched", true );
 
         int count = 0;
 
@@ -756,9 +744,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "index desc" );
-        query.addLessThanEqualFilter( "index", startValue );
+        Query query = Query.fromQL( "select * where index = "+ startValue + " sort by index desc" );
         query.setLimit( queryLimit );
 
         int count = 0;
@@ -818,9 +804,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "index desc" );
-        query.addLessThanFilter( "index", startValue );
+        Query query = Query.fromQL( "select * where index = "+ startValue + " sort by index desc" );
         query.setLimit( queryLimit );
 
         int count = 0;
@@ -880,9 +864,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "index desc" );
-        query.addGreaterThanEqualFilter( "index", startValue );
+        Query query = Query.fromQL( "select * where index = "+ startValue + " sort by index desc" );
         query.setLimit( queryLimit );
 
         int count = 0;
@@ -941,9 +923,7 @@ public class IteratingQueryIT {
 
         LOG.info( "Writes took {} ms", stop - start );
 
-        Query query = new Query();
-        query.addSort( "index desc" );
-        query.addGreaterThanFilter( "index", startValue );
+        Query query = Query.fromQL( "select * where index = "+ startValue + " sort by index desc" );
         query.setLimit( queryLimit );
 
         int count = 0;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/AbstractScanColumnTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/AbstractScanColumnTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/AbstractScanColumnTest.java
deleted file mode 100644
index a936e7f..0000000
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/AbstractScanColumnTest.java
+++ /dev/null
@@ -1,101 +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.query.ir.result;
-
-
-import java.nio.ByteBuffer;
-import java.util.UUID;
-
-import org.junit.Test;
-
-import org.apache.usergrid.utils.UUIDUtils;
-
-import static junit.framework.Assert.assertNull;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-
-
-/**
- * Simple test to test null value
- */
-public class AbstractScanColumnTest {
-
-    @Test
-    public void testValues() {
-        final UUID uuid = UUIDUtils.newTimeUUID();
-        final ByteBuffer buffer = ByteBuffer.allocate( 4 );
-        buffer.putInt( 1 );
-        buffer.rewind();
-
-        TestScanColumn col = new TestScanColumn( uuid, buffer );
-
-        assertSame( uuid, col.getUUID() );
-
-        assertEquals( 1, col.getCursorValue().getInt() );
-    }
-
-
-    @Test
-    public void nullUUID() {
-        final UUID uuid = null;
-        final ByteBuffer buffer = ByteBuffer.allocate( 4 );
-        buffer.putInt( 1 );
-        buffer.rewind();
-
-        TestScanColumn col = new TestScanColumn( uuid, buffer );
-
-        assertNull( col.getUUID() );
-
-        assertEquals( 1, col.getCursorValue().getInt() );
-    }
-
-
-    @Test
-    public void nullBuffer() {
-        final UUID uuid = UUIDUtils.newTimeUUID();
-        final ByteBuffer buffer = null;
-
-        TestScanColumn col = new TestScanColumn( uuid, buffer );
-
-        assertSame( uuid, col.getUUID() );
-
-        assertNull( col.getCursorValue() );
-    }
-
-
-    @Test
-    public void nullBoth() {
-        final UUID uuid = null;
-        final ByteBuffer buffer = null;
-
-        TestScanColumn col = new TestScanColumn( uuid, buffer );
-
-        assertNull( col.getUUID() );
-
-        assertNull( col.getCursorValue() );
-    }
-
-
-
-
-    private class TestScanColumn extends AbstractScanColumn {
-
-        protected TestScanColumn( final UUID uuid, final ByteBuffer buffer ) {
-            super( uuid, buffer );
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/InOrderIterator.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/InOrderIterator.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/InOrderIterator.java
deleted file mode 100644
index b79b38a..0000000
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/InOrderIterator.java
+++ /dev/null
@@ -1,132 +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.query.ir.result;
-
-
-import java.nio.ByteBuffer;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-import org.junit.Ignore;
-
-import org.apache.usergrid.persistence.cassandra.CursorCache;
-
-import com.google.common.collect.Iterables;
-
-
-/**
- * Simple iterator for testing that iterates UUIDs in the order returned
- *
- * @author tnine
- */
-@Ignore("not a test")
-public class InOrderIterator implements ResultIterator {
-
-    private LinkedHashSet<ScanColumn> uuids = new LinkedHashSet<ScanColumn>();
-    private Iterator<List<ScanColumn>> iterator;
-    private int pageSize = 1000;
-
-
-    public InOrderIterator( int pageSize ) {
-        this.pageSize = pageSize;
-    }
-
-
-    /** Add a uuid to the list */
-    public void add( UUID... ids ) {
-        for ( UUID current : ids ) {
-            uuids.add( new UUIDIndexSliceParser.UUIDColumn( current, ByteBuffer.allocate( 0 ) ) );
-        }
-    }
-
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see java.lang.Iterable#iterator()
-     */
-    @Override
-    public Iterator<Set<ScanColumn>> iterator() {
-        if ( iterator == null ) {
-            reset();
-        }
-
-        return this;
-    }
-
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see java.util.Iterator#hasNext()
-     */
-    @Override
-    public boolean hasNext() {
-        if ( iterator == null ) {
-            reset();
-        }
-
-        return iterator.hasNext();
-    }
-
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see java.util.Iterator#next()
-     */
-    @Override
-    public Set<ScanColumn> next() {
-        if ( iterator == null ) {
-            reset();
-        }
-
-        return new LinkedHashSet<ScanColumn>( iterator.next() );
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.usergrid.persistence.query.ir.result.ResultIterator#reset()
-     */
-    @Override
-    public void reset() {
-        this.iterator = Iterables.partition( uuids, pageSize ).iterator();
-    }
-
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see java.util.Iterator#remove()
-     */
-    @Override
-    public void remove() {
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.usergrid.persistence.query.ir.result.ResultIterator#finalizeCursor(org.apache.usergrid.persistence.cassandra
-     * .CursorCache)
-     */
-    @Override
-    public void finalizeCursor( CursorCache cache, UUID lastLoaded ) {
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IntersectionIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IntersectionIteratorTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IntersectionIteratorTest.java
deleted file mode 100644
index 540bf8b..0000000
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IntersectionIteratorTest.java
+++ /dev/null
@@ -1,308 +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.query.ir.result;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-import org.junit.Test;
-
-import org.apache.usergrid.utils.UUIDUtils;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-
-/** @author tnine */
-public class IntersectionIteratorTest {
-
-    @Test
-    public void mutipleIterators() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-        UUID id6 = UUIDUtils.minTimeUUID( 6 );
-        UUID id7 = UUIDUtils.minTimeUUID( 7 );
-        UUID id8 = UUIDUtils.minTimeUUID( 8 );
-        UUID id9 = UUIDUtils.minTimeUUID( 9 );
-        UUID id10 = UUIDUtils.minTimeUUID( 10 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator first = new InOrderIterator( 100 );
-        first.add( id9 );
-        first.add( id8 );
-        first.add( id1 );
-        first.add( id2 );
-        first.add( id3 );
-
-
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id3 );
-        second.add( id4 );
-        second.add( id8 );
-        second.add( id10 );
-
-        InOrderIterator third = new InOrderIterator( 100 );
-        third.add( id1 );
-        third.add( id3 );
-        third.add( id5 );
-        third.add( id6 );
-        third.add( id7 );
-        third.add( id8 );
-
-        InOrderIterator fourth = new InOrderIterator( 100 );
-        fourth.add( id1 );
-        fourth.add( id2 );
-        fourth.add( id3 );
-        fourth.add( id6 );
-        fourth.add( id8 );
-        fourth.add( id10 );
-
-        IntersectionIterator intersection = new IntersectionIterator( 100 );
-        intersection.addIterator( first );
-        intersection.addIterator( second );
-        intersection.addIterator( third );
-        intersection.addIterator( fourth );
-
-        Iterator<ScanColumn> union = intersection.next().iterator();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( union.hasNext() );
-        assertEquals( id8, union.next().getUUID() );
-
-        assertTrue( union.hasNext() );
-        assertEquals( id1, union.next().getUUID() );
-
-        assertTrue( union.hasNext() );
-        assertEquals( id3, union.next().getUUID() );
-
-        assertFalse( union.hasNext() );
-    }
-
-
-    @Test
-    public void oneIterator() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator first = new InOrderIterator( 100 );
-        first.add( id1 );
-        first.add( id2 );
-        first.add( id3 );
-        first.add( id4 );
-
-        IntersectionIterator intersection = new IntersectionIterator( 100 );
-        intersection.addIterator( first );
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( intersection.hasNext() );
-
-        Set<ScanColumn> page = intersection.next();
-
-        Iterator<ScanColumn> union = page.iterator();
-
-        assertEquals( id1, union.next().getUUID() );
-
-        assertTrue( union.hasNext() );
-        assertEquals( id2, union.next().getUUID() );
-
-        assertTrue( union.hasNext() );
-        assertEquals( id3, union.next().getUUID() );
-
-        assertTrue( union.hasNext() );
-        assertEquals( id4, union.next().getUUID() );
-
-        assertFalse( union.hasNext() );
-    }
-
-
-    @Test
-    public void noIterator() {
-        IntersectionIterator union = new IntersectionIterator( 100 );
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertFalse( union.hasNext() );
-    }
-
-
-    @Test
-    public void largeIntersection() {
-
-        int size = 10000;
-        int firstIntersection = 100;
-        int secondIntersection = 200;
-
-        UUID[] firstSet = new UUID[size];
-        UUID[] secondSet = new UUID[size];
-        UUID[] thirdSet = new UUID[size];
-
-        InOrderIterator first = new InOrderIterator( 100 );
-        InOrderIterator second = new InOrderIterator( 100 );
-        InOrderIterator third = new InOrderIterator( 100 );
-
-        List<UUID> results = new ArrayList<UUID>( size / secondIntersection );
-
-        for ( int i = 0; i < size; i++ ) {
-            firstSet[i] = UUIDUtils.newTimeUUID();
-            // every 100 elements, set the element equal to the first set. This way we
-            // have intersection
-
-            if ( i % firstIntersection == 0 ) {
-                secondSet[i] = firstSet[i];
-            }
-            else {
-                secondSet[i] = UUIDUtils.newTimeUUID();
-            }
-
-            if ( i % secondIntersection == 0 ) {
-                thirdSet[i] = firstSet[i];
-                results.add( firstSet[i] );
-            }
-
-            else {
-                thirdSet[i] = UUIDUtils.newTimeUUID();
-            }
-        }
-
-        first.add( firstSet );
-
-        reverse( secondSet );
-        //reverse the second
-        second.add( secondSet );
-        third.add( thirdSet );
-
-        //now itersect them and make sure we get all results in a small set
-
-        int numPages = 2;
-        int pageSize = results.size() / numPages;
-
-        IntersectionIterator intersection = new IntersectionIterator( pageSize );
-        intersection.addIterator( first );
-        intersection.addIterator( second );
-        intersection.addIterator( third );
-
-        assertTrue( intersection.hasNext() );
-
-
-        Iterator<UUID> expected = results.iterator();
-        Set<ScanColumn> resultSet = intersection.next();
-        Iterator<ScanColumn> union = resultSet.iterator();
-
-
-        while ( union.hasNext() ) {
-            assertTrue( expected.hasNext() );
-            assertEquals( expected.next(), union.next().getUUID() );
-        }
-
-
-        //now get the 2nd page
-        resultSet = intersection.next();
-        union = resultSet.iterator();
-
-
-        while ( union.hasNext() ) {
-            assertTrue( expected.hasNext() );
-            assertEquals( expected.next(), union.next().getUUID() );
-        }
-
-        //no more elements
-        assertFalse( intersection.hasNext() );
-        assertFalse( expected.hasNext() );
-    }
-
-
-    /**
-     * Tests that when there are multiple iterators, and one in the "middle" of the list returns no results, it will
-     * short circuit since no results will be possible
-     */
-    @Test
-    public void mutipleIteratorsNoIntersection() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id6 = UUIDUtils.minTimeUUID( 6 );
-        UUID id8 = UUIDUtils.minTimeUUID( 8 );
-        UUID id9 = UUIDUtils.minTimeUUID( 9 );
-        UUID id10 = UUIDUtils.minTimeUUID( 10 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator first = new InOrderIterator( 100 );
-        first.add( id1 );
-        first.add( id2 );
-        first.add( id3 );
-        first.add( id8 );
-        first.add( id9 );
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id3 );
-        second.add( id4 );
-        second.add( id8 );
-        second.add( id10 );
-
-        InOrderIterator third = new InOrderIterator( 100 );
-
-        InOrderIterator fourth = new InOrderIterator( 100 );
-        fourth.add( id1 );
-        fourth.add( id2 );
-        fourth.add( id3 );
-        fourth.add( id6 );
-        fourth.add( id8 );
-        fourth.add( id10 );
-
-        IntersectionIterator intersection = new IntersectionIterator( 100 );
-        intersection.addIterator( first );
-        intersection.addIterator( second );
-        intersection.addIterator( third );
-        intersection.addIterator( fourth );
-
-        Iterator<ScanColumn> union = intersection.next().iterator();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertFalse( union.hasNext() );
-    }
-
-
-    private void reverse( UUID[] array ) {
-
-        UUID temp = null;
-
-        for ( int i = 0; i < array.length / 2; i++ ) {
-            temp = array[i];
-            array[i] = array[array.length - i - 1];
-            array[array.length - i - 1] = temp;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IteratorHelper.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IteratorHelper.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IteratorHelper.java
deleted file mode 100644
index 049296e..0000000
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/IteratorHelper.java
+++ /dev/null
@@ -1,34 +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.query.ir.result;
-
-
-import java.nio.ByteBuffer;
-import java.util.UUID;
-
-
-/**
- *
- * @author: tnine
- *
- */
-public class IteratorHelper {
-
-    public static ScanColumn uuidColumn( UUID value ) {
-        return new UUIDIndexSliceParser.UUIDColumn( value, ByteBuffer.allocate( 0 ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIteratorTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIteratorTest.java
deleted file mode 100644
index 7ab0f25..0000000
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/SubtractionIteratorTest.java
+++ /dev/null
@@ -1,182 +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.query.ir.result;
-
-
-import java.util.Set;
-import java.util.UUID;
-
-import org.junit.Test;
-
-import org.apache.usergrid.utils.UUIDUtils;
-
-import static org.apache.usergrid.persistence.query.ir.result.IteratorHelper.uuidColumn;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-
-/** @author tnine */
-public class SubtractionIteratorTest {
-
-    @Test
-    public void smallerSubtract() {
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator keep = new InOrderIterator( 2 );
-        keep.add( id1 );
-        keep.add( id2 );
-        keep.add( id3 );
-        keep.add( id4 );
-        keep.add( id5 );
-
-        InOrderIterator subtract = new InOrderIterator( 2 );
-        subtract.add( id1 );
-        subtract.add( id3 );
-        subtract.add( id5 );
-
-        SubtractionIterator sub = new SubtractionIterator( 100 );
-        sub.setKeepIterator( keep );
-        sub.setSubtractIterator( subtract );
-
-        // now make sure it's right, only 2 and 8 aren't intersected
-        Set<ScanColumn> page = sub.next();
-
-        assertTrue( page.contains( uuidColumn( id2 ) ) );
-        assertTrue( page.contains( uuidColumn( id4 ) ) );
-
-        assertEquals( 2, page.size() );
-    }
-
-
-    @Test
-    public void smallerKeep() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-        UUID id6 = UUIDUtils.minTimeUUID( 6 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator keep = new InOrderIterator( 100 );
-        keep.add( id1 );
-        keep.add( id2 );
-        keep.add( id5 );
-        keep.add( id6 );
-
-        InOrderIterator subtract = new InOrderIterator( 100 );
-        subtract.add( id1 );
-        subtract.add( id3 );
-        subtract.add( id4 );
-        subtract.add( id5 );
-        subtract.add( id6 );
-
-        SubtractionIterator sub = new SubtractionIterator( 100 );
-        sub.setKeepIterator( keep );
-        sub.setSubtractIterator( subtract );
-
-        // now make sure it's right, only 2 and 8 aren't intersected
-
-        Set<ScanColumn> page = sub.next();
-
-        assertTrue( page.contains( uuidColumn( id2 ) ) );
-
-        assertEquals( 1, page.size() );
-    }
-
-
-    @Test
-    public void smallerKeepRemoveAll() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-        UUID id6 = UUIDUtils.minTimeUUID( 6 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator keep = new InOrderIterator( 100 );
-        keep.add( id1 );
-        keep.add( id3 );
-        keep.add( id4 );
-
-        InOrderIterator subtract = new InOrderIterator( 100 );
-        subtract.add( id1 );
-        subtract.add( id2 );
-        subtract.add( id3 );
-        subtract.add( id4 );
-        subtract.add( id5 );
-        subtract.add( id6 );
-
-        SubtractionIterator sub = new SubtractionIterator( 100 );
-        sub.setKeepIterator( keep );
-        sub.setSubtractIterator( subtract );
-
-        // now make sure it's right, only 2 and 8 aren't intersected
-
-        assertFalse( sub.hasNext() );
-    }
-
-
-    @Test
-    public void noKeep() {
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator keep = new InOrderIterator( 100 );
-
-        InOrderIterator subtract = new InOrderIterator( 100 );
-        subtract.add( id1 );
-
-        SubtractionIterator sub = new SubtractionIterator( 100 );
-        sub.setKeepIterator( keep );
-        sub.setSubtractIterator( subtract );
-
-        assertFalse( sub.hasNext() );
-    }
-
-
-    @Test
-    public void noSubtract() {
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-
-        //keep only id 1
-        InOrderIterator keep = new InOrderIterator( 100 );
-        keep.add( id1 );
-
-        InOrderIterator subtract = new InOrderIterator( 100 );
-
-
-        SubtractionIterator sub = new SubtractionIterator( 100 );
-        sub.setKeepIterator( keep );
-        sub.setSubtractIterator( subtract );
-
-        assertTrue( sub.hasNext() );
-        Set<ScanColumn> page = sub.next();
-
-        assertTrue( page.contains( uuidColumn( id1 ) ) );
-        assertEquals( 1, page.size() );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/UnionIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/UnionIteratorTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/UnionIteratorTest.java
deleted file mode 100644
index 68d2313..0000000
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/ir/result/UnionIteratorTest.java
+++ /dev/null
@@ -1,468 +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.query.ir.result;
-
-
-import java.nio.ByteBuffer;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.UUID;
-
-import org.junit.Test;
-
-import org.apache.usergrid.utils.UUIDUtils;
-
-import me.prettyprint.cassandra.serializers.UUIDSerializer;
-
-import static org.apache.usergrid.persistence.query.ir.result.IteratorHelper.uuidColumn;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-
-/**
- * @author tnine
- */
-public class UnionIteratorTest {
-
-    @Test
-    public void testMutipleIterators() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-        UUID id6 = UUIDUtils.minTimeUUID( 6 );
-        UUID id7 = UUIDUtils.minTimeUUID( 7 );
-        UUID id8 = UUIDUtils.minTimeUUID( 8 );
-        UUID id9 = UUIDUtils.minTimeUUID( 9 );
-        UUID id10 = UUIDUtils.minTimeUUID( 10 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator first = new InOrderIterator( 100 );
-        first.add( id1 );
-        first.add( id2 );
-        first.add( id3 );
-        first.add( id8 );
-        first.add( id9 );
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id3 );
-        second.add( id4 );
-        second.add( id8 );
-        second.add( id10 );
-
-        InOrderIterator third = new InOrderIterator( 100 );
-        third.add( id6 );
-        third.add( id7 );
-        third.add( id1 );
-        third.add( id3 );
-        third.add( id5 );
-        third.add( id8 );
-
-        InOrderIterator fourth = new InOrderIterator( 100 );
-        fourth.add( id1 );
-        fourth.add( id6 );
-        fourth.add( id2 );
-        fourth.add( id3 );
-        fourth.add( id8 );
-        fourth.add( id9 );
-
-
-        UnionIterator iter = new UnionIterator( 100, 0, null );
-        iter.addIterator( first );
-        iter.addIterator( second );
-        iter.addIterator( third );
-        iter.addIterator( fourth );
-
-        Set<ScanColumn> union = iter.next();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( union.contains( uuidColumn( id1 ) ) );
-        assertTrue( union.contains( uuidColumn( id2 ) ) );
-        assertTrue( union.contains( uuidColumn( id3 ) ) );
-        assertTrue( union.contains( uuidColumn( id4 ) ) );
-        assertTrue( union.contains( uuidColumn( id5 ) ) );
-        assertTrue( union.contains( uuidColumn( id6 ) ) );
-        assertTrue( union.contains( uuidColumn( id7 ) ) );
-        assertTrue( union.contains( uuidColumn( id8 ) ) );
-        assertTrue( union.contains( uuidColumn( id9 ) ) );
-        assertTrue( union.contains( uuidColumn( id10 ) ) );
-    }
-
-
-    @Test
-    public void testOneIterator() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator first = new InOrderIterator( 100 );
-        first.add( id1 );
-        first.add( id2 );
-        first.add( id3 );
-        first.add( id4 );
-
-        UnionIterator union = new UnionIterator( 100, 0, null );
-        union.addIterator( first );
-
-        Set<ScanColumn> ids = union.next();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( ids.contains( uuidColumn( id1 ) ) );
-        assertTrue( ids.contains( uuidColumn( id2 ) ) );
-        assertTrue( ids.contains( uuidColumn( id3 ) ) );
-        assertTrue( ids.contains( uuidColumn( id4 ) ) );
-
-        assertFalse( union.hasNext() );
-    }
-
-
-    @Test
-    public void testEmptyFirstIterator() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-
-        // we should get intersection on 1, 3, and 8
-        InOrderIterator first = new InOrderIterator( 100 );
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id3 );
-        second.add( id4 );
-
-        UnionIterator union = new UnionIterator( 100, 0, null );
-        union.addIterator( first );
-        union.addIterator( second );
-
-        Set<ScanColumn> ids = union.next();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( ids.contains( uuidColumn( id1 ) ) );
-        assertTrue( ids.contains( uuidColumn( id2 ) ) );
-        assertTrue( ids.contains( uuidColumn( id3 ) ) );
-        assertTrue( ids.contains( uuidColumn( id4 ) ) );
-
-        assertFalse( union.hasNext() );
-    }
-
-
-    @Test
-    public void testNoIterator() {
-
-        UnionIterator union = new UnionIterator( 100, 0, null );
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertFalse( union.hasNext() );
-    }
-
-
-    @Test
-    public void largeUnionTest() {
-
-        int size = 10000;
-        int firstIntersection = 100;
-        int secondIntersection = 200;
-
-        int pageSize = 20;
-
-        UUID[] firstSet = new UUID[size];
-        UUID[] secondSet = new UUID[size];
-        UUID[] thirdSet = new UUID[size];
-
-        InOrderIterator first = new InOrderIterator( pageSize / 2 );
-        InOrderIterator second = new InOrderIterator( pageSize / 2 );
-        InOrderIterator third = new InOrderIterator( pageSize / 2 );
-
-        Set<UUID> results = new HashSet<UUID>( size );
-
-        for ( int i = 0; i < size; i++ ) {
-            firstSet[i] = UUIDUtils.newTimeUUID();
-            // every 100 elements, set the element equal to the first set. This way we
-            // have intersection
-
-            results.add( firstSet[i] );
-
-            if ( i % firstIntersection == 0 ) {
-                secondSet[i] = firstSet[i];
-            }
-            else {
-                secondSet[i] = UUIDUtils.newTimeUUID();
-                results.add( secondSet[i] );
-            }
-
-            if ( i % secondIntersection == 0 ) {
-                thirdSet[i] = firstSet[i];
-            }
-
-            else {
-                thirdSet[i] = UUIDUtils.newTimeUUID();
-                results.add( thirdSet[i] );
-            }
-        }
-
-        first.add( firstSet );
-
-        reverse( secondSet );
-        // reverse the second
-        second.add( secondSet );
-        third.add( thirdSet );
-
-        // now intersect them and make sure we get all results in a small set
-        UnionIterator union = new UnionIterator( pageSize, 0, null );
-        union.addIterator( first );
-        union.addIterator( second );
-        union.addIterator( third );
-
-
-        while ( union.hasNext() ) {
-
-            // now get the 2nd page
-            Set<ScanColumn> resultSet = union.next();
-
-            for ( ScanColumn col : resultSet ) {
-                boolean existed = results.remove( col.getUUID() );
-
-                assertTrue( "Duplicate element was detected", existed );
-            }
-        }
-
-        assertEquals( 0, results.size() );
-        assertFalse( union.hasNext() );
-    }
-
-
-    @Test
-    public void iterationCompleted() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-
-
-        UnionIterator union = new UnionIterator( 5, 0, null );
-
-        InOrderIterator first = new InOrderIterator( 100 );
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id3 );
-        second.add( id4 );
-        second.add( id5 );
-
-        union.addIterator( first );
-        union.addIterator( second );
-
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( union.hasNext() );
-
-        Set<ScanColumn> ids = union.next();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( ids.contains( uuidColumn( id1 ) ) );
-        assertTrue( ids.contains( uuidColumn( id2 ) ) );
-        assertTrue( ids.contains( uuidColumn( id3 ) ) );
-        assertTrue( ids.contains( uuidColumn( id4 ) ) );
-        assertTrue( ids.contains( uuidColumn( id5 ) ) );
-
-        //now try to get the next page
-        ids = union.next();
-        assertNull( ids );
-    }
-
-
-    @Test
-    public void nullCursorBytes() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id3 );
-        second.add( id4 );
-        second.add( id5 );
-
-        UnionIterator union = new UnionIterator( 100, 1, null );
-
-        union.addIterator( second );
-
-        Set<ScanColumn> ids = union.next();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( ids.contains( uuidColumn( id1 ) ) );
-        assertTrue( ids.contains( uuidColumn( id2 ) ) );
-        assertTrue( ids.contains( uuidColumn( id3 ) ) );
-        assertTrue( ids.contains( uuidColumn( id4 ) ) );
-        assertTrue( ids.contains( uuidColumn( id5 ) ) );
-    }
-
-
-    @Test
-    public void validCursorBytes() {
-
-
-        ByteBuffer cursor = UUIDSerializer.get().toByteBuffer( UUIDUtils.minTimeUUID( 4 ) );
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id3 );
-        second.add( id4 );
-        second.add( id5 );
-
-        UnionIterator union = new UnionIterator( 100, 1, cursor );
-
-        union.addIterator( second );
-
-        Set<ScanColumn> ids = union.next();
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertFalse( ids.contains( uuidColumn( id1 ) ) );
-        assertFalse( ids.contains( uuidColumn( id2 ) ) );
-        assertFalse( ids.contains( uuidColumn( id3 ) ) );
-        assertFalse( ids.contains( uuidColumn( id4 ) ) );
-        assertTrue( ids.contains( uuidColumn( id5 ) ) );
-    }
-
-
-    @Test
-    public void resetCorrect() {
-
-        UUID id1 = UUIDUtils.minTimeUUID( 1 );
-        UUID id2 = UUIDUtils.minTimeUUID( 2 );
-        UUID id3 = UUIDUtils.minTimeUUID( 3 );
-        UUID id4 = UUIDUtils.minTimeUUID( 4 );
-        UUID id5 = UUIDUtils.minTimeUUID( 5 );
-        UUID id6 = UUIDUtils.minTimeUUID( 6 );
-        UUID id7 = UUIDUtils.minTimeUUID( 75 );
-
-
-        UnionIterator union = new UnionIterator( 5, 0, null );
-
-        InOrderIterator first = new InOrderIterator( 100 );
-        first.add( id3 );
-        first.add( id6 );
-        first.add( id4 );
-
-
-        InOrderIterator second = new InOrderIterator( 100 );
-        second.add( id7 );
-        second.add( id1 );
-        second.add( id2 );
-        second.add( id5 );
-
-
-        union.addIterator( first );
-        union.addIterator( second );
-
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( union.hasNext() );
-
-        Set<ScanColumn> ids = union.next();
-
-
-        assertEquals(5, ids.size());
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( ids.contains( uuidColumn( id1 ) ) );
-        assertTrue( ids.contains( uuidColumn( id2 ) ) );
-        assertTrue( ids.contains( uuidColumn( id3 ) ) );
-        assertTrue( ids.contains( uuidColumn( id4 ) ) );
-        assertTrue( ids.contains( uuidColumn( id5 ) ) );
-
-        ids = union.next();
-
-
-        assertEquals(2, ids.size());
-
-        assertTrue( ids.contains( uuidColumn( id6 ) ) );
-        assertTrue( ids.contains( uuidColumn( id7 ) ) );
-
-        //now try to get the next page
-        ids = union.next();
-        assertNull( ids );
-
-        //now reset and re-test
-        union.reset();
-
-        ids = union.next();
-
-        assertEquals(5, ids.size());
-
-
-        // now make sure it's right, only 1, 3 and 8 intersect
-        assertTrue( ids.contains( uuidColumn( id1 ) ) );
-        assertTrue( ids.contains( uuidColumn( id2 ) ) );
-        assertTrue( ids.contains( uuidColumn( id3 ) ) );
-        assertTrue( ids.contains( uuidColumn( id4 ) ) );
-        assertTrue( ids.contains( uuidColumn( id5 ) ) );
-
-
-        ids = union.next();
-
-        assertEquals(2, ids.size());
-
-        assertTrue( ids.contains( uuidColumn( id6 ) ) );
-        assertTrue( ids.contains( uuidColumn( id7 ) ) );
-
-
-        //now try to get the next page
-        ids = union.next();
-        assertNull( ids );
-    }
-
-
-    private void reverse( UUID[] array ) {
-
-        UUID temp = null;
-
-        for ( int i = 0; i < array.length / 2; i++ ) {
-            temp = array[i];
-            array[i] = array[array.length - i - 1];
-            array[array.length - i - 1] = temp;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index 682044b..1252bd0 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -32,7 +32,7 @@ import org.apache.usergrid.corepersistence.util.CpNamingUtils;
 import org.apache.usergrid.exception.ConflictException;
 import org.apache.usergrid.management.exceptions.*;
 import org.apache.usergrid.persistence.*;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -143,7 +143,7 @@ import static org.apache.usergrid.persistence.entities.Activity.PROPERTY_OBJECT_
 import static org.apache.usergrid.persistence.entities.Activity.PROPERTY_OBJECT_TYPE;
 import static org.apache.usergrid.persistence.entities.Activity.PROPERTY_TITLE;
 import static org.apache.usergrid.persistence.entities.Activity.PROPERTY_VERB;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import static org.apache.usergrid.security.AuthPrincipalType.ADMIN_USER;
 import static org.apache.usergrid.security.AuthPrincipalType.APPLICATION;
 import static org.apache.usergrid.security.AuthPrincipalType.APPLICATION_USER;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
index 8caecbc..988aa56 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
@@ -40,8 +40,8 @@ import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.SimpleEntityRef;
 import org.apache.usergrid.persistence.entities.Export;
 import org.apache.usergrid.persistence.entities.JobData;
-import org.apache.usergrid.persistence.index.query.Query;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query;
+import org.apache.usergrid.persistence.Query.Level;
 
 import com.fasterxml.jackson.core.JsonEncoding;
 import com.fasterxml.jackson.core.JsonFactory;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
index 264c752..c656e96 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
@@ -33,7 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import java.util.List;
 import java.util.UUID;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 
 
 @Component("fileImportJob")

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
index 6a53380..18879c0 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
@@ -28,8 +28,8 @@ import org.apache.usergrid.persistence.entities.FileImport;
 import org.apache.usergrid.persistence.entities.Import;
 import org.apache.usergrid.persistence.entities.JobData;
 import org.apache.usergrid.persistence.exceptions.EntityNotFoundException;
-import org.apache.usergrid.persistence.index.query.Query;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.utils.InflectionUtils;
 import org.codehaus.jackson.JsonFactory;
 import org.codehaus.jackson.JsonParser;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
index a5776fa..8a1f567 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.management.ManagementService;
 import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.index.query.Identifier;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.entities.User;
 import org.apache.usergrid.security.tokens.exceptions.BadTokenException;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
index 7e9157c..8e68edc 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
@@ -27,7 +27,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.usergrid.management.ManagementService;
 import org.apache.usergrid.persistence.EntityManager;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.entities.User;
 import org.apache.usergrid.security.tokens.exceptions.BadTokenException;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
index 9de1763..2736e30 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
@@ -79,7 +79,7 @@ import com.google.common.collect.HashBiMap;
 import static org.apache.commons.lang.StringUtils.isBlank;
 import static org.apache.commons.lang.StringUtils.isNotBlank;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYSADMIN_LOGIN_ALLOWED;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import static org.apache.usergrid.security.shiro.utils.SubjectUtils.getPermissionFromPath;
 import static org.apache.usergrid.utils.StringUtils.stringOrSubstringAfterFirst;
 import static org.apache.usergrid.utils.StringUtils.stringOrSubstringBeforeFirst;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
index dcd7557..326696a 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
@@ -27,12 +27,12 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.persistence.SimpleEntityRef;
 import org.apache.usergrid.persistence.exceptions.UnexpectedEntityTypeException;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.services.ServiceResults.Type;
 import org.apache.usergrid.services.exceptions.ForbiddenServiceOperationException;
 import org.apache.usergrid.services.exceptions.ServiceResourceNotFoundException;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
index 1e4c4b8..467b09e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
@@ -27,11 +27,11 @@ import org.apache.usergrid.persistence.ConnectionRef;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityRef;
 import org.apache.usergrid.persistence.index.query.Identifier;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.persistence.SimpleEntityRef;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.services.ServiceParameter.IdParameter;
 import org.apache.usergrid.services.ServiceParameter.NameParameter;
 import org.apache.usergrid.services.ServiceParameter.QueryParameter;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
index a197008..8bd02ea 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
@@ -25,7 +25,7 @@ import java.util.UUID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.services.ServiceParameter.IdParameter;
 import org.apache.usergrid.services.ServiceParameter.NameParameter;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
index e315fb1..957d7c7 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
@@ -31,7 +31,7 @@ import org.springframework.context.ApplicationContext;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.security.shiro.utils.SubjectUtils;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/ServiceContext.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceContext.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceContext.java
index b39acae..1650134 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceContext.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceContext.java
@@ -23,7 +23,7 @@ import java.util.Map;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.services.exceptions.ServiceResourceNotFoundException;
 import static org.apache.usergrid.services.ServiceInfo.normalizeServicePattern;
 import static org.apache.usergrid.utils.ListUtils.dequeueCopy;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
index 16afd7d..dc3a0d8 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
@@ -26,7 +26,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.services.AbstractService;
 import org.apache.usergrid.services.ServiceContext;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java b/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
index 9e73e0a..adba128 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
@@ -26,7 +26,7 @@ import org.apache.usergrid.persistence.*;
 import org.apache.usergrid.persistence.entities.Device;
 import org.apache.usergrid.persistence.entities.User;
 import org.apache.usergrid.persistence.index.query.Identifier;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.security.shiro.utils.SubjectUtils;
 import org.apache.usergrid.services.*;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
index 999a8cb..3240dc1 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
@@ -26,7 +26,7 @@ import java.util.UUID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.entities.Role;
 import org.apache.usergrid.services.AbstractPathBasedColllectionService;
 import org.apache.usergrid.services.ServiceContext;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
index 5a34d89..e4cab95 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityRef;
 import org.apache.usergrid.persistence.Results;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.services.ServiceContext;
 import org.apache.usergrid.services.ServiceResults;
 import org.apache.usergrid.services.generic.GenericCollectionService;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
index 60ed267..ebf3676 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
@@ -27,7 +27,7 @@ import org.apache.usergrid.persistence.EntityRef;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.SimpleEntityRef;
 import org.apache.usergrid.persistence.entities.User;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.services.ServiceContext;
 import org.apache.usergrid.services.ServiceResults;
 import org.apache.usergrid.services.generic.GenericCollectionService;
@@ -74,7 +74,7 @@ public class ActivitiesService extends GenericCollectionService {
             return;
         }
 
-        Results r2 = em.getConnectingEntities( new SimpleEntityRef( user.getType(), user.getUuid()), 
+        Results r2 = em.getConnectingEntities( new SimpleEntityRef( user.getType(), user.getUuid()),
             "following", User.ENTITY_TYPE, Level.IDS );
 
         if ( ( r2 == null ) || ( r2.isEmpty() ) ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
index 108a4a0..c2ac11f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
@@ -24,7 +24,7 @@ import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.entities.Notifier;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.services.notifications.impl.ApplicationQueueManagerImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index abd77ee..716f72b 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -39,7 +39,7 @@ import org.apache.usergrid.persistence.entities.Notifier;
 import org.apache.usergrid.persistence.entities.Receipt;
 import org.apache.usergrid.persistence.exceptions.RequiredPropertyNotFoundException;
 import org.apache.usergrid.persistence.index.query.Identifier;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.queue.QueueManager;
 import org.apache.usergrid.persistence.queue.QueueManagerFactory;
 import org.apache.usergrid.persistence.queue.QueueScope;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index b183daa..0bcc272 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -26,7 +26,7 @@ import org.apache.usergrid.persistence.entities.Device;
 import org.apache.usergrid.persistence.entities.Notification;
 import org.apache.usergrid.persistence.entities.Notifier;
 import org.apache.usergrid.persistence.entities.Receipt;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.queue.QueueManager;
 import org.apache.usergrid.persistence.queue.QueueMessage;
 import org.apache.usergrid.services.notifications.*;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java b/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
index 03bd24b..475d38d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
@@ -24,7 +24,7 @@ import java.util.Set;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.entities.Group;
 import org.apache.usergrid.services.AbstractCollectionService;
 import org.apache.usergrid.services.ServiceContext;
@@ -59,7 +59,7 @@ public class RolesService extends AbstractCollectionService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.apache.usergrid.services.AbstractService#getEntityDictionary(org.apache.usergrid
      * .services.ServiceContext, java.util.List, java.lang.String)
@@ -89,7 +89,7 @@ public class RolesService extends AbstractCollectionService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.apache.usergrid.services.AbstractService#putEntityDictionary(org.apache.usergrid
      * .services.ServiceContext, java.util.List, java.lang.String,
@@ -105,7 +105,7 @@ public class RolesService extends AbstractCollectionService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.apache.usergrid.services.AbstractService#postEntityDictionary(org.apache.usergrid
      * .services.ServiceContext, java.util.List, java.lang.String,
@@ -144,7 +144,7 @@ public class RolesService extends AbstractCollectionService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.apache.usergrid.services.AbstractService#deleteEntityDictionary(org.apache.usergrid
      * .services.ServiceContext, java.util.List, java.lang.String)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
index ecf3c1e..42aec04 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
@@ -30,7 +30,7 @@ import org.apache.usergrid.management.UserInfo;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityRef;
 import org.apache.usergrid.persistence.index.query.Identifier;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.persistence.entities.Role;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
index 3467e4e..e7f3268 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.entities.Activity;
 import org.apache.usergrid.persistence.entities.Activity.ActivityObject;
 import org.apache.usergrid.persistence.entities.User;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.services.ServiceContext;
 import org.apache.usergrid.services.ServicePayload;
 import org.apache.usergrid.services.ServiceResults;
@@ -134,7 +134,7 @@ public class ActivitiesService extends GenericCollectionService {
 
         //publish to all connections
         Results results =  em.getConnectingEntities(
-            new SimpleEntityRef( user.getType(), user.getUuid()), 
+            new SimpleEntityRef( user.getType(), user.getUuid()),
             "following", User.ENTITY_TYPE, Level.REFS);
 
         if( results != null ){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/corepersistence/migration/AppInfoMigrationPluginTest.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/corepersistence/migration/AppInfoMigrationPluginTest.java b/stack/services/src/test/java/org/apache/usergrid/corepersistence/migration/AppInfoMigrationPluginTest.java
index d0fa848..8c4924e 100644
--- a/stack/services/src/test/java/org/apache/usergrid/corepersistence/migration/AppInfoMigrationPluginTest.java
+++ b/stack/services/src/test/java/org/apache/usergrid/corepersistence/migration/AppInfoMigrationPluginTest.java
@@ -29,7 +29,7 @@ import org.apache.usergrid.persistence.*;
 import org.apache.usergrid.persistence.cassandra.CassandraService;
 import org.apache.usergrid.persistence.core.migration.data.ProgressObserver;
 import org.apache.usergrid.persistence.entities.Application;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
index 892e4d1..7350dcd 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
@@ -66,8 +66,8 @@ import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.SimpleEntityRef;
 import org.apache.usergrid.persistence.entities.FileImport;
 import org.apache.usergrid.persistence.entities.Import;
-import org.apache.usergrid.persistence.index.query.Query;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.setup.ConcurrentProcessSingleton;
 
 import com.amazonaws.SDKGlobalConfiguration;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportConnectionsTest.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportConnectionsTest.java b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportConnectionsTest.java
index 5e6651c..2c9db95 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportConnectionsTest.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportConnectionsTest.java
@@ -37,7 +37,7 @@ import org.apache.usergrid.persistence.PagingResultsIterator;
 import org.apache.usergrid.persistence.Results;
 import org.apache.usergrid.persistence.entities.FileImport;
 import org.apache.usergrid.persistence.entities.Import;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 
 import static org.junit.Assert.assertEquals;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
index 4932ad7..fd199e6 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
@@ -40,7 +40,7 @@ import org.apache.usergrid.persistence.entities.Import;
 import org.apache.usergrid.persistence.entities.JobData;
 import org.apache.usergrid.persistence.exceptions.EntityNotFoundException;
 import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
-import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.Query.Level;
 import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.services.notifications.QueueListener;
 import org.apache.usergrid.setup.ConcurrentProcessSingleton;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/services/ActivitiesServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/ActivitiesServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/services/ActivitiesServiceIT.java
index d31fe16..c4762f2 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/ActivitiesServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/ActivitiesServiceIT.java
@@ -22,7 +22,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.Entity;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.entities.Activity;
 
 import static org.junit.Assert.assertNotNull;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/services/RolesServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/RolesServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/services/RolesServiceIT.java
index f686bb5..a6723b7 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/RolesServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/RolesServiceIT.java
@@ -27,7 +27,7 @@ import org.junit.Test;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.entities.Role;
 import org.apache.usergrid.persistence.exceptions.RequiredPropertyNotFoundException;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java b/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
index 1c8e850..ceaf996 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
@@ -25,7 +25,7 @@ import java.util.UUID;
 
 import org.apache.usergrid.cassandra.ClearShiroSubject;
 import org.apache.usergrid.persistence.Entity;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 import static org.junit.Assert.assertNotNull;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
index d02d104..798f183 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
@@ -19,7 +19,7 @@ package org.apache.usergrid.services.notifications;
 import org.apache.usergrid.persistence.*;
 import org.apache.usergrid.persistence.entities.Notification;
 import org.apache.usergrid.persistence.entities.Receipt;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.services.ServiceManagerFactory;
 import org.junit.Before;
 import org.junit.BeforeClass;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1e0517e/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
index dec7295..c99034f 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
@@ -20,7 +20,7 @@ import com.relayrides.pushy.apns.util.*;
 import org.apache.commons.io.IOUtils;
 import org.apache.usergrid.persistence.*;
 import org.apache.usergrid.persistence.entities.*;
-import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.queue.DefaultQueueManager;
 import org.apache.usergrid.services.notifications.*;
 import org.junit.*;


Mime
View raw message