usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject incubator-usergrid git commit: WIP overwrite
Date Wed, 04 Mar 2015 00:34:24 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-405 7925a4b83 -> d000e7776


WIP overwrite


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

Branch: refs/heads/USERGRID-405
Commit: d000e77762e9f45f9a30ae6cd145813fdd16fbc8
Parents: 7925a4b
Author: Todd Nine <tnine@apigee.com>
Authored: Tue Mar 3 17:34:21 2015 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Tue Mar 3 17:34:21 2015 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/CoreModule.java    | 58 +++++++++----
 .../corepersistence/CpEntityManagerFactory.java | 47 +++++-----
 .../events/EntityVersionDeletedHandler.java     | 17 ++--
 .../migration/CoreDataVersions.java             | 44 ++++++++++
 .../migration/CoreMigrationPlugin.java          | 59 +++++++++++++
 .../migration/EntityTypeMappingMigration.java   | 90 ++++++++++----------
 .../migration/MigrationModuleVersion.java       | 84 ++++++++++++++++++
 .../corepersistence/migration/Versions.java     |  7 +-
 .../impl/AllEntitiesInSystemObservableImpl.java | 78 ++++++-----------
 .../rx/impl/ApplicationObservableImpl.java      | 80 ++++++++---------
 .../persistence/collection/MvccLogEntry.java    |  1 +
 .../collection/guice/CollectionModule.java      | 31 ++-----
 .../persistence/collection/guice/Write.java     | 17 ----
 .../collection/guice/WriteUpdate.java           | 17 ----
 .../EntityCollectionManagerFactoryImpl.java     |  9 +-
 .../impl/EntityCollectionManagerImpl.java       | 21 ++---
 .../collection/mvcc/stage/write/WriteStart.java |  6 +-
 .../mvcc/stage/write/WriteStartTest.java        |  6 +-
 18 files changed, 398 insertions(+), 274 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
index d7d7f2f..34e0493 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CoreModule.java
@@ -15,14 +15,14 @@
  */
 package org.apache.usergrid.corepersistence;
 
-import com.google.inject.AbstractModule;
-import com.google.inject.Provider;
-import com.google.inject.multibindings.Multibinder;
 
-import org.apache.usergrid.corepersistence.migration.EntityTypeMappingMigration;
+import org.springframework.context.ApplicationContext;
+
 import org.apache.usergrid.corepersistence.events.EntityDeletedHandler;
 import org.apache.usergrid.corepersistence.events.EntityVersionCreatedHandler;
 import org.apache.usergrid.corepersistence.events.EntityVersionDeletedHandler;
+import org.apache.usergrid.corepersistence.migration.CoreMigrationPlugin;
+import org.apache.usergrid.corepersistence.migration.EntityTypeMappingMigration;
 import org.apache.usergrid.corepersistence.rx.impl.AllEntitiesInSystemObservableImpl;
 import org.apache.usergrid.corepersistence.rx.impl.ApplicationObservableImpl;
 import org.apache.usergrid.persistence.EntityManagerFactory;
@@ -30,18 +30,21 @@ import org.apache.usergrid.persistence.collection.event.EntityDeleted;
 import org.apache.usergrid.persistence.collection.event.EntityVersionCreated;
 import org.apache.usergrid.persistence.collection.event.EntityVersionDeleted;
 import org.apache.usergrid.persistence.collection.guice.CollectionModule;
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.CollectionMigrationPlugin;
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
 import org.apache.usergrid.persistence.core.guice.CommonModule;
-import org.apache.usergrid.persistence.core.migration.data.CollectionDataMigration;
-import org.apache.usergrid.persistence.core.migration.data.DataMigration;
-import org.apache.usergrid.persistence.core.rx.AllEntitiesInSystemObservable;
-import org.apache.usergrid.persistence.core.rx.ApplicationObservable;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationPlugin;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.guice.GraphModule;
 import org.apache.usergrid.persistence.index.guice.IndexModule;
 import org.apache.usergrid.persistence.map.guice.MapModule;
 import org.apache.usergrid.persistence.queue.guice.QueueModule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provider;
+import com.google.inject.TypeLiteral;
+import com.google.inject.multibindings.Multibinder;
 
 
 /**
@@ -70,19 +73,38 @@ public class CoreModule  extends AbstractModule {
         bind(EntityManagerFactory.class).toProvider( lazyEntityManagerFactoryProvider );
 
         install( new CommonModule());
-        install(new CollectionModule());
-        install(new GraphModule());
+        install( new CollectionModule() {
+            /**
+             * configure our migration data provider for all entities in the system
+             */
+            @Override
+           public void configureMigrationProvider() {
+
+                bind(new TypeLiteral< MigrationDataProvider<EntityIdScope>>(){}).to(
+                    AllEntitiesInSystemObservableImpl.class );
+           }
+        } );
+        install( new GraphModule() {
+
+            /**
+             * Override the observable that needs to be used for migration
+             */
+            @Override
+            public void configureMigrationProvider() {
+                bind( new TypeLiteral<MigrationDataProvider<ApplicationScope>>() {} ).to(
+                    ApplicationObservableImpl.class );
+            }
+        } );
         install(new IndexModule());
         install(new MapModule());
         install(new QueueModule());
 
         bind(ManagerCache.class).to( CpManagerCache.class );
-        bind(AllEntitiesInSystemObservable.class).to( AllEntitiesInSystemObservableImpl.class );
-        bind(ApplicationObservable.class).to( ApplicationObservableImpl.class );
 
-        Multibinder<DataMigration> dataMigrationMultibinder =
-                Multibinder.newSetBinder( binder(), DataMigration.class );
-        dataMigrationMultibinder.addBinding().to( EntityTypeMappingMigration.class );
+
+        //wire up the collection migration plugin
+        Multibinder.newSetBinder( binder(), MigrationPlugin.class ).addBinding().to( CoreMigrationPlugin.class );
+
 
         Multibinder<EntityDeleted> entityBinder =
             Multibinder.newSetBinder(binder(), EntityDeleted.class);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 61f32c5..c3019ea 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -15,12 +15,6 @@
  */
 package org.apache.usergrid.corepersistence;
 
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.inject.Injector;
-import com.yammer.metrics.annotation.Metered;
-import static java.lang.String.CASE_INSENSITIVE_ORDER;
 
 import java.util.Arrays;
 import java.util.HashMap;
@@ -33,6 +27,12 @@ import java.util.TreeMap;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
 import org.apache.commons.lang.StringUtils;
 
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
@@ -43,16 +43,15 @@ import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 import org.apache.usergrid.persistence.EntityRef;
 import org.apache.usergrid.persistence.Results;
-import static org.apache.usergrid.persistence.Schema.PROPERTY_NAME;
-import static org.apache.usergrid.persistence.Schema.TYPE_APPLICATION;
 import org.apache.usergrid.persistence.cassandra.CassandraService;
 import org.apache.usergrid.persistence.cassandra.CounterUtils;
 import org.apache.usergrid.persistence.cassandra.Setup;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
 import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
-import org.apache.usergrid.persistence.core.rx.AllEntitiesInSystemObservable;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.util.Health;
@@ -68,15 +67,24 @@ import org.apache.usergrid.persistence.index.EntityIndex;
 import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.utils.UUIDUtils;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
+import org.apache.usergrid.utils.UUIDUtils;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.TypeLiteral;
+import com.yammer.metrics.annotation.Metered;
+
 import rx.Observable;
 
+import static java.lang.String.CASE_INSENSITIVE_ORDER;
+
+import static org.apache.usergrid.persistence.Schema.PROPERTY_NAME;
+import static org.apache.usergrid.persistence.Schema.TYPE_APPLICATION;
+
 
 /**
  * Implement good-old Usergrid EntityManagerFactory with the new-fangled Core Persistence API.
@@ -107,7 +115,6 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
     private ManagerCache managerCache;
 
-    private AllEntitiesInSystemObservable allEntitiesInSystemObservable;
 
     private DataMigrationManager dataMigrationManager;
 
@@ -171,10 +178,8 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
         return managerCache;
     }
 
-    private AllEntitiesInSystemObservable getAllEntitiesObservable(){
-        if(allEntitiesInSystemObservable==null)
-            allEntitiesInSystemObservable = injector.getInstance(AllEntitiesInSystemObservable.class);
-        return allEntitiesInSystemObservable;
+    private Observable<EntityIdScope> getAllEntitiesObservable(){
+      return injector.getInstance( Key.get(new TypeLiteral< MigrationDataProvider<EntityIdScope>>(){})).getData();
     }
 
 
@@ -601,7 +606,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
     public long performEntityCount() {
         //TODO, this really needs to be a task that writes this data somewhere since this will get
         //progressively slower as the system expands
-        return (Long) getAllEntitiesObservable().getAllEntitiesInSystem(1000).longCount().toBlocking().last();
+        return (Long) getAllEntitiesObservable().longCount().toBlocking().last();
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
index 127ae46..65dacee 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
@@ -24,6 +24,7 @@ import static org.apache.usergrid.corepersistence.CoreModule.EVENTS_DISABLED;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.event.EntityVersionDeleted;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.index.EntityIndex;
@@ -53,9 +54,11 @@ public class EntityVersionDeletedHandler implements EntityVersionDeleted {
     private EntityManagerFactory emf;
 
 
+
     @Override
-    public void versionDeleted(
-            final CollectionScope scope, final Id entityId, final List<MvccEntity> entityVersions) {
+    public void versionDeleted( final CollectionScope scope, final Id entityId,
+                                final List<MvccLogEntry> entityVersions ) {
+
 
         // This check is for testing purposes and for a test that to be able to dynamically turn
         // off and on delete previous versions so that it can test clean-up on read.
@@ -84,13 +87,12 @@ public class EntityVersionDeletedHandler implements EntityVersionDeleted {
                 scope.getName()
         );
 
-        rx.Observable.from(entityVersions)
-            .subscribeOn(Schedulers.io())
+        rx.Observable.from( entityVersions )
             .buffer(serializationFig.getBufferSize())
-            .map(new Func1<List<MvccEntity>, List<MvccEntity>>() {
+            .map(new Func1<List<MvccLogEntry>, List<MvccLogEntry>>() {
                 @Override
-                public List<MvccEntity> call(List<MvccEntity> entityList) {
-                    for (MvccEntity entity : entityList) {
+                public List<MvccLogEntry> call(List<MvccLogEntry> entityList) {
+                    for (MvccLogEntry entity : entityList) {
                         eibatch.deindex(indexScope, entityId, entity.getVersion());
                     }
                     eibatch.execute();
@@ -99,4 +101,5 @@ public class EntityVersionDeletedHandler implements EntityVersionDeleted {
             }).toBlocking().last();
     }
 
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreDataVersions.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreDataVersions.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreDataVersions.java
new file mode 100644
index 0000000..58ba6a3
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreDataVersions.java
@@ -0,0 +1,44 @@
+/*
+ * 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.corepersistence.migration;
+
+
+/**
+ * Versions of data as they exist across our system
+ */
+public enum CoreDataVersions {
+     //even though this didn't really come first in time, we need to run this first in order to bring our system
+    //up to date so that our new migration module can proceed.
+
+    INITIAL(0),
+    MIGRATION_VERSION_FIX(1),
+    ID_MAP_FIX(2);
+
+
+    private final int version;
+
+
+    private CoreDataVersions( final int version ) {this.version = version;}
+
+
+    public int getVersion() {
+        return version;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigrationPlugin.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigrationPlugin.java
new file mode 100644
index 0000000..b95900f
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigrationPlugin.java
@@ -0,0 +1,59 @@
+/*
+ * 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.corepersistence.migration;
+
+
+import java.util.Set;
+
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
+import org.apache.usergrid.persistence.core.migration.data.MigrationInfoSerialization;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.AbstractMigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.DataMigration2;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+
+/**
+ * Migration plugin for the collection module
+ */
+@Singleton
+public class CoreMigrationPlugin extends AbstractMigrationPlugin<EntityIdScope> {
+
+    public static final String PLUGIN_NAME = "core-data";
+
+
+
+    @Inject
+    public CoreMigrationPlugin( final Set<DataMigration2<EntityIdScope>> entityDataMigrations,
+                                final MigrationDataProvider<EntityIdScope> entityIdScopeDataMigrationProvider,
+                                final MigrationInfoSerialization migrationInfoSerialization ) {
+        super( entityDataMigrations, entityIdScopeDataMigrationProvider, migrationInfoSerialization );
+    }
+
+
+    @Override
+    public String getName() {
+        return PLUGIN_NAME;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigration.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigration.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigration.java
index 4dbc373..80d7ebe 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigration.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigration.java
@@ -23,88 +23,88 @@ package org.apache.usergrid.corepersistence.migration;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicLong;
 
-
 import org.apache.usergrid.corepersistence.ManagerCache;
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
-import org.apache.usergrid.persistence.core.migration.data.CollectionDataMigration;
-import org.apache.usergrid.persistence.core.scope.ApplicationEntityGroup;
-import org.apache.usergrid.persistence.core.migration.data.DataMigration;
-import org.apache.usergrid.persistence.core.rx.AllEntitiesInSystemObservable;
-import org.apache.usergrid.persistence.core.scope.EntityIdScope;
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.DataMigration2;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.ProgressObserver;
 import org.apache.usergrid.persistence.map.MapManager;
 import org.apache.usergrid.persistence.map.MapScope;
-import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.inject.Inject;
 
 import rx.Observable;
-import rx.Scheduler;
 import rx.functions.Action1;
 import rx.functions.Func1;
-import rx.schedulers.Schedulers;
 
 
 /**
  * Migration to ensure that our entity id is written into our map data
  */
-public class EntityTypeMappingMigration implements CollectionDataMigration {
+public class EntityTypeMappingMigration implements DataMigration2<EntityIdScope> {
 
     private final ManagerCache managerCache;
-    private final AllEntitiesInSystemObservable allEntitiesInSystemObservable;
+    private final MigrationDataProvider<EntityIdScope> allEntitiesInSystemObservable;
 
 
     @Inject
-    public EntityTypeMappingMigration( final ManagerCache managerCache, final AllEntitiesInSystemObservable allEntitiesInSystemObservable) {
-       this.managerCache = managerCache;
+    public EntityTypeMappingMigration( final ManagerCache managerCache,
+                                       final MigrationDataProvider<EntityIdScope> allEntitiesInSystemObservable ) {
+        this.managerCache = managerCache;
         this.allEntitiesInSystemObservable = allEntitiesInSystemObservable;
     }
 
 
     @Override
-    public Observable migrate(final Observable<ApplicationEntityGroup> applicationEntityGroupObservable, final ProgressObserver observer) throws Throwable {
+    public int migrate( final int currentVersion, final MigrationDataProvider<EntityIdScope> migrationDataProvider,
+                        final ProgressObserver observer ) {
 
         final AtomicLong atomicLong = new AtomicLong();
 
-        return applicationEntityGroupObservable.flatMap(new Func1<ApplicationEntityGroup, Observable<Long>>() {
-            @Override
-            public Observable call(final ApplicationEntityGroup applicationEntityGroup) {
-                final MapScope ms = CpNamingUtils.getEntityTypeMapScope(applicationEntityGroup.applicationScope.getApplication());
-
-                final MapManager mapManager = managerCache.getMapManager(ms);
-                return Observable.from(applicationEntityGroup.entityIds)
-                    .subscribeOn(Schedulers.io())
-                    .map(new Func1<EntityIdScope, Long>() {
-                        @Override
-                        public Long call(EntityIdScope idScope) {
-                            final UUID entityUuid = idScope.getId().getUuid();
-                            final String entityType = idScope.getId().getType();
-
-                            mapManager.putString(entityUuid.toString(), entityType);
-
-                            if (atomicLong.incrementAndGet() % 100 == 0) {
-                                updateStatus(atomicLong, observer);
-                            }
-                            return atomicLong.get();
-                        }
-                    });
-            }
-        });
-    }
 
+        return allEntitiesInSystemObservable.getData()
+                                            //process the entities in parallel
+         .parallel( new Func1<Observable<EntityIdScope>, Observable<EntityIdScope>>() {
+
+
+                 @Override
+                 public Observable<EntityIdScope> call( final Observable<EntityIdScope> entityIdScopeObservable ) {
 
-    private void updateStatus( final AtomicLong counter, final ProgressObserver observer ) {
+                     //for each entity observable, get the map scope and write it to the map
+                     return entityIdScopeObservable.doOnNext( new Action1<EntityIdScope>() {
+                         @Override
+                         public void call( final EntityIdScope entityIdScope ) {
+                             final MapScope ms = CpNamingUtils
+                                 .getEntityTypeMapScope( entityIdScope.getCollectionScope().getApplication() );
 
-        observer.update( getVersion(), String.format( "Updated %d entities", counter.get() ) );
+                             final MapManager mapManager = managerCache.getMapManager( ms );
+
+                             final UUID entityUuid = entityIdScope.getId().getUuid();
+                             final String entityType = entityIdScope.getId().getType();
+
+                             mapManager.putString( entityUuid.toString(), entityType );
+
+                             if ( atomicLong.incrementAndGet() % 100 == 0 ) {
+                                 observer.update( getMaxVersion(),
+                                     String.format( "Updated %d entities", atomicLong.get() ) );
+                             }
+                         }
+                     } );
+                 }
+             } ).count().toBlocking().last();
     }
 
 
     @Override
-    public int getVersion() {
-        return Versions.VERSION_1;
+    public boolean supports( final int currentVersion ) {
+        //we move from the migration version fix to the current version
+        return CoreDataVersions.MIGRATION_VERSION_FIX.getVersion() == currentVersion;
     }
 
+
     @Override
-    public MigrationType getType() {
-        return MigrationType.Entities;
+    public int getMaxVersion() {
+        return CoreDataVersions.ID_MAP_FIX.getVersion();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/MigrationModuleVersion.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/MigrationModuleVersion.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/MigrationModuleVersion.java
new file mode 100644
index 0000000..5808e3c
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/MigrationModuleVersion.java
@@ -0,0 +1,84 @@
+/*
+ * 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.corepersistence.migration;
+
+
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
+import org.apache.usergrid.persistence.core.migration.data.MigrationInfoSerialization;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.DataMigration2;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.ProgressObserver;
+
+import com.google.inject.Inject;
+
+
+/**
+ * Migration to set our module versions now that we've refactor for sub modules Keeps the EntityIdScope because it won't
+ * subscribe to the data provider.
+ */
+public class MigrationModuleVersion implements DataMigration2<EntityIdScope> {
+
+    private static final int ID_MIGRATION = 1;
+    private static final int EDGE_SHARD_MIGRATION = 2;
+    private static final int ENTITY_V2_MIGRATION = 3;
+
+    private final MigrationInfoSerialization migrationInfoSerialization;
+
+
+    @Inject
+    public MigrationModuleVersion( final MigrationInfoSerialization migrationInfoSerialization ) {
+        this.migrationInfoSerialization = migrationInfoSerialization;
+    }
+
+
+    @Override
+    public int migrate( final int currentVersion, final MigrationDataProvider<EntityIdScope> migrationDataProvider,
+                        final ProgressObserver observer ) {
+
+        //we ignore our current version, since it will always be 0
+        final int legacyVersion = migrationInfoSerialization.getSystemVersion();
+
+        //now we store versions for each of our modules
+
+        switch ( legacyVersion ) {
+            case ID_MIGRATION:
+                break;
+            case EDGE_SHARD_MIGRATION:
+                break;
+            case ENTITY_V2_MIGRATION:
+                break;
+        }
+
+        return CoreDataVersions.MIGRATION_VERSION_FIX.getVersion();
+    }
+
+
+    @Override
+    public boolean supports( final int currentVersion ) {
+        //we move from the migration version fix to the current version
+        return CoreDataVersions.INITIAL.getVersion() == currentVersion;
+    }
+
+
+    @Override
+    public int getMaxVersion() {
+        return CoreDataVersions.MIGRATION_VERSION_FIX.getVersion();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/Versions.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/Versions.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/Versions.java
index 7d05733..67610e9 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/Versions.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/Versions.java
@@ -22,11 +22,6 @@
 package org.apache.usergrid.corepersistence.migration;
 
 
-import org.apache.usergrid.persistence.core.guice.V2Impl;
-import org.apache.usergrid.persistence.core.guice.V3Impl;
-import org.apache.usergrid.persistence.graph.serialization.EdgeMigrationStrategy;
-
-
 /**
  * Simple class to hold the constants of all versions
  */
@@ -50,6 +45,6 @@ public class Versions {
     /**
      * Version 4. migrate from entity serialization 1 -> 2
      */
-    public static final int VERSION_4 = V3Impl.MIGRATION_VERSION;
+//    public static final int VERSION_4 = V3Impl.MIGRATION_VERSION;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AllEntitiesInSystemObservableImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AllEntitiesInSystemObservableImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AllEntitiesInSystemObservableImpl.java
index 55667cb..375b53c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AllEntitiesInSystemObservableImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AllEntitiesInSystemObservableImpl.java
@@ -20,23 +20,18 @@
 package org.apache.usergrid.corepersistence.rx.impl;
 
 
-import java.util.ArrayList;
-import java.util.List;
-
-import com.google.inject.Inject;
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
 import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.core.rx.AllEntitiesInSystemObservable;
-import org.apache.usergrid.persistence.core.rx.ApplicationObservable;
-import org.apache.usergrid.persistence.core.scope.ApplicationEntityGroup;
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
-import org.apache.usergrid.persistence.core.scope.EntityIdScope;
 import org.apache.usergrid.persistence.graph.GraphManager;
 import org.apache.usergrid.persistence.graph.GraphManagerFactory;
 import org.apache.usergrid.persistence.graph.serialization.TargetIdObservable;
 import org.apache.usergrid.persistence.model.entity.Id;
 
+import com.google.inject.Inject;
+
 import rx.Observable;
 import rx.functions.Func1;
 
@@ -46,42 +41,37 @@ import rx.functions.Func1;
  * Note that this only walks each application applicationId graph, and emits edges from the applicationId and it's edges as the s
  * source node
  */
-public class AllEntitiesInSystemObservableImpl implements AllEntitiesInSystemObservable<CollectionScope> {
+public class AllEntitiesInSystemObservableImpl implements MigrationDataProvider<EntityIdScope> {
 
-    private final ApplicationObservable applicationObservable;
+    private final MigrationDataProvider<ApplicationScope> applicationObservable;
     private final GraphManagerFactory graphManagerFactory;
     private final TargetIdObservable targetIdObservable;
 
     @Inject
-    public AllEntitiesInSystemObservableImpl(ApplicationObservable applicationObservable, GraphManagerFactory graphManagerFactory, TargetIdObservable targetIdObservable) {
+    public AllEntitiesInSystemObservableImpl( MigrationDataProvider<ApplicationScope> applicationObservable,
+                                              GraphManagerFactory graphManagerFactory,
+                                              TargetIdObservable targetIdObservable ) {
 
         this.applicationObservable = applicationObservable;
         this.graphManagerFactory = graphManagerFactory;
         this.targetIdObservable = targetIdObservable;
     }
 
-    public Observable<ApplicationEntityGroup<CollectionScope>> getAllEntitiesInSystem(final int bufferSize) {
-        return getAllEntitiesInSystem(applicationObservable.getAllApplicationIds().map(new Func1<Id, ApplicationScope>() {
+
+
+    @Override
+    public Observable<EntityIdScope> getData() {
+        return applicationObservable.getData().flatMap( new Func1<ApplicationScope, Observable<EntityIdScope>>() {
             @Override
-            public ApplicationScope call(Id id) {
-                return new ApplicationScopeImpl(id);
+            public Observable<EntityIdScope> call( final ApplicationScope applicationScope ) {
+                return getAllEntities( applicationScope );
             }
-        }), bufferSize);
+        } );
 
     }
 
-    public Observable<ApplicationEntityGroup<CollectionScope>> getAllEntitiesInSystem(final Observable<ApplicationScope> appIdsObservable, final int bufferSize) {
-        //traverse all nodes in the graph, load all source edges from them, then re-save the meta data
-        return appIdsObservable
-            .flatMap(new Func1<ApplicationScope, Observable<ApplicationEntityGroup<CollectionScope>>>() {
-                @Override
-                public Observable<ApplicationEntityGroup<CollectionScope>> call(final ApplicationScope applicationScope) {
-                    return getAllEntities(applicationScope, bufferSize);
-                }
-            });
-    }
 
-    private Observable<ApplicationEntityGroup<CollectionScope>> getAllEntities(final ApplicationScope applicationScope, final int bufferSize) {
+    private Observable<EntityIdScope> getAllEntities(final ApplicationScope applicationScope) {
         final GraphManager gm = graphManagerFactory.createEdgeManager(applicationScope);
         final Id applicationId = applicationScope.getApplication();
 
@@ -90,10 +80,6 @@ public class AllEntitiesInSystemObservableImpl implements AllEntitiesInSystemObs
         final Observable<Id> entityNodes =
             targetIdObservable.getTargetNodes(gm, applicationId);
 
-
-        //get scope here
-
-
         //emit Scope + ID
 
         //create our application node to emit since it's an entity as well
@@ -102,26 +88,18 @@ public class AllEntitiesInSystemObservableImpl implements AllEntitiesInSystemObs
         //merge both the specified application node and the entity node
         // so they all get used
         return Observable
-            .merge(applicationNode, entityNodes)
-            .buffer(bufferSize)
-            .map(new Func1<List<Id>, List<EntityIdScope<CollectionScope>>>() {
-                @Override
-                public List<EntityIdScope<CollectionScope>> call(List<Id> ids) {
-                    List<EntityIdScope<CollectionScope>> scopes = new ArrayList<>(ids.size());
-                    for (Id id : ids) {
-                        CollectionScope scope = CpNamingUtils.getCollectionScopeNameFromEntityType(applicationId, id.getType());
-                        EntityIdScope<CollectionScope> idScope = new EntityIdScope<>(id, scope);
-                        scopes.add(idScope);
-                    }
-                    return scopes;
-                }
-            })
-            .map(new Func1<List<EntityIdScope<CollectionScope>>, ApplicationEntityGroup<CollectionScope>>() {
+            .merge( applicationNode, entityNodes ).
+            map( new Func1<Id, EntityIdScope>() {
                 @Override
-                public ApplicationEntityGroup<CollectionScope> call(final List<EntityIdScope<CollectionScope>> scopes) {
-                    return new ApplicationEntityGroup<>(applicationScope, scopes);
+                public EntityIdScope call( final Id id ) {
+                    CollectionScope scope =  CpNamingUtils.getCollectionScopeNameFromEntityType( applicationId, id.getType() );
+
+                    final EntityIdScope idScope = new EntityIdScope(scope, id  );
+
+                    return idScope;
                 }
-            });
+            } );
     }
 
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/ApplicationObservableImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/ApplicationObservableImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/ApplicationObservableImpl.java
index f4a1057..8131bc0 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/ApplicationObservableImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/ApplicationObservableImpl.java
@@ -23,37 +23,36 @@ package org.apache.usergrid.corepersistence.rx.impl;
 import java.util.Arrays;
 import java.util.UUID;
 
-import com.google.inject.Inject;
-import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
-import org.apache.usergrid.persistence.core.rx.ApplicationObservable;
-import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
-import org.apache.usergrid.persistence.graph.GraphManagerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
+import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
 import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
+import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.GraphManager;
+import org.apache.usergrid.persistence.graph.GraphManagerFactory;
 import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdgeType;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 
+import com.google.inject.Inject;
+
 import rx.Observable;
 import rx.functions.Func1;
 
-import static org.apache.usergrid.corepersistence.util.CpNamingUtils.generateApplicationId;
 import static org.apache.usergrid.corepersistence.util.CpNamingUtils.getApplicationScope;
 
 
 /**
  * An observable that will emit all application stored in the system.
  */
-public class ApplicationObservableImpl implements ApplicationObservable {
+public class ApplicationObservableImpl implements MigrationDataProvider<ApplicationScope> {
 
     private static final Logger logger = LoggerFactory.getLogger( ApplicationObservableImpl.class );
     private final EntityCollectionManagerFactory entityCollectionManagerFactory;
@@ -67,15 +66,16 @@ public class ApplicationObservableImpl implements ApplicationObservable {
     }
 
 
+
     @Override
-    public Observable<Id> getAllApplicationIds() {
+    public Observable<ApplicationScope> getData() {
 
         //emit our 3 hard coded applications that are used the manage the system first.
         //this way consumers can perform whatever work they need to on the root system first
-        final Observable<Id> systemIds = Observable.from( Arrays
-                .asList( generateApplicationId( CpNamingUtils.DEFAULT_APPLICATION_ID ),
-                        generateApplicationId( CpNamingUtils.MANAGEMENT_APPLICATION_ID ),
-                        generateApplicationId( CpNamingUtils.SYSTEM_APP_ID ) ) );
+        final Observable<ApplicationScope> systemIds = Observable.from( Arrays
+            .asList( getApplicationScope( CpNamingUtils.DEFAULT_APPLICATION_ID ),
+                getApplicationScope( CpNamingUtils.MANAGEMENT_APPLICATION_ID ),
+                getApplicationScope( CpNamingUtils.SYSTEM_APP_ID ) ) );
 
 
         final ApplicationScope appScope = getApplicationScope( CpNamingUtils.SYSTEM_APP_ID );
@@ -97,53 +97,45 @@ public class ApplicationObservableImpl implements ApplicationObservable {
 
 
         //we have app infos.  For each of these app infos, we have to load the application itself
-        Observable<Id> appIds = gm.loadEdgesFromSource(
+        Observable<ApplicationScope> appIds = gm.loadEdgesFromSource(
                 new SimpleSearchByEdgeType( rootAppId, edgeType, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,
-                        null ) ).flatMap( new Func1<Edge, Observable<Id>>() {
+                        null ) ).flatMap( new Func1<Edge, Observable<ApplicationScope>>() {
             @Override
-            public Observable<Id> call( final Edge edge ) {
+            public Observable<ApplicationScope> call( final Edge edge ) {
                 //get the app info and load it
                 final Id appInfo = edge.getTargetNode();
 
                 return collectionManager.load( appInfo )
-                        //filter out null entities
-                        .filter( new Func1<Entity, Boolean>() {
-                            @Override
-                            public Boolean call( final Entity entity ) {
-                                if ( entity == null ) {
-                                    logger.warn( "Encountered a null application info for id {}", appInfo );
-                                    return false;
-                                }
-
-                                return true;
+                    //filter out null entities
+                    .filter( new Func1<Entity, Boolean>() {
+                        @Override
+                        public Boolean call( final Entity entity ) {
+                            if ( entity == null ) {
+                                logger.warn( "Encountered a null application info for id {}", appInfo );
+                                return false;
                             }
-                        } )
-                                //get the id from the entity
-                        .map( new Func1<org.apache.usergrid.persistence.model.entity.Entity, Id>() {
 
+                            return true;
+                        }
+                    } )
+                        //get the id from the entity
+                    .map( new Func1<Entity, ApplicationScope>() {
 
-                            @Override
-                            public Id call( final org.apache.usergrid.persistence.model.entity.Entity entity ) {
 
-                                final UUID uuid = ( UUID ) entity.getField( "applicationUuid" ).getValue();
+                        @Override
+                        public ApplicationScope call( final Entity entity ) {
 
-                                return CpNamingUtils.generateApplicationId( uuid );
-                            }
-                        } );
+                            final UUID uuid = ( UUID ) entity.getField( "applicationUuid" ).getValue();
+
+                            return getApplicationScope( uuid );
+                        }
+                    } );
             }
         } );
 
         return Observable.merge( systemIds, appIds );
     }
 
-    @Override
-    public Observable<ApplicationScope> getAllApplicationScopes() {
-        return getAllApplicationIds().map(new Func1<Id, ApplicationScope>() {
-            @Override
-            public ApplicationScope call(Id id) {
-                ApplicationScope scope = new ApplicationScopeImpl(id);
-                return scope;
-            }
-        });
-    }
+
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/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
index e518298..6d32d73 100644
--- 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
@@ -65,6 +65,7 @@ public interface MvccLogEntry {
         /**
          * The logentry being written represents a partial entity
          */
+        @Deprecated//removed in v3
         PARTIAL(1),
 
         /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/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 7d78177..d5478d4 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
@@ -89,28 +89,15 @@ public abstract class CollectionModule extends AbstractModule {
         configureMigrationProvider();
 
     }
-
-    @Provides
-    @Singleton
-    @Inject
-    @Write
-    public WriteStart write (final MvccLogEntrySerializationStrategy logStrategy) {
-        final WriteStart writeStart = new WriteStart( logStrategy, MvccEntity.Status.COMPLETE);
-
-        return writeStart;
-    }
-
-
-    //TODO USERGRID-405, remove this, it's no longer supported
-    @Provides
-    @Singleton
-    @Inject
-    @WriteUpdate
-    public WriteStart writeUpdate (final MvccLogEntrySerializationStrategy logStrategy) {
-        final WriteStart writeStart = new WriteStart( logStrategy, MvccEntity.Status.PARTIAL );
-
-        return writeStart;
-    }
+//
+//    @Provides
+//    @Singleton
+//    @Inject
+//    public WriteStart write (final MvccLogEntrySerializationStrategy logStrategy) {
+//        final WriteStart writeStart = new WriteStart( logStrategy, MvccEntity.Status.COMPLETE);
+//
+//        return writeStart;
+//    }
 
     @Inject
     @Singleton

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/Write.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/Write.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/Write.java
deleted file mode 100644
index ad752af..0000000
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/Write.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.apache.usergrid.persistence.collection.guice;
-
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import com.google.inject.BindingAnnotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@BindingAnnotation
-@Target( { FIELD, PARAMETER, METHOD } )
-@Retention( RUNTIME )
-public @interface Write {}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/WriteUpdate.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/WriteUpdate.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/WriteUpdate.java
deleted file mode 100644
index 0ba3991..0000000
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/WriteUpdate.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.apache.usergrid.persistence.collection.guice;
-
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import com.google.inject.BindingAnnotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@BindingAnnotation
-@Target( { FIELD, PARAMETER, METHOD } )
-@Retention( RUNTIME )
-public @interface WriteUpdate {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerFactoryImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerFactoryImpl.java
index fa36f42..10d85f8 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerFactoryImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerFactoryImpl.java
@@ -32,8 +32,6 @@ import org.apache.usergrid.persistence.collection.EntityVersionCreatedFactory;
 import org.apache.usergrid.persistence.collection.cache.CachedEntityCollectionManager;
 import org.apache.usergrid.persistence.collection.cache.EntityCacheFig;
 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.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.mvcc.stage.delete.MarkCommit;
 import org.apache.usergrid.persistence.collection.mvcc.stage.delete.MarkStart;
@@ -66,7 +64,6 @@ public class EntityCollectionManagerFactoryImpl implements EntityCollectionManag
 
 
     private final WriteStart writeStart;
-    private final WriteStart writeUpdate;
     private final WriteUniqueVerify writeVerifyUnique;
     private final WriteOptimisticVerify writeOptimisticVerify;
     private final WriteCommit writeCommit;
@@ -91,7 +88,7 @@ public class EntityCollectionManagerFactoryImpl implements EntityCollectionManag
 
                                   //create the target EM that will perform logic
                             final EntityCollectionManager target = new EntityCollectionManagerImpl(
-                                writeStart, writeUpdate, writeVerifyUnique,
+                                writeStart, writeVerifyUnique,
                                 writeOptimisticVerify, writeCommit, rollback, markStart, markCommit,
                                 entitySerializationStrategy, uniqueValueSerializationStrategy,
                                 mvccLogEntrySerializationStrategy, keyspace, serializationFig,entityVersionCleanupFactory,
@@ -107,8 +104,7 @@ public class EntityCollectionManagerFactoryImpl implements EntityCollectionManag
 
 
     @Inject
-    public EntityCollectionManagerFactoryImpl( @Write final WriteStart writeStart,
-                                               @WriteUpdate final WriteStart writeUpdate,
+    public EntityCollectionManagerFactoryImpl( final WriteStart writeStart,
                                                final WriteUniqueVerify writeVerifyUnique,
                                                final WriteOptimisticVerify writeOptimisticVerify,
                                                final WriteCommit writeCommit, final RollbackAction rollback,
@@ -125,7 +121,6 @@ public class EntityCollectionManagerFactoryImpl implements EntityCollectionManag
                                                final SerializationFig serializationFig) {
 
         this.writeStart = writeStart;
-        this.writeUpdate = writeUpdate;
         this.writeVerifyUnique = writeVerifyUnique;
         this.writeOptimisticVerify = writeOptimisticVerify;
         this.writeCommit = writeCommit;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/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 e483cc1..f496cac 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
@@ -28,12 +28,13 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
+import org.apache.usergrid.persistence.collection.EntityDeletedFactory;
 import org.apache.usergrid.persistence.collection.EntitySet;
+import org.apache.usergrid.persistence.collection.EntityVersionCleanupFactory;
+import org.apache.usergrid.persistence.collection.EntityVersionCreatedFactory;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.VersionSet;
-import org.apache.usergrid.persistence.collection.guice.Write;
-import org.apache.usergrid.persistence.collection.guice.WriteUpdate;
-import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
+import org.apache.usergrid.persistence.collection.guice.CollectionTaskExecutor;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccValidationUtils;
 import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
@@ -44,11 +45,14 @@ import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteCommit;
 import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteOptimisticVerify;
 import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteStart;
 import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteUniqueVerify;
+import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSet;
 import org.apache.usergrid.persistence.core.guice.ProxyImpl;
+import org.apache.usergrid.persistence.core.task.Task;
+import org.apache.usergrid.persistence.core.task.TaskExecutor;
 import org.apache.usergrid.persistence.core.util.Health;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
@@ -65,12 +69,6 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 import com.netflix.astyanax.model.ColumnFamily;
 import com.netflix.astyanax.model.CqlResult;
 import com.netflix.astyanax.serializers.StringSerializer;
-import org.apache.usergrid.persistence.collection.EntityDeletedFactory;
-import org.apache.usergrid.persistence.collection.EntityVersionCleanupFactory;
-import org.apache.usergrid.persistence.collection.EntityVersionCreatedFactory;
-import org.apache.usergrid.persistence.collection.guice.CollectionTaskExecutor;
-import org.apache.usergrid.persistence.core.task.Task;
-import org.apache.usergrid.persistence.core.task.TaskExecutor;
 
 import rx.Observable;
 import rx.Subscriber;
@@ -92,7 +90,6 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
 
     //start stages
     private final WriteStart writeStart;
-    private final WriteStart writeUpdate;
     private final WriteUniqueVerify writeVerifyUnique;
     private final WriteOptimisticVerify writeOptimisticVerify;
     private final WriteCommit writeCommit;
@@ -117,8 +114,7 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
 
     @Inject
     public EntityCollectionManagerImpl(
-        @Write final WriteStart                    writeStart,
-        @WriteUpdate final WriteStart              writeUpdate,
+        final WriteStart                    writeStart,
         final WriteUniqueVerify                    writeVerifyUnique,
         final WriteOptimisticVerify                writeOptimisticVerify,
         final WriteCommit                          writeCommit,
@@ -142,7 +138,6 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
         MvccValidationUtils.validateCollectionScope( collectionScope );
 
         this.writeStart = writeStart;
-        this.writeUpdate = writeUpdate;
         this.writeVerifyUnique = writeVerifyUnique;
         this.writeOptimisticVerify = writeOptimisticVerify;
         this.writeCommit = writeCommit;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/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 8cd21e1..92dc69d 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
@@ -38,7 +38,6 @@ public class WriteStart implements Func1<CollectionIoEvent<Entity>, CollectionIo
 
     private final MvccLogEntrySerializationStrategy logStrategy;
 
-    MvccEntity.Status status;
 
 
     /**
@@ -46,9 +45,8 @@ public class WriteStart implements Func1<CollectionIoEvent<Entity>, CollectionIo
      */
 
     @Inject
-    public WriteStart ( final MvccLogEntrySerializationStrategy logStrategy, MvccEntity.Status status) {
+    public WriteStart ( final MvccLogEntrySerializationStrategy logStrategy) {
         this.logStrategy = logStrategy;
-        this.status = status;
 
     }
 
@@ -69,7 +67,7 @@ public class WriteStart implements Func1<CollectionIoEvent<Entity>, CollectionIo
 
             MutationBatch write = logStrategy.write( collectionScope, startEntry );
 
-            final MvccEntityImpl nextStage = new MvccEntityImpl( entityId, newVersion, status, entity );
+            final MvccEntityImpl nextStage = new MvccEntityImpl( entityId, newVersion, MvccEntity.Status.COMPLETE, entity );
             if(ioEvent.getEvent().hasVersion()) {
                 try {
                     write.execute();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d000e777/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
index a683d23..c00c82a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
@@ -68,7 +68,7 @@ public class WriteStartTest extends AbstractEntityStageTest {
         final Entity entity = TestEntityGenerator.generateEntity();
 
         //run the stage
-        WriteStart newStage = new WriteStart( logStrategy, MvccEntity.Status.COMPLETE);
+        WriteStart newStage = new WriteStart( logStrategy);
 
 
         //verify the observable is correct
@@ -113,7 +113,7 @@ public class WriteStartTest extends AbstractEntityStageTest {
         //set up the mock to return the entity from the start phase
         final Entity entity = TestEntityGenerator.generateEntity(new SimpleId(UUID.randomUUID(),"test"),null);
         //run the stage
-        WriteStart newStage = new WriteStart( logStrategy, MvccEntity.Status.COMPLETE);
+        WriteStart newStage = new WriteStart( logStrategy );
 
         //verify the observable is correct
         CollectionIoEvent<MvccEntity> result = newStage.call( new CollectionIoEvent<Entity>( context, entity ) );
@@ -140,7 +140,7 @@ public class WriteStartTest extends AbstractEntityStageTest {
     protected void validateStage( final CollectionIoEvent<Entity> event ) {
         final MvccLogEntrySerializationStrategy logStrategy = mock( MvccLogEntrySerializationStrategy.class );
 
-        new WriteStart( logStrategy, MvccEntity.Status.COMPLETE ).call( event );
+        new WriteStart( logStrategy ).call( event );
     }
 }
 


Mime
View raw message