You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2014/10/09 21:28:58 UTC

[2/2] git commit: Refactor of loader started

Refactor of loader started


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

Branch: refs/heads/collection_multiget
Commit: 7af7e702ef5ed5cc80926d2969c866df2d5d40aa
Parents: 63094ab
Author: Todd Nine <to...@apache.org>
Authored: Thu Oct 9 13:28:39 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Thu Oct 9 13:28:39 2014 -0600

----------------------------------------------------------------------
 .../collection/EntityCollectionManager.java     |   8 +-
 .../persistence/collection/EntitySet.java       |   2 -
 .../persistence/collection/MvccEntity.java      |  68 ++++++++++
 .../persistence/collection/MvccLogEntry.java    |  94 ++++++++++++++
 .../persistence/collection/VersionSet.java      |  67 ++++++++++
 .../exception/CollectionRuntimeException.java   |   2 +-
 .../exception/WriteCommitException.java         |   4 +-
 .../WriteOptimisticVerifyException.java         |   4 +-
 .../exception/WriteStartException.java          |   4 +-
 .../exception/WriteUniqueVerifyException.java   |   2 +-
 .../collection/guice/CollectionModule.java      |   2 +-
 .../impl/EntityCollectionManagerImpl.java       | 103 ++++++++-------
 .../impl/EntityVersionCleanupTask.java          |   2 +-
 .../mvcc/MvccEntitySerializationStrategy.java   |   3 +-
 .../mvcc/MvccLogEntrySerializationStrategy.java |  17 ++-
 .../mvcc/changelog/ChangeLogGenerator.java      |   5 +-
 .../mvcc/changelog/ChangeLogGeneratorImpl.java  |   2 +-
 .../collection/mvcc/entity/MvccEntity.java      |  68 ----------
 .../collection/mvcc/entity/MvccLogEntry.java    |  93 -------------
 .../mvcc/entity/MvccValidationUtils.java        |   1 +
 .../mvcc/entity/impl/MvccEntityDeleteEvent.java |   2 +-
 .../mvcc/entity/impl/MvccEntityEvent.java       |   2 +-
 .../mvcc/entity/impl/MvccEntityImpl.java        |   2 +-
 .../mvcc/entity/impl/MvccEntityWriteEvent.java  |   3 +-
 .../mvcc/entity/impl/MvccLogEntryImpl.java      |   2 +-
 .../mvcc/stage/EntityUpdateEvent.java           |   1 -
 .../mvcc/stage/delete/MarkCommit.java           |   4 +-
 .../collection/mvcc/stage/delete/MarkStart.java |   4 +-
 .../mvcc/stage/write/RollbackAction.java        |   2 +-
 .../mvcc/stage/write/WriteCommit.java           |   4 +-
 .../mvcc/stage/write/WriteOptimisticVerify.java |  44 +++----
 .../collection/mvcc/stage/write/WriteStart.java |   5 +-
 .../mvcc/stage/write/WriteUniqueVerify.java     |   2 +-
 .../collection/serialization/EntityRepair.java  |   2 +-
 .../serialization/OptimisticUpdate.java         |   2 +-
 .../serialization/impl/EntityRepairImpl.java    |   2 +-
 .../serialization/impl/EntitySetImpl.java       |   3 +-
 .../serialization/impl/LogEntryIterator.java    |   2 +-
 .../MvccEntitySerializationStrategyImpl.java    |   3 +-
 .../MvccLogEntrySerializationStrategyImpl.java  | 129 +++++++++++++------
 .../serialization/impl/VersionSetImpl.java      |  80 ++++++++++++
 .../collection/EntityCollectionManagerIT.java   | 124 ++++++++++--------
 .../changelog/ChangeLogGeneratorImplTest.java   |   3 +-
 .../mvcc/entity/impl/MvccEntityImplTest.java    |   2 +-
 .../mvcc/entity/impl/MvccLogEntryImplTest.java  |   2 +-
 .../mvcc/stage/AbstractMvccEntityStageTest.java |   2 +-
 .../mvcc/stage/TestEntityGenerator.java         |   2 +-
 .../mvcc/stage/delete/MarkCommitTest.java       |   6 +-
 .../mvcc/stage/delete/MarkStartTest.java        |   4 +-
 .../mvcc/stage/write/WriteCommitTest.java       |   4 +-
 .../stage/write/WriteOptimisticVerifyTest.java  |   4 +-
 .../mvcc/stage/write/WriteStartTest.java        |   4 +-
 .../mvcc/stage/write/WriteUniqueVerifyTest.java |   2 +-
 .../serialization/EntityRepairImplTest.java     |   2 +-
 .../impl/LogEntryIteratorTest.java              |   2 +-
 ...MvccEntitySerializationStrategyImplTest.java |   2 +-
 .../impl/MvccLESSTransientTest.java             |   7 +-
 ...ccLogEntrySerializationStrategyImplTest.java |  19 +--
 .../util/InvalidMvccEntityGenerator.java        |   2 +-
 .../util/InvalidValueGeneratorTest.java         |   2 +-
 .../collection/util/LogEntryMock.java           |   4 +-
 61 files changed, 622 insertions(+), 428 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
index 2625078..41d19e6 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
@@ -55,10 +55,9 @@ public interface EntityCollectionManager {
     public Observable<Entity> load( Id entityId );
 
     /**
-     * Return the latest version of the specified entity.
+     * Return the latest versions of the specified entityIds
      */
-    public Observable<UUID> getLatestVersion( Id entityId );
-    //TODO TN Change load to use multiget and return multiple entities.  Only supports loading 1k per load operation.
+    public Observable<VersionSet> getLatestVersion( Collection<Id> entityId );
 
     /**
      * Load all the entityIds into the observable entity set
@@ -68,9 +67,6 @@ public interface EntityCollectionManager {
     public Observable<EntitySet> load(Collection<Id> entityIds);
 
 
-    //TODO Dave add a load versions using a multiget that will return a latest version structure for a collection of entity Ids
-
-
     /**
      * Takes the change and reloads an entity with all changes applied in this entity applied.
      * The resulting entity from calling load will be the previous version of this entity + the entity

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntitySet.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntitySet.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntitySet.java
index 7803a04..1e811ae 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntitySet.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntitySet.java
@@ -18,8 +18,6 @@ package org.apache.usergrid.persistence.collection;/*
  */
 
 
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccEntity.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccEntity.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccEntity.java
new file mode 100644
index 0000000..813d1f3
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccEntity.java
@@ -0,0 +1,68 @@
+/*
+ * 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.collection;
+
+
+import org.apache.usergrid.persistence.core.entity.EntityVersion;
+import org.apache.usergrid.persistence.model.entity.Entity;
+
+import com.google.common.base.Optional;
+
+
+/**
+ * An entity with internal information for versioning
+ */
+public interface MvccEntity extends EntityVersion{
+
+    /**
+     * The possible State of the mvccEntity
+     */
+    public enum Status {
+
+        /**
+         * The entity being written represents a complete entity
+         */
+        COMPLETE,
+
+        /**
+         * The entity being written represents a partial entity
+         */
+        PARTIAL,
+
+        /**
+         * This entity has been marked as deleted
+         */
+        DELETED
+        ;
+    }
+
+
+    /**
+     * Get the entity for this context.
+     *
+     * @return This will return absent if no data is present.  Otherwise the entity will be contained within the
+     *         optional
+     */
+    Optional<Entity> getEntity();
+
+    /**
+     * Get the status of the entity
+     */
+    Status getStatus();
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccLogEntry.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccLogEntry.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccLogEntry.java
new file mode 100644
index 0000000..e518298
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/MvccLogEntry.java
@@ -0,0 +1,94 @@
+/*
+ * 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.collection;
+
+
+import java.util.UUID;
+
+import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+
+/**
+ * A Marker interface for an in flight update to allow context information to be passed between states
+ */
+public interface MvccLogEntry {
+
+
+    /**
+     * Get the stage for the current version
+     */
+    Stage getStage();
+
+    /**
+     * Get the entity to add info to the log
+     */
+    Id getEntityId();
+
+    /**
+     * Get the version of the entity
+     */
+    UUID getVersion();
+
+    /**
+     * Get the status of the entity
+     */
+    State getState();
+
+
+
+    /**
+     * The state of the entity.  Is it a complete entity, a partial entity, or a deleted?
+     */
+    public enum State {
+
+        /**
+         * The logentry being written represents a complete entity
+         */
+        COMPLETE(0),
+        /**
+         * The logentry being written represents a partial entity
+         */
+        PARTIAL(1),
+
+        /**
+         * This logentry has been marked as deleted
+         */
+        DELETED(2)
+        ;
+
+        private final int id;
+
+
+        private State( final int id ) {
+            this.id = id;
+        }
+
+
+        /**
+         * Returns true if this stage is transient and should not be retained in the datastore permanently Stages such as
+         * start and write don't need to be retained, but can be used to signal "in flight" updates
+         */
+
+
+        public int getId() {
+            return this.id;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/VersionSet.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/VersionSet.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/VersionSet.java
new file mode 100644
index 0000000..8ee9cdc
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/VersionSet.java
@@ -0,0 +1,67 @@
+/*
+ *
+ *  * 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.collection;/*
+ * 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.
+ */
+
+
+import org.apache.usergrid.persistence.model.entity.Id;
+
+
+/**
+ * Represents a set of entities
+ */
+public interface VersionSet {
+
+    /**
+     * Get the entity from the result set
+     * @param entityId
+     * @return
+     */
+    public MvccLogEntry getMaxVersion( Id entityId );
+
+    /**
+     * Get the number of entities in this set
+     * @return
+     */
+    public int size();
+
+    /**
+     * Return true if the set is empty
+     * @return
+     */
+    public boolean isEmpty();
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
index 82e1c76..416cb9f 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
@@ -18,7 +18,7 @@
 package org.apache.usergrid.persistence.collection.exception;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 
 public class CollectionRuntimeException extends RuntimeException {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteCommitException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteCommitException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteCommitException.java
index e09c086..b0b8b9c 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteCommitException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteCommitException.java
@@ -18,8 +18,8 @@
 package org.apache.usergrid.persistence.collection.exception;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+
 
 public class WriteCommitException extends CollectionRuntimeException {
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteOptimisticVerifyException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteOptimisticVerifyException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteOptimisticVerifyException.java
index a7df320..ca9c7aa 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteOptimisticVerifyException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteOptimisticVerifyException.java
@@ -18,8 +18,8 @@
 package org.apache.usergrid.persistence.collection.exception;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+
 
 public class WriteOptimisticVerifyException extends CollectionRuntimeException {
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteStartException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteStartException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteStartException.java
index 9cf5cb5..f8a90df 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteStartException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteStartException.java
@@ -18,8 +18,8 @@
 package org.apache.usergrid.persistence.collection.exception;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+
 
 public class WriteStartException extends CollectionRuntimeException {
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
index 7e7f05b..a20e090 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
@@ -21,7 +21,7 @@ package org.apache.usergrid.persistence.collection.exception;
 import java.util.Map;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.model.field.Field;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
index cb0087b..8015ca9 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
@@ -28,7 +28,7 @@ import org.apache.usergrid.persistence.collection.impl.EntityCollectionManagerSy
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.mvcc.changelog.ChangeLogGenerator;
 import org.apache.usergrid.persistence.collection.mvcc.changelog.ChangeLogGeneratorImpl;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.UniqueValueSerializationStrategyImpl;
 import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteStart;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
index 5fe2fbb..c47bf1a 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
@@ -21,6 +21,8 @@ package org.apache.usergrid.persistence.collection.impl;
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
+import java.util.UUID;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -28,17 +30,18 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
 import org.apache.usergrid.persistence.collection.EntitySet;
+import org.apache.usergrid.persistence.collection.VersionSet;
 import org.apache.usergrid.persistence.collection.guice.CollectionTaskExecutor;
 import org.apache.usergrid.persistence.collection.guice.Write;
 import org.apache.usergrid.persistence.collection.guice.WriteUpdate;
 import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccValidationUtils;
 import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
 import org.apache.usergrid.persistence.collection.mvcc.stage.delete.MarkCommit;
 import org.apache.usergrid.persistence.collection.mvcc.stage.delete.MarkStart;
-import org.apache.usergrid.persistence.collection.mvcc.stage.load.Load;
-import org.apache.usergrid.persistence.collection.mvcc.stage.load.GetVersion;
 import org.apache.usergrid.persistence.collection.mvcc.stage.write.RollbackAction;
 import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteCommit;
 import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteOptimisticVerify;
@@ -54,7 +57,6 @@ import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 import com.google.common.base.Preconditions;
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
-import java.util.UUID;
 
 import rx.Observable;
 import rx.functions.Action1;
@@ -66,7 +68,6 @@ import rx.schedulers.Schedulers;
  * Simple implementation.  Should perform  writes, delete and load.
  *
  * TODO: maybe refactor the stage operations into their own classes for clarity and organization?
- *
  */
 public class EntityCollectionManagerImpl implements EntityCollectionManager {
 
@@ -83,7 +84,6 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
     private final WriteOptimisticVerify writeOptimisticVerify;
     private final WriteCommit writeCommit;
     private final RollbackAction rollback;
-    private final GetVersion getVersion;
 
 
     //delete stages
@@ -92,8 +92,10 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
 
     private final TaskExecutor taskExecutor;
 
+    private final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy;
     private final MvccEntitySerializationStrategy entitySerializationStrategy;
 
+
     @Inject
     public EntityCollectionManagerImpl( final UUIDService uuidService, @Write final WriteStart writeStart,
                                         @WriteUpdate final WriteStart writeUpdate,
@@ -103,8 +105,8 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
                                         final MarkStart markStart, final MarkCommit markCommit,
                                         final MvccEntitySerializationStrategy entitySerializationStrategy,
                                         @CollectionTaskExecutor final TaskExecutor taskExecutor,
-                                        @Assisted final CollectionScope collectionScope
-                                         ) {
+                                        final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy,
+                                        @Assisted final CollectionScope collectionScope ) {
 
 
         Preconditions.checkNotNull( uuidService, "uuidService must be defined" );
@@ -118,14 +120,15 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
         this.writeCommit = writeCommit;
         this.rollback = rollback;
 
-        this.load = load;
+
         this.markStart = markStart;
         this.markCommit = markCommit;
-        this.getVersion = getVersion;
 
         this.uuidService = uuidService;
         this.collectionScope = collectionScope;
         this.taskExecutor = taskExecutor;
+        this.entitySerializationStrategy = entitySerializationStrategy;
+        this.mvccLogEntrySerializationStrategy = mvccLogEntrySerializationStrategy;
     }
 
 
@@ -133,8 +136,7 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
     public Observable<Entity> write( final Entity entity ) {
 
         //do our input validation
-        Preconditions.checkNotNull( entity, 
-            "Entity is required in the new stage of the mvcc write" );
+        Preconditions.checkNotNull( entity, "Entity is required in the new stage of the mvcc write" );
 
         final Id entityId = entity.getId();
 
@@ -144,7 +146,7 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
         // create our observable and start the write
         final CollectionIoEvent<Entity> writeData = new CollectionIoEvent<Entity>( collectionScope, entity );
 
-        Observable<CollectionIoEvent<MvccEntity>> observable = stageRunner( writeData,writeStart );
+        Observable<CollectionIoEvent<MvccEntity>> observable = stageRunner( writeData, writeStart );
 
         // execute all validation stages concurrently.  Needs refactored when this is done.  
         // https://github.com/Netflix/RxJava/issues/627
@@ -173,14 +175,13 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
         Preconditions.checkNotNull( entityId.getUuid(), "Entity id is required in this stage" );
         Preconditions.checkNotNull( entityId.getType(), "Entity type is required in this stage" );
 
-        return Observable.from( new CollectionIoEvent<Id>( collectionScope, entityId ) )
-                         .map( markStart ).doOnNext( markCommit ).map( new Func1<CollectionIoEvent<MvccEntity>,
-                        Void>() {
-                    @Override
-                    public Void call( final CollectionIoEvent<MvccEntity> mvccEntityCollectionIoEvent ) {
-                        return null;
-                    }
-                } );
+        return Observable.from( new CollectionIoEvent<Id>( collectionScope, entityId ) ).map( markStart )
+                         .doOnNext( markCommit ).map( new Func1<CollectionIoEvent<MvccEntity>, Void>() {
+                            @Override
+                            public Void call( final CollectionIoEvent<MvccEntity> mvccEntityCollectionIoEvent ) {
+                                return null;
+                            }
+                        } );
     }
 
 
@@ -191,12 +192,12 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
         Preconditions.checkNotNull( entityId.getUuid(), "Entity id uuid required in load stage" );
         Preconditions.checkNotNull( entityId.getType(), "Entity id type required in load stage" );
 
-        return load( Collections.singleton(entityId) ).map( new Func1<EntitySet, Entity>() {
+        return load( Collections.singleton( entityId ) ).map( new Func1<EntitySet, Entity>() {
             @Override
             public Entity call( final EntitySet entitySet ) {
                 final MvccEntity entity = entitySet.getEntity( entityId );
 
-                if(entity == null){
+                if ( entity == null ) {
                     return null;
                 }
 
@@ -211,8 +212,8 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
 
         Preconditions.checkNotNull( entityIds, "entityIds cannot be null" );
 
-        final EntitySet
-                results = entitySerializationStrategy.load( collectionScope, entityIds, UUIDGenerator.newTimeUUID() );
+        final EntitySet results =
+                entitySerializationStrategy.load( collectionScope, entityIds, UUIDGenerator.newTimeUUID() );
 
         return Observable.just( results );
     }
@@ -235,7 +236,7 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
         CollectionIoEvent<Entity> writeData = new CollectionIoEvent<Entity>( collectionScope, entity );
 
 
-        Observable<CollectionIoEvent<MvccEntity>> observable = stageRunner( writeData,writeUpdate );
+        Observable<CollectionIoEvent<MvccEntity>> observable = stageRunner( writeData, writeUpdate );
 
 
         return observable.map( writeCommit ).doOnNext( new Action1<Entity>() {
@@ -243,49 +244,53 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
             public void call( final Entity entity ) {
                 log.debug( "sending entity to the queue" );
 
-               //we an update, signal the fix
+                //we an update, signal the fix
 
                 //TODO T.N Change this to fire a task
-//                Observable.from( new CollectionIoEvent<Id>(collectionScope, entityId ) ).map( load ).subscribeOn( Schedulers.io() ).subscribe();
+                //                Observable.from( new CollectionIoEvent<Id>(collectionScope,
+                // entityId ) ).map( load ).subscribeOn( Schedulers.io() ).subscribe();
 
 
             }
         } ).doOnError( rollback );
     }
 
+
     // fire the stages
-    public Observable<CollectionIoEvent<MvccEntity>> stageRunner( CollectionIoEvent<Entity> writeData, WriteStart writeState ) {
+    public Observable<CollectionIoEvent<MvccEntity>> stageRunner( CollectionIoEvent<Entity> writeData,
+                                                                  WriteStart writeState ) {
 
         return Observable.from( writeData ).map( writeState ).doOnNext( new Action1<CollectionIoEvent<MvccEntity>>() {
 
-                    @Override
-                    public void call(
-                            final CollectionIoEvent<MvccEntity> mvccEntityCollectionIoEvent ) {
-
-                        Observable<CollectionIoEvent<MvccEntity>> unique =
-                                Observable.from( mvccEntityCollectionIoEvent ).subscribeOn( Schedulers.io() )
-                                          .doOnNext( writeVerifyUnique );
-
+            @Override
+            public void call( final CollectionIoEvent<MvccEntity> mvccEntityCollectionIoEvent ) {
 
-                        // optimistic verification
-                        Observable<CollectionIoEvent<MvccEntity>> optimistic =
-                                Observable.from( mvccEntityCollectionIoEvent ).subscribeOn( Schedulers.io() )
-                                          .doOnNext( writeOptimisticVerify );
+                Observable<CollectionIoEvent<MvccEntity>> unique =
+                        Observable.from( mvccEntityCollectionIoEvent ).subscribeOn( Schedulers.io() )
+                                  .doOnNext( writeVerifyUnique );
 
 
-                        //wait for both to finish
-                        Observable.merge( unique, optimistic ).toBlocking().last();
+                // optimistic verification
+                Observable<CollectionIoEvent<MvccEntity>> optimistic =
+                        Observable.from( mvccEntityCollectionIoEvent ).subscribeOn( Schedulers.io() )
+                                  .doOnNext( writeOptimisticVerify );
 
 
-                    }
-                } );
+                //wait for both to finish
+                Observable.merge( unique, optimistic ).toBlocking().last();
+            }
+        } );
     }
 
 
     @Override
-    public Observable<UUID> getLatestVersion(Id entityId) {
-        return Observable.from( 
-                new CollectionIoEvent<Id>( collectionScope, entityId ) ).map(getVersion);
-    }
+    public Observable<VersionSet> getLatestVersion(
+            Collection<Id> entityIds ) {
+
+        VersionSet logEntries = mvccLogEntrySerializationStrategy.load( collectionScope, entityIds,
+                UUIDGenerator.newTimeUUID() );
 
+
+        return Observable.just(logEntries);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/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 2d30d36..422a155 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
@@ -12,7 +12,7 @@ import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.event.EntityVersionDeleted;
 import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.collection.serialization.impl.LogEntryIterator;
 import org.apache.usergrid.persistence.core.rx.ObservableIterator;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
index 0467c95..b9277eb 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
@@ -21,12 +21,11 @@ package org.apache.usergrid.persistence.collection.mvcc;
 
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.List;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntitySet;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.netflix.astyanax.MutationBatch;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
index 2d218c1..927a60c 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
@@ -19,15 +19,16 @@
 package org.apache.usergrid.persistence.collection.mvcc;
 
 
+import java.util.Collection;
 import java.util.List;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.VersionSet;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.netflix.astyanax.MutationBatch;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 
 /**
@@ -48,13 +49,12 @@ public interface MvccLogEntrySerializationStrategy {
      * Load and return the stage with the given id and a version that is <= the version provided
      *
      * @param context The context to persist the entity into
-     * @param entityId The entity id to load
-     * @param version The version to load.  This will return the version == the given version
+     * @param entityIds The entity id to load
+     * @param version The max version to load.  This will return the first version <= the given version
      *
-     * @return The deserialized version of the log entry.  Null if no version == the current version exists
+     * @return The deserialized version of the log entry
      */
-    public MvccLogEntry load( final CollectionScope context, final Id entityId, final UUID version )
-            throws ConnectionException;
+    public VersionSet load( final CollectionScope context, final Collection<Id> entityIds, final UUID version );
 
     /**
      * Load a list, from highest to lowest of the stage with versions <= version up to maxSize elements
@@ -66,8 +66,7 @@ public interface MvccLogEntrySerializationStrategy {
      *
      * @return A list of entities up to max size ordered from max(UUID)=> min(UUID)
      */
-    public List<MvccLogEntry> load( CollectionScope context, Id entityId, UUID version, int maxSize )
-            throws ConnectionException;
+    public List<MvccLogEntry> load( CollectionScope context, Id entityId, UUID version, int maxSize );
 
     /**
      * MarkCommit the stage from the context with the given entityId and version

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGenerator.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGenerator.java
index 68cbd58..8171f10 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGenerator.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGenerator.java
@@ -19,11 +19,8 @@ package org.apache.usergrid.persistence.collection.mvcc.changelog;
 
 
 import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
 
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 /**
  * This change log generator takes one or more entity versions and generates the change-log. 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImpl.java
index 014d249..eb4d019 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImpl.java
@@ -24,7 +24,7 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.field.Field;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java
deleted file mode 100644
index c9fb99f..0000000
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java
+++ /dev/null
@@ -1,68 +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.collection.mvcc.entity;
-
-
-import org.apache.usergrid.persistence.core.entity.EntityVersion;
-import org.apache.usergrid.persistence.model.entity.Entity;
-
-import com.google.common.base.Optional;
-
-
-/**
- * An entity with internal information for versioning
- */
-public interface MvccEntity extends EntityVersion{
-
-    /**
-     * The possible State of the mvccEntity
-     */
-    public enum Status {
-
-        /**
-         * The entity being written represents a complete entity
-         */
-        COMPLETE,
-
-        /**
-         * The entity being written represents a partial entity
-         */
-        PARTIAL,
-
-        /**
-         * This entity has been marked as deleted
-         */
-        DELETED
-        ;
-    }
-
-
-    /**
-     * Get the entity for this context.
-     *
-     * @return This will return absent if no data is present.  Otherwise the entity will be contained within the
-     *         optional
-     */
-    Optional<Entity> getEntity();
-
-    /**
-     * Get the status of the entity
-     */
-    Status getStatus();
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java
deleted file mode 100644
index b45c1fb..0000000
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java
+++ /dev/null
@@ -1,93 +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.collection.mvcc.entity;
-
-
-import java.util.UUID;
-
-import org.apache.usergrid.persistence.model.entity.Id;
-
-
-/**
- * A Marker interface for an in flight update to allow context information to be passed between states
- */
-public interface MvccLogEntry {
-
-
-    /**
-     * Get the stage for the current version
-     */
-    Stage getStage();
-
-    /**
-     * Get the entity to add info to the log
-     */
-    Id getEntityId();
-
-    /**
-     * Get the version of the entity
-     */
-    UUID getVersion();
-
-    /**
-     * Get the status of the entity
-     */
-    State getState();
-
-
-
-    /**
-     * The state of the entity.  Is it a complete entity, a partial entity, or a deleted?
-     */
-    public enum State {
-
-        /**
-         * The logentry being written represents a complete entity
-         */
-        COMPLETE(0),
-        /**
-         * The logentry being written represents a partial entity
-         */
-        PARTIAL(1),
-
-        /**
-         * This logentry has been marked as deleted
-         */
-        DELETED(2)
-        ;
-
-        private final int id;
-
-
-        private State( final int id ) {
-            this.id = id;
-        }
-
-
-        /**
-         * Returns true if this stage is transient and should not be retained in the datastore permanently Stages such as
-         * start and write don't need to be retained, but can be used to signal "in flight" updates
-         */
-
-
-        public int getId() {
-            return this.id;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccValidationUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccValidationUtils.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccValidationUtils.java
index f40572a..1f0c91b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccValidationUtils.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccValidationUtils.java
@@ -20,6 +20,7 @@ package org.apache.usergrid.persistence.collection.mvcc.entity;
 
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 import com.google.common.base.Preconditions;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityDeleteEvent.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityDeleteEvent.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityDeleteEvent.java
index 561b345..1f8fc24 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityDeleteEvent.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityDeleteEvent.java
@@ -22,7 +22,7 @@ package org.apache.usergrid.persistence.collection.mvcc.entity.impl;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityEvent.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityEvent.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityEvent.java
index 3b18e5b..f9f1389 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityEvent.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityEvent.java
@@ -19,7 +19,7 @@
 package org.apache.usergrid.persistence.collection.mvcc.entity.impl;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 import java.io.Serializable;
 import java.util.UUID;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
index 8f29ac0..399d4f6 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
@@ -21,7 +21,7 @@ package org.apache.usergrid.persistence.collection.mvcc.entity.impl;
 
 import java.util.UUID;
 
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityWriteEvent.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityWriteEvent.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityWriteEvent.java
index 1b7bae1..84cfd18 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityWriteEvent.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityWriteEvent.java
@@ -22,8 +22,7 @@ package org.apache.usergrid.persistence.collection.mvcc.entity.impl;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
index a50eeac..3d59ebd 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
@@ -21,7 +21,7 @@ package org.apache.usergrid.persistence.collection.mvcc.entity.impl;
 
 import java.util.UUID;
 
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.model.entity.Id;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/EntityUpdateEvent.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/EntityUpdateEvent.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/EntityUpdateEvent.java
index c70245a..3951226 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/EntityUpdateEvent.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/EntityUpdateEvent.java
@@ -20,7 +20,6 @@ package org.apache.usergrid.persistence.collection.mvcc.stage;
 
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
index 1e01c02..9e2d52c 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
@@ -29,8 +29,8 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccValidationUtils;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccLogEntryImpl;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
index 2529997..c80b076 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
@@ -27,8 +27,8 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.exception.CollectionRuntimeException;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccLogEntryImpl;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
index 8561708..e1becf8 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
@@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.exception.CollectionRuntimeException;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 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;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/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 82ef74c..ba638a5 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
@@ -27,8 +27,8 @@ import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.exception.WriteCommitException;
 import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccValidationUtils;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccLogEntryImpl;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
index dcdb408..b031237 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
@@ -24,11 +24,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.exception.CollectionRuntimeException;
 import org.apache.usergrid.persistence.collection.exception.WriteOptimisticVerifyException;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccValidationUtils;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
@@ -36,23 +35,21 @@ import org.apache.usergrid.persistence.model.entity.Entity;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import rx.functions.Action1;
-import rx.functions.Func1;
 
 
 /**
  * This phase should execute any optimistic verification on the MvccEntity
  */
 @Singleton
-public class WriteOptimisticVerify 
-    implements Action1<CollectionIoEvent<MvccEntity>> {
+public class WriteOptimisticVerify implements Action1<CollectionIoEvent<MvccEntity>> {
 
     private static final Logger log = LoggerFactory.getLogger( WriteOptimisticVerify.class );
 
     private final MvccLogEntrySerializationStrategy logEntryStrat;
 
+
     @Inject
     public WriteOptimisticVerify( MvccLogEntrySerializationStrategy logEntryStrat ) {
         this.logEntryStrat = logEntryStrat;
@@ -74,32 +71,21 @@ public class WriteOptimisticVerify
 
         CollectionScope collectionScope = ioevent.getEntityCollection();
 
-        if(entity.getVersion() == null){
+        if ( entity.getVersion() == null ) {
             return;
         }
 
-        try {
-            List<MvccLogEntry> versions = logEntryStrat.load( 
-                collectionScope, entity.getId(), entity.getVersion(), 2 );
-
-            // Previous log entry must be committed, otherwise somebody is already writing
-            if ( versions.size() > 1 
-                    && versions.get(1).getStage().ordinal() < Stage.COMMITTED.ordinal() ) {
-
-                log.debug("Conflict writing entity id {} version {}", 
-                    entity.getId().toString(), entity.getVersion().toString());
-            
-                throw new WriteOptimisticVerifyException( mvccEntity, collectionScope,
-                    "Change conflict, not first writer");
-            }
-
-        } catch ( ConnectionException e ) {
-            log.error( "Error reading entity log", e );
-            throw new CollectionRuntimeException( mvccEntity, collectionScope,
-                "Error reading entity log", e );
-        }
 
+        List<MvccLogEntry> versions = logEntryStrat.load( collectionScope, entity.getId(), entity.getVersion(), 2 );
 
-    }
+        // Previous log entry must be committed, otherwise somebody is already writing
+        if ( versions.size() > 1 && versions.get( 1 ).getStage().ordinal() < Stage.COMMITTED.ordinal() ) {
 
+            log.debug( "Conflict writing entity id {} version {}", entity.getId().toString(),
+                    entity.getVersion().toString() );
+
+            throw new WriteOptimisticVerifyException( mvccEntity, collectionScope,
+                    "Change conflict, not first writer" );
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
index e2bad71..0056f46 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
@@ -9,13 +9,12 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.exception.WriteStartException;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccLogEntryImpl;
 import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/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 6ca3445..162bcac 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
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.exception.WriteUniqueVerifyException;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccValidationUtils;
 import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/EntityRepair.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/EntityRepair.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/EntityRepair.java
index c4fddd2..b2be289 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/EntityRepair.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/EntityRepair.java
@@ -19,7 +19,7 @@ package org.apache.usergrid.persistence.collection.serialization;/*
 
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/OptimisticUpdate.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/OptimisticUpdate.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/OptimisticUpdate.java
index 36b9527..40bde16 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/OptimisticUpdate.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/OptimisticUpdate.java
@@ -3,7 +3,7 @@ package org.apache.usergrid.persistence.collection.serialization;
 
 import java.util.UUID;
 
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntityRepairImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntityRepairImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntityRepairImpl.java
index 62f4915..a94c688 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntityRepairImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntityRepairImpl.java
@@ -28,7 +28,7 @@ import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationSt
 import org.apache.usergrid.persistence.collection.mvcc.changelog.ChangeLog;
 import org.apache.usergrid.persistence.collection.mvcc.changelog.ChangeLogGenerator;
 import org.apache.usergrid.persistence.collection.mvcc.changelog.ChangeLogGeneratorImpl;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.serialization.EntityRepair;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.model.entity.Entity;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntitySetImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntitySetImpl.java
index 9e03754..921093b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntitySetImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/EntitySetImpl.java
@@ -22,8 +22,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.usergrid.persistence.collection.EntitySet;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIterator.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIterator.java
index d87f850..2b99033 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIterator.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIterator.java
@@ -8,7 +8,7 @@ import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7af7e702/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 5449e46..8f51cbc 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
@@ -38,7 +38,7 @@ import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntitySet;
 import org.apache.usergrid.persistence.collection.exception.CollectionRuntimeException;
 import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.EntityRepair;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
@@ -63,7 +63,6 @@ import com.netflix.astyanax.ColumnListMutation;
 import com.netflix.astyanax.Keyspace;
 import com.netflix.astyanax.MutationBatch;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
-import com.netflix.astyanax.connectionpool.exceptions.NotFoundException;
 import com.netflix.astyanax.model.Column;
 import com.netflix.astyanax.model.ColumnList;
 import com.netflix.astyanax.model.CompositeBuilder;