You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/03/05 07:13:38 UTC

[1/3] incubator-usergrid git commit: Fixes incorrect system initialization order

Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-405 2e77c6316 -> cf32557a1


Fixes incorrect system initialization order


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

Branch: refs/heads/USERGRID-405
Commit: 494f8aed2ad970cae9ff64433e5229b0b67d965a
Parents: 2e77c63
Author: Todd Nine <tn...@apigee.com>
Authored: Wed Mar 4 22:32:07 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Wed Mar 4 22:32:07 2015 -0700

----------------------------------------------------------------------
 .../main/dist/init_instance/init_rest_server.sh | 24 +++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/494f8aed/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
index 3860cd4..0b920fd 100644
--- a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
+++ b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
@@ -1,14 +1,14 @@
 #!/bin/bash
 
-# 
+#
 #  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.
@@ -35,10 +35,10 @@ apt-get -y --force-yes install ${PKGS}
 # Install AWS Java SDK and get it into the Groovy classpath
 curl http://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip > /tmp/aws-sdk-java.zip
 cd /usr/share/
-unzip /tmp/aws-sdk-java.zip 
+unzip /tmp/aws-sdk-java.zip
 mkdir -p /home/ubuntu/.groovy/lib
 cp /usr/share/aws-java-sdk-*/third-party/*/*.jar /home/ubuntu/.groovy/lib
-cp /usr/share/aws-java-sdk-*/lib/* /home/ubuntu/.groovy/lib 
+cp /usr/share/aws-java-sdk-*/lib/* /home/ubuntu/.groovy/lib
 ln -s /home/ubuntu/.groovy /root/.groovy
 
 # Build environment for Groovy scripts
@@ -55,7 +55,7 @@ groovy tag_instance.groovy -BUILD-IN-PROGRESS
 chmod +x /usr/share/usergrid/update.sh
 
 cd /usr/share/usergrid/init_instance
-./install_oraclejdk.sh 
+./install_oraclejdk.sh
 
 cd /usr/share/usergrid/init_instance
 ./install_yourkit.sh
@@ -171,7 +171,7 @@ kernel.shmall = 4294967296
 ######
 EOF
 
-# wait for enough Cassandra nodes then delpoy and configure Usergrid 
+# wait for enough Cassandra nodes then delpoy and configure Usergrid
 cd /usr/share/usergrid/scripts
 groovy wait_for_instances.groovy cassandra ${CASSANDRA_NUM_SERVERS}
 groovy wait_for_instances.groovy elasticsearch ${ES_NUM_SERVERS}
@@ -185,8 +185,8 @@ chown -R tomcat7 /usr/share/usergrid/webapps
 chown -R tomcat7 /var/lib/tomcat7/webapps
 
 # configure usergrid
-mkdir -p /usr/share/tomcat7/lib 
-groovy configure_usergrid.groovy > /usr/share/tomcat7/lib/usergrid-deployment.properties 
+mkdir -p /usr/share/tomcat7/lib
+groovy configure_usergrid.groovy > /usr/share/tomcat7/lib/usergrid-deployment.properties
 groovy configure_portal_new.groovy >> /var/lib/tomcat7/webapps/portal/config.js
 
 
@@ -222,6 +222,10 @@ GRAPHITE_SERVER="$(groovy get_first_instance.groovy graphite )"
 #First host run the migration and setup
 if [ "$FIRSTHOST"=="$PUBLIC_HOSTNAME" ]; then
 
+#Run the system database setup since migration is a no-op
+curl -X GET http://localhost:8080/system/database/setup -u superuser:test
+
+
 #Run the migration
 curl -X PUT http://localhost:8080/system/migrate/run  -u superuser:test
 
@@ -229,8 +233,6 @@ curl -X PUT http://localhost:8080/system/migrate/run  -u superuser:test
 #Running setup
 sleep 10
 
-#Run the system database setup since migration is a no-op
-curl -X GET http://localhost:8080/system/database/setup -u superuser:test
 
 cd /usr/share/usergrid/init_instance
 ./update_keyspaces.sh


[2/3] incubator-usergrid git commit: Refactored packages

Posted by to...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationDataProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationDataProvider.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationDataProvider.java
deleted file mode 100644
index ffe8d9e..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationDataProvider.java
+++ /dev/null
@@ -1,43 +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.core.migration.data.newimpls;
-
-
-import rx.Observable;
-
-
-/**
- * An interface for data providers to implement.  The migration must take the migrationdata provider as an argument
- * @param <T>
- */
-public interface MigrationDataProvider<T> {
-
-
-    /**
-     * Get data that can be used in the migration
-     * @return
-     */
-    public Observable<T> getData();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationPlugin.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationPlugin.java
deleted file mode 100644
index 50dc91b..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationPlugin.java
+++ /dev/null
@@ -1,51 +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.core.migration.data.newimpls;
-
-
-
-/**
- * A simple interface to return migration plugins.  All versions within this migration plugin should have a name
- */
-public interface MigrationPlugin {
-
-
-    /**
-     * Get the name of the plugin.  Must be unique
-     * @return
-     */
-    public String getName();
-
-    /**
-     * Run any migrations that may need to be run in this plugin
-     */
-    public void run(ProgressObserver observer);
-
-
-    /**
-     * Get the max version this plugin supports
-     * @return
-     */
-    int getMaxVersion();
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationRelationship.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationRelationship.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationRelationship.java
deleted file mode 100644
index 691d8c1..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/MigrationRelationship.java
+++ /dev/null
@@ -1,100 +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.core.migration.data.newimpls;
-
-
-/**
- * Simple relationship that defines the current state of the source and destination data versions.  Note that
- * ina current system, the from and then to will be the same instance
- */
-public class MigrationRelationship<T extends VersionedData> {
-
-    //public so it's FAST.  It's also immutable
-
-
-    public final T from;
-    public final T to;
-
-    private final int fromVersion;
-    private final int toVersion;
-
-
-    public MigrationRelationship( T from, T to ) {
-        this.from = from;
-        this.to = to;
-
-        fromVersion = from.getImplementationVersion();
-        toVersion = to.getImplementationVersion();
-    }
-
-
-    /**
-     * Returns true if we need to perform dual writes.  IE. the from is not the same as the to
-     * @return
-     */
-    public boolean needsMigration(){
-        return fromVersion != toVersion;
-    }
-
-
-    /**
-     * Return true if this is the migration relationship we should use.  The version matches the from
-     * and is <= the to
-     * @param currentVersion
-     * @return
-     */
-    public boolean correctRelationship(final int currentVersion){
-        return currentVersion == fromVersion && currentVersion <= toVersion;
-    }
-
-
-    @Override
-    public boolean equals( final Object o ) {
-        if ( this == o ) {
-            return true;
-        }
-        if ( !( o instanceof MigrationRelationship ) ) {
-            return false;
-        }
-
-        final MigrationRelationship that = ( MigrationRelationship ) o;
-
-        if ( !from.equals( that.from ) ) {
-            return false;
-        }
-        if ( !to.equals( that.to ) ) {
-            return false;
-        }
-
-        return true;
-    }
-
-
-    @Override
-    public int hashCode() {
-        int result = from.hashCode();
-        result = 31 * result + to.hashCode();
-        return result;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/ProgressObserver.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/ProgressObserver.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/ProgressObserver.java
deleted file mode 100644
index 36c721a..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/ProgressObserver.java
+++ /dev/null
@@ -1,50 +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.core.migration.data.newimpls;
-
-
-public interface ProgressObserver{
-            /**
-             * Mark the migration as failed
-             * @param migrationVersion The migration version running during the failure
-             * @param reason The reason to save
-             */
-            public void failed(final int migrationVersion, final String reason);
-
-            /**
-             * Mark the migration as failed with a stack trace
-             * @param migrationVersion The migration version running during the failure
-             * @param reason The error description to save
-             * @param throwable The error that happened
-             */
-            public void failed(final int migrationVersion, final String reason, final Throwable throwable);
-
-
-            /**
-             * Update the status of the migration with the message
-             *
-             * @param message The message to save for the status
-             */
-            public void update(final int migrationVersion, final String message);
-        }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedData.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedData.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedData.java
deleted file mode 100644
index 14d488b..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedData.java
+++ /dev/null
@@ -1,38 +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.core.migration.data.newimpls;
-
-
-/**
- * Marker interface for implementations that may migrate their internal format
- */
-public interface VersionedData {
-
-    /**
-     * Get the version of the implementation
-     * @return
-     */
-    public int getImplementationVersion();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSet.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSet.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSet.java
deleted file mode 100644
index f40f5d0..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSet.java
+++ /dev/null
@@ -1,153 +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.core.migration.data.newimpls;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.base.Preconditions;
-
-
-/**
- * A set that represents a set of tuples that are used for
- * @param <T>
- */
-public class VersionedMigrationSet<T extends VersionedData> {
-
-
-    /**
-     * Cache so that after our initial lookup, it O(1) since this will be used heavily
-     *
-     */
-    private Map<Integer, MigrationRelationship<T>> cacheVersion = new HashMap<>();
-
-    private List<MigrationRelationship<T>> orderedVersions = new ArrayList<>();
-
-
-    /**
-     * Construct this set from a group of tuples.  Imagine the following versions
-     *
-     * v1,
-     * v2,
-     * v3,
-     * v4
-     *
-     * Migrations can jump from v1->v3, but not directly to v4 without an extraneous migration.  This would have 2 relationships
-     *
-     * v1, v3
-     * v2, v3
-     * and
-     * v3, v4
-     *
-     *
-     * @param migrations
-     */
-    public VersionedMigrationSet( final MigrationRelationship<T>... migrations ){
-        Preconditions.checkNotNull(migrations, "versions must not be null");
-        Preconditions.checkArgument( migrations.length > 0, "You must specify at least 1 migrationrelationship" );
-
-        orderedVersions.addAll( Arrays.asList(migrations ) );
-
-        Collections.sort( orderedVersions, new VersionedDataComparator() );
-
-    }
-
-
-    /**
-     * Get the migration relationship based on our current version. This will return a range that includes the current
-     * system version as the source, and the highest version we can roll to in the to field
-     * @param currentVersion
-     * @return The MigrationRelationship.  Note the from and the to could be the same version in a current system.
-     */
-    public MigrationRelationship<T> getMigrationRelationship( final int currentVersion ){
-
-        final MigrationRelationship<T> relationship = cacheVersion.get( currentVersion );
-
-        if(relationship != null){
-            return relationship;
-        }
-
-        //not there, find it.  Not the most efficient, but it happens once per version, which rarely changes, so not a big deal
-
-
-        for(MigrationRelationship<T> current: orderedVersions){
-
-            //not our instance, the from is too high
-            //our from is this instance, so we support this tuple.  Our future is >= as well, so we can perform this I/O
-            if ( current.correctRelationship( currentVersion )) {
-                cacheVersion.put( currentVersion, current );
-                return current;
-            }
-
-        }
-
-        //if we get here, something is wrong
-        throw new IllegalArgumentException( "Could not find a migration version for version " + currentVersion + " min found was " + orderedVersions.get( orderedVersions.size()-1 ) );
-
-
-    }
-
-
-    /**
-     * Given the current system version, return the maximum migration version we can move to
-     * @param currentVersion
-     * @return
-     */
-    public int getMaxVersion(final int currentVersion){
-        return getMigrationRelationship( currentVersion ).to.getImplementationVersion();
-    }
-
-
-
-    /**
-     * Orders from high to low
-     */
-    private final class VersionedDataComparator implements Comparator<MigrationRelationship<T>>
-    {
-
-        @Override
-        public int compare( final MigrationRelationship<T> o1, final MigrationRelationship<T> o2 ) {
-            //Put higher target version first, since that's what we want to match based on current state and source
-
-            //order by the source.  Put highest source first
-            int  compare = Integer.compare( o1.to.getImplementationVersion(), o2.to.getImplementationVersion() ) *-1;
-
-
-            //put higher from first, if we fall within a range here we're good
-            if(compare == 0){
-                compare =  Integer.compare( o1.from.getImplementationVersion(), o2.from.getImplementationVersion() ) *-1;
-            }
-
-            return compare;
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImplTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImplTest.java
index a6d5717..5d516d4 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImplTest.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImplTest.java
@@ -1,248 +1,148 @@
 /*
+ * 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
  *
- *  * 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.
+ *     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.core.migration.data;
 
 
+import java.util.HashSet;
+import java.util.Set;
+
 import org.junit.Test;
 
-import static org.junit.Assert.fail;
+import org.apache.usergrid.persistence.core.migration.schema.MigrationException;
+
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 
-/**
- * Tests our data migration manager
- */
 public class DataMigrationManagerImplTest {
 
-    //TODO USERGRID-405 fix this
-//
-//    AllEntitiesInSystemObservable allEntitiesInSystemObservable = new AllEntitiesInSystemObservable() {
-//        @Override
-//        public Observable<ApplicationEntityGroup> getAllEntitiesInSystem(int bufferSize) {
-//
-//            return Observable.create(new Observable.OnSubscribe<ApplicationEntityGroup>() {
-//                @Override
-//                public void call(Subscriber<? super ApplicationEntityGroup> subscriber) {
-//                    ApplicationEntityGroup entityGroup = new ApplicationEntityGroup(mock(ApplicationScope.class),new ArrayList<EntityIdScope>());
-//                    subscriber.onNext(entityGroup);
-//                    subscriber.onCompleted();
-//                }
-//            });
-//        }
-//
-//        @Override
-//        public Observable<ApplicationEntityGroup> getAllEntitiesInSystem(Observable appIdObservable, int bufferSize) {
-//            return this.getAllEntitiesInSystem(bufferSize) ;
-//        }
-//    };
-//
-//    ApplicationObservable allApplicationsObservable = new ApplicationObservable() {
-//        @Override
-//        public Observable<Id> getAllApplicationIds() {
-//            return Observable.just( (Id)new SimpleId("application"));
-//        }
-//
-//        @Override
-//        public Observable<ApplicationScope> getAllApplicationScopes() {
-//            return Observable.just( (ApplicationScope)new ApplicationScopeImpl((Id)new SimpleId("application")));
-//        }
-//    };
-//
-//    @Test
-//    public void noMigrations() throws MigrationException {
-//        final MigrationInfoSerialization serialization = mock( MigrationInfoSerialization.class );
-//        when(serialization.getCurrentVersion()).thenReturn(1);
-//
-//        Set<DataMigration> emptyMigration = new HashSet<>();
-//
-//        DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( serialization, emptyMigration, allEntitiesInSystemObservable,allApplicationsObservable );
-//
-//        migrationManager.migrate();
-//
-//        verify( serialization, never() ).setStatusMessage( any( String.class ) );
-//        verify( serialization, never() ).setStatusCode( any( Integer.class ) );
-//        verify( serialization, never() ).setVersion( any( Integer.class ) );
-//    }
-//
-//
-//    @Test
-//    public void multipleMigrations() throws Throwable {
-//        final MigrationInfoSerialization serialization = mock( MigrationInfoSerialization.class );
-//        when(serialization.getCurrentVersion()).thenReturn(1);
-//
-//
-//        final ApplicationDataMigration v1 = mock( ApplicationDataMigration.class );
-//        when( v1.getVersion() ).thenReturn( 2 );
-//        when( v1.migrate(any(Observable.class), any(DataMigration.ProgressObserver.class))).thenReturn(Observable.empty());
-//
-//        final ApplicationDataMigration v2 = mock( ApplicationDataMigration.class );
-//        when( v2.getVersion() ).thenReturn( 3 );
-//        when(v2.migrate(any(Observable.class), any(DataMigration.ProgressObserver.class))).thenReturn(Observable.empty());
-//
-//
-//        Set<DataMigration> migrations = new HashSet<>();
-//        migrations.add( v1 );
-//        migrations.add( v2 );
-//
-//
-//
-//        DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( serialization, migrations,allEntitiesInSystemObservable,allApplicationsObservable );
-//
-//        migrationManager.migrate();
-//
-//
-//        verify( v1 ).migrate(any(Observable.class), any( DataMigration.ProgressObserver.class ) );
-//        verify( v2 ).migrate(any(Observable.class), any( DataMigration.ProgressObserver.class ) );
-//
-//        //verify we set the running status
-//        verify( serialization, times( 2 ) ).setStatusCode( DataMigrationManagerImpl.StatusCode.RUNNING.status );
-//
-//        //set the status message
-//        verify( serialization, times( 2 * 2 ) ).setStatusMessage( any( String.class ) );
-//
-//        verify( serialization ).setStatusCode( DataMigrationManagerImpl.StatusCode.COMPLETE.status );
-//
-//        //verify we set version 1
-//        verify( serialization ).setVersion( 2 );
-//
-//        //verify we set version 2
-//        verify( serialization ).setVersion( 3 );
-//    }
-//
-//
-//    @Test
-//    public void shortCircuitVersionFails() throws Throwable {
-//        final MigrationInfoSerialization serialization = mock( MigrationInfoSerialization.class );
-//        when(serialization.getCurrentVersion()).thenReturn(1);
-//
-//
-//        final ApplicationDataMigration v1 = mock( ApplicationDataMigration.class,"mock1" );
-//        when( v1.getVersion() ).thenReturn( 2 );
-//        when( v1.getType() ).thenReturn(DataMigration.MigrationType.Entities);
-//        when( v1.migrate(any(Observable.class), any(DataMigration.ProgressObserver.class))).thenReturn(Observable.empty());
-//
-//        //throw an exception
-//        when( v1.migrate(any(Observable.class),
-//                any(DataMigration.ProgressObserver.class) )).thenThrow(new RuntimeException( "Something bad happened" ));
-//
-//        final ApplicationDataMigration v2 = mock( ApplicationDataMigration.class,"mock2" );
-//        when( v2.getType() ).thenReturn(DataMigration.MigrationType.Entities);
-//        when( v2.getVersion() ).thenReturn( 3 );
-//
-//        Set<DataMigration> migrations = new HashSet<>();
-//        migrations.add( v1 );
-//        migrations.add( v2 );
-//
-//        DataMigrationManagerImpl migrationManager
-//            = new DataMigrationManagerImpl( serialization, migrations,allEntitiesInSystemObservable,allApplicationsObservable );
-//
-//        migrationManager.migrate();
-//
-//
-//        verify( v1 ).migrate( any(Observable.class),any( DataMigration.ProgressObserver.class ) );
-//
-//        //verify we don't run migration
-//        verify( v2, never() ).migrate( any(Observable.class),any( DataMigration.ProgressObserver.class ) );
-//
-//        //verify we set the running status
-//        verify( serialization, times( 1 ) ).setStatusCode( DataMigrationManagerImpl.StatusCode.RUNNING.status );
-//
-//        //set the status message
-//        verify( serialization, times( 2 ) ).setStatusMessage( any( String.class ) );
-//
-//        //verify we set an error
-//        verify( serialization ).setStatusCode( DataMigrationManagerImpl.StatusCode.ERROR.status );
-//
-//        //verify we never set version 1
-//        verify( serialization, never() ).setVersion( 1 );
-//
-//        //verify we never set version 2
-//        verify( serialization, never() ).setVersion( 2 );
-//    }
-//
-//
-//    @Test
-//    public void failStopsProgress() throws Throwable {
-//        final MigrationInfoSerialization serialization = mock(MigrationInfoSerialization.class);
-//        when(serialization.getCurrentVersion()).thenReturn(1);
-//
-//        final CollectionDataMigration v1 = mock( CollectionDataMigration.class );
-//        when( v1.getVersion() ).thenReturn( 2 );
-//        when( v1.getType() ).thenReturn(DataMigration.MigrationType.Entities);
-//        when( v1.migrate(any(Observable.class), any(DataMigration.ProgressObserver.class))).thenReturn(Observable.empty());
-//
-//        final int returnedCode = 100;
-//
-//        final String reason = "test reason";
-//
-//        //mark as fail but don't
-//        when(v1.migrate(any(Observable.class), any(DataMigration.ProgressObserver.class))).thenAnswer(
-//            new Answer<Object>() {
-//                @Override
-//                public Object answer(final InvocationOnMock invocation) throws Throwable {
-//                    final DataMigration.ProgressObserver progressObserver =
-//                        (DataMigration.ProgressObserver) invocation.getArguments()[1];
-//
-//                    progressObserver.failed(returnedCode, reason);
-//                    return null;
-//                }
-//            }
-//
-//        );
-//
-//        final CollectionDataMigration v2 = mock( CollectionDataMigration.class );
-//        when( v2.getVersion() ).thenReturn( 3 );
-//        when( v2.getType() ).thenReturn(DataMigration.MigrationType.Entities);
-//        when(v2.migrate(any(Observable.class), any(DataMigration.ProgressObserver.class))).thenReturn(Observable.empty());
-//
-//        Set<DataMigration> applicationDataMigrations = new HashSet<>();
-//        applicationDataMigrations.add( v1 );
-//        applicationDataMigrations.add(v2);
-//
-//
-//        DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( serialization, applicationDataMigrations,allEntitiesInSystemObservable, allApplicationsObservable );
-//
-//        migrationManager.migrate();
-//
-//
-//        verify( v1 ).migrate(any(Observable.class), any( DataMigration.ProgressObserver.class ) );
-//
-//        //verify we don't run migration
-//        verify( v2, never() ).migrate( any(Observable.class),any( DataMigration.ProgressObserver.class ) );
-//
-//        //verify we set the running status
-//        verify( serialization, times( 1 ) ).setStatusCode( DataMigrationManagerImpl.StatusCode.RUNNING.status );
-//
-//        //set the status message
-//        verify( serialization ).setStatusMessage( "Migration version 2.  Starting migration" );
-//
-//        verify( serialization ).setStatusMessage( "Migration version 100.  Failed to migrate, reason is appended.  Error 'test reason'" );
-//
-//        //verify we set an error
-//        verify( serialization, times(2) ).setStatusCode( DataMigrationManagerImpl.StatusCode.ERROR.status );
-//
-//        //verify we never set version 1
-//        verify( serialization, never() ).setVersion( 1 );
-//
-//        //verify we never set version 2
-//        verify( serialization, never() ).setVersion( 2 );
-//    }
+
+    @Test
+    public void testNoPlugins(){
+
+        final Set<MigrationPlugin> plugins = new HashSet<>(  );
+
+        final  MigrationInfoSerialization migrationInfoSerialization = mock(MigrationInfoSerialization.class);
+
+
+        DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( plugins, migrationInfoSerialization );
+
+
+        Set<String> pluginNames = migrationManager.getPluginNames();
+
+        assertEquals(0, pluginNames.size());
+
+    }
+
+
+
+    @Test
+    public void test2Plugins() throws MigrationException {
+
+        final Set<MigrationPlugin> plugins = new HashSet<>(  );
+
+        MigrationPlugin plugin1 = mock(MigrationPlugin.class);
+
+        when(plugin1.getName()).thenReturn("plugin1");
+
+        MigrationPlugin plugin2 = mock(MigrationPlugin.class);
+
+        when(plugin2.getName()).thenReturn("plugin2");
+
+        plugins.add( plugin1 );
+        plugins.add( plugin2 );
+
+
+
+        final  MigrationInfoSerialization migrationInfoSerialization = mock(MigrationInfoSerialization.class);
+
+
+        DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( plugins, migrationInfoSerialization );
+
+
+        Set<String> pluginNames = migrationManager.getPluginNames();
+
+        assertEquals(2, pluginNames.size());
+
+        assertTrue(pluginNames.contains( "plugin1"));
+
+        assertTrue(pluginNames.contains( "plugin2" ));
+
+        //now run them
+
+        migrationManager.migrate();
+
+        verify(plugin1).run( any(ProgressObserver.class) );
+
+        verify(plugin2).run( any(ProgressObserver.class) );
+
+    }
+
+
+
+
+    @Test
+    public void testRunning() throws MigrationException {
+
+        final Set<MigrationPlugin> plugins = new HashSet<>(  );
+
+        MigrationPlugin plugin1 = mock(MigrationPlugin.class);
+
+        when(plugin1.getName()).thenReturn("plugin1");
+
+        plugins.add( plugin1 );
+
+
+
+        final  MigrationInfoSerialization migrationInfoSerialization = mock(MigrationInfoSerialization.class);
+
+        when(migrationInfoSerialization.getStatusCode( "plugin1" )).thenReturn( DataMigrationManagerImpl.StatusCode.RUNNING.status );
+
+
+
+
+        DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( plugins, migrationInfoSerialization );
+
+
+        boolean status = migrationManager.isRunning();
+
+        assertTrue("Status is set", status);
+
+
+        when(migrationInfoSerialization.getStatusCode( "plugin1" )).thenReturn( DataMigrationManagerImpl.StatusCode.COMPLETE.status );
+
+        status = migrationManager.isRunning();
+
+        assertFalse( "Status is not running", status );
+
+
+        when(migrationInfoSerialization.getStatusCode( "plugin1" )).thenReturn( DataMigrationManagerImpl.StatusCode.ERROR.status );
+
+       status = migrationManager.isRunning();
+
+       assertFalse("Status is not running", status);
+    }
+
+
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationTest.java
index 7ac1fb2..1b6dd3f 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationTest.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationTest.java
@@ -22,18 +22,16 @@
 package org.apache.usergrid.persistence.core.migration.data;
 
 
-
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.core.migration.schema.MigrationException;
-import org.apache.usergrid.persistence.core.migration.schema.MigrationManager;
-import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.guice.TestCommonModule;
+import org.apache.usergrid.persistence.core.migration.schema.MigrationException;
+import org.apache.usergrid.persistence.core.migration.schema.MigrationManager;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 
 import com.google.inject.Inject;
@@ -42,16 +40,12 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
 
 
 @RunWith( ITRunner.class )
 @UseModules( TestCommonModule.class )
-@Ignore()
 public class MigrationInfoSerializationTest {
 
-    //TODO USERGRID-405 fix this
-
     @Inject
     @Rule
     public MigrationManagerRule migrationManagerRule;
@@ -68,53 +62,55 @@ public class MigrationInfoSerializationTest {
     @Inject
     protected MigrationInfoSerialization migrationInfoSerialization;
 
-//
-//    @Test
-//    public void basicTest() throws ConnectionException, MigrationException {
-//
-//        //drop the column family, then run setup
-//        keyspace.dropColumnFamily( MigrationInfoSerializationImpl.CF_MIGRATION_INFO.getName() );
-//
-//        migrationManager.migrate();
-//
-//        //test getting nothing works
-//        final String emptyStatus = migrationInfoSerialization.getStatusMessage();
-//
-//        assertNull(emptyStatus);
-//
-//        final int unsavedVersion = migrationInfoSerialization.getVersion();
-//
-//        assertEquals(0, unsavedVersion);
-//
-//        final int statusCode = migrationInfoSerialization.getStatusCode();
-//
-//        assertEquals(0, statusCode);
-//
-//        //now update them
-//
-//        final String savedStatus = "I'm a test status";
-//
-//        migrationInfoSerialization.setStatusMessage( savedStatus );
-//
-//        final String returnedStatus = migrationInfoSerialization.getStatusMessage();
-//
-//        assertEquals("Correct status returned", savedStatus, returnedStatus);
-//
-//
-//        final int savedVersion = 100;
-//
-//        migrationInfoSerialization.setVersion( savedVersion );
-//
-//        final int returnedVersion = migrationInfoSerialization.getVersion();
-//
-//        assertEquals("Correct version returned", savedVersion, returnedVersion);
-//
-//        final int savedStatusCode = 200;
-//
-//        migrationInfoSerialization.setStatusCode( savedStatusCode );
-//
-//        final int returnedStatusCode = migrationInfoSerialization.getStatusCode();
-//
-//        assertEquals("Status code was set correctly", savedStatusCode, returnedStatusCode);
-//    }
+
+    @Test
+    public void basicTest() throws ConnectionException, MigrationException {
+
+        final String migrationModule = "test";
+
+        //drop the column family, then run setup
+        keyspace.dropColumnFamily( MigrationInfoSerializationImpl.CF_MIGRATION_INFO.getName() );
+
+        migrationManager.migrate();
+
+        //test getting nothing works
+        final String emptyStatus = migrationInfoSerialization.getStatusMessage(migrationModule);
+
+        assertNull(emptyStatus);
+
+        final int unsavedVersion = migrationInfoSerialization.getVersion(migrationModule);
+
+        assertEquals(0, unsavedVersion);
+
+        final int statusCode = migrationInfoSerialization.getStatusCode(migrationModule);
+
+        assertEquals(0, statusCode);
+
+        //now update them
+
+        final String savedStatus = "I'm a test status";
+
+        migrationInfoSerialization.setStatusMessage(migrationModule,  savedStatus );
+
+        final String returnedStatus = migrationInfoSerialization.getStatusMessage(migrationModule);
+
+        assertEquals("Correct status returned", savedStatus, returnedStatus);
+
+
+        final int savedVersion = 100;
+
+        migrationInfoSerialization.setVersion(migrationModule,  savedVersion );
+
+        final int returnedVersion = migrationInfoSerialization.getVersion(migrationModule);
+
+        assertEquals("Correct version returned", savedVersion, returnedVersion);
+
+        final int savedStatusCode = 200;
+
+        migrationInfoSerialization.setStatusCode(migrationModule,  savedStatusCode );
+
+        final int returnedStatusCode = migrationInfoSerialization.getStatusCode(migrationModule);
+
+        assertEquals("Status code was set correctly", savedStatusCode, returnedStatusCode);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestMigrationDataProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestMigrationDataProvider.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestMigrationDataProvider.java
new file mode 100644
index 0000000..61e5207
--- /dev/null
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestMigrationDataProvider.java
@@ -0,0 +1,61 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+
+import rx.Observable;
+
+
+/**
+ * A simple test class that will emit the provided test data when subscribed
+ * @param <T>
+ */
+public class TestMigrationDataProvider<T> implements MigrationDataProvider<T> {
+
+
+
+    //default to nothing so that we don't return null
+    private Observable<T> observable = Observable.empty();
+
+
+    public TestMigrationDataProvider(  ) {}
+
+
+    @Override
+    public Observable<T> getData() {
+       return observable;
+    }
+
+
+    /**
+     * Set this observable to return when invoked
+     *
+     * @param observable
+     */
+    public void setObservable( final Observable<T> observable ) {
+        this.observable = observable;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestProgressObserver.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestProgressObserver.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestProgressObserver.java
index 63fad42..1612779 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestProgressObserver.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/TestProgressObserver.java
@@ -23,18 +23,30 @@ package org.apache.usergrid.persistence.core.migration.data;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.usergrid.persistence.core.migration.data.newimpls.ProgressObserver;
-
 
 public class TestProgressObserver implements ProgressObserver {
 
     private boolean failed = false;
 
+    private boolean started = false;
+
 
     private List<String> updates = new ArrayList<>( 100 );
 
 
     @Override
+    public void start() {
+         started = true;
+    }
+
+
+    @Override
+    public void stop() {
+        started = false;
+    }
+
+
+    @Override
     public void failed( final int migrationVersion, final String reason ) {
         failed = true;
     }
@@ -56,11 +68,17 @@ public class TestProgressObserver implements ProgressObserver {
      * Get if we failed
      * @return
      */
-    public boolean getFailed() {
+    public boolean isFailed() {
         return failed;
     }
 
 
+    public boolean isStarted() {
+        return started;
+    }
+
+
+
     /**
      * Get update messages
      * @return

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSetTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSetTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSetTest.java
new file mode 100644
index 0000000..fc23cb4
--- /dev/null
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSetTest.java
@@ -0,0 +1,198 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.VersionedData;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+
+public class VersionedMigrationSetTest {
+
+
+    /**
+     * a single version that goes from 1 to 3, and 2 to 3. then current as 3, 3.  1, 2 and 3, should have this in
+     * their range
+     */
+    @Test
+    public void singleVersion() {
+        //
+        final MigrationRelationship<TestVersionImpl> relationship1_3 =
+                new MigrationRelationship<>( new TestVersionImpl( 1 ), new TestVersionImpl( 3 ) );
+
+        final MigrationRelationship<TestVersionImpl> relationship2_3 =
+                new MigrationRelationship<>( new TestVersionImpl( 2 ), new TestVersionImpl( 3 ) );
+
+        //our current state, a necessity based on the data structure
+
+        final MigrationRelationship<TestVersionImpl> current =
+                new MigrationRelationship<>( new TestVersionImpl( 3 ), new TestVersionImpl( 3 ) );
+
+
+        final VersionedMigrationSet<TestVersionImpl> set =
+                new VersionedMigrationSet<>( relationship1_3, relationship2_3, current );
+
+
+        try {
+            set.getMigrationRelationship( 0 );
+            fail( "I should throw an exception" );
+        }
+        catch ( IllegalArgumentException iae ) {
+            //swallow, it's outside the range
+        }
+
+        MigrationRelationship<TestVersionImpl> migrationRelationship = set.getMigrationRelationship( 1 );
+
+        assertEquals( relationship1_3, migrationRelationship );
+
+
+        migrationRelationship = set.getMigrationRelationship( 2 );
+
+        assertEquals( relationship2_3, migrationRelationship );
+
+        migrationRelationship = set.getMigrationRelationship( 3 );
+
+        assertEquals( current, migrationRelationship );
+
+        try {
+            set.getMigrationRelationship( 4 );
+            fail( "I should throw an exception" );
+        }
+        catch ( IllegalArgumentException iae ) {
+            //swallow, it's outside the range
+        }
+    }
+
+
+    /**
+     * a single version that goes from 1 to 3.  versions that go from 2 to 3, then a barrier migration that must be run.
+     * This can happen during a massive data change.  From there we can move on from 3 forward, so we go from 3:6,  4:6,
+     * 5:6, and 6:6,   This should mean an older system say on v2, can jump from v2 to v3, then from v3 directly to v6.
+     */
+    @Test
+    public void versionBounds() {
+        //
+        final MigrationRelationship<TestVersionImpl> relationship1_3 =
+                new MigrationRelationship<>( new TestVersionImpl( 1 ), new TestVersionImpl( 3 ) );
+
+        final MigrationRelationship<TestVersionImpl> relationship2_3 =
+                new MigrationRelationship<>( new TestVersionImpl( 2 ), new TestVersionImpl( 3 ) );
+
+        //our current state, a necessity based on the data structure
+        final MigrationRelationship<TestVersionImpl> relationship3_6 =
+                new MigrationRelationship<>( new TestVersionImpl( 3 ), new TestVersionImpl( 6 ) );
+
+
+        final MigrationRelationship<TestVersionImpl> relationship4_6 =
+                new MigrationRelationship<>( new TestVersionImpl( 4 ), new TestVersionImpl( 6 ) );
+
+
+        final MigrationRelationship<TestVersionImpl> relationship5_6 =
+                new MigrationRelationship<>( new TestVersionImpl( 5 ), new TestVersionImpl( 6 ) );
+
+
+        final MigrationRelationship<TestVersionImpl> current =
+                new MigrationRelationship<>( new TestVersionImpl( 6 ), new TestVersionImpl( 6 ) );
+
+
+        final VersionedMigrationSet<TestVersionImpl> set =
+                new VersionedMigrationSet<>( relationship1_3, relationship2_3, relationship3_6, relationship4_6,
+                        relationship5_6, current );
+
+
+        try {
+            set.getMigrationRelationship( 0 );
+            fail( "I should throw an exception" );
+        }
+        catch ( IllegalArgumentException iae ) {
+            //swallow, it's outside the range
+        }
+
+        MigrationRelationship<TestVersionImpl> migrationRelationship = set.getMigrationRelationship( 1 );
+
+        assertEquals( relationship1_3, migrationRelationship );
+
+        migrationRelationship = set.getMigrationRelationship( 2 );
+
+        assertEquals( relationship2_3, migrationRelationship );
+
+
+        //now go from v3, we should get 3 to 6
+
+        migrationRelationship = set.getMigrationRelationship( 3 );
+
+        assertEquals( relationship3_6, migrationRelationship );
+
+        migrationRelationship = set.getMigrationRelationship( 4 );
+
+        assertEquals( relationship4_6, migrationRelationship );
+
+        migrationRelationship = set.getMigrationRelationship( 5 );
+
+        assertEquals( relationship5_6, migrationRelationship );
+
+        migrationRelationship = set.getMigrationRelationship( 6 );
+
+        assertEquals( current, migrationRelationship );
+
+
+        try {
+            set.getMigrationRelationship( 7 );
+            fail( "I should throw an exception" );
+        }
+        catch ( IllegalArgumentException iae ) {
+            //swallow, it's outside the range
+        }
+    }
+
+
+    @Test( expected = IllegalArgumentException.class )
+    public void testNoInput() {
+        new VersionedMigrationSet<TestVersionImpl>();
+    }
+
+
+    /**
+     * Create the test version impl.  Just returns the version provided
+     */
+    private static final class TestVersionImpl implements VersionedData {
+
+        private final int version;
+
+
+        private TestVersionImpl( final int version ) {this.version = version;}
+
+
+        @Override
+        public int getImplementationVersion() {
+            return version;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/TestMigrationDataProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/TestMigrationDataProvider.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/TestMigrationDataProvider.java
deleted file mode 100644
index 9e99c6f..0000000
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/TestMigrationDataProvider.java
+++ /dev/null
@@ -1,61 +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.core.migration.data.newimpls;
-
-
-import java.util.Collection;
-
-import rx.Observable;
-
-
-/**
- * A simple test class that will emit the provided test data when subscribed
- * @param <T>
- */
-public class TestMigrationDataProvider<T> implements MigrationDataProvider<T> {
-
-
-
-    //default to nothing so that we don't return null
-    private Observable<T> observable = Observable.empty();
-
-
-    public TestMigrationDataProvider(  ) {}
-
-
-    @Override
-    public Observable<T> getData() {
-       return observable;
-    }
-
-
-    /**
-     * Set this observable to return when invoked
-     *
-     * @param observable
-     */
-    public void setObservable( final Observable<T> observable ) {
-        this.observable = observable;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSetTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSetTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSetTest.java
deleted file mode 100644
index e35409a..0000000
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/migration/data/newimpls/VersionedMigrationSetTest.java
+++ /dev/null
@@ -1,194 +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.core.migration.data.newimpls;
-
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-
-public class VersionedMigrationSetTest {
-
-
-    /**
-     * a single version that goes from 1 to 3, and 2 to 3. then current as 3, 3.  1, 2 and 3, should have this in
-     * their range
-     */
-    @Test
-    public void singleVersion() {
-        //
-        final MigrationRelationship<TestVersionImpl> relationship1_3 =
-                new MigrationRelationship<>( new TestVersionImpl( 1 ), new TestVersionImpl( 3 ) );
-
-        final MigrationRelationship<TestVersionImpl> relationship2_3 =
-                new MigrationRelationship<>( new TestVersionImpl( 2 ), new TestVersionImpl( 3 ) );
-
-        //our current state, a necessity based on the data structure
-
-        final MigrationRelationship<TestVersionImpl> current =
-                new MigrationRelationship<>( new TestVersionImpl( 3 ), new TestVersionImpl( 3 ) );
-
-
-        final VersionedMigrationSet<TestVersionImpl> set =
-                new VersionedMigrationSet<>( relationship1_3, relationship2_3, current );
-
-
-        try {
-            set.getMigrationRelationship( 0 );
-            fail( "I should throw an exception" );
-        }
-        catch ( IllegalArgumentException iae ) {
-            //swallow, it's outside the range
-        }
-
-        MigrationRelationship<TestVersionImpl> migrationRelationship = set.getMigrationRelationship( 1 );
-
-        assertEquals( relationship1_3, migrationRelationship );
-
-
-        migrationRelationship = set.getMigrationRelationship( 2 );
-
-        assertEquals( relationship2_3, migrationRelationship );
-
-        migrationRelationship = set.getMigrationRelationship( 3 );
-
-        assertEquals( current, migrationRelationship );
-
-        try {
-            set.getMigrationRelationship( 4 );
-            fail( "I should throw an exception" );
-        }
-        catch ( IllegalArgumentException iae ) {
-            //swallow, it's outside the range
-        }
-    }
-
-
-    /**
-     * a single version that goes from 1 to 3.  versions that go from 2 to 3, then a barrier migration that must be run.
-     * This can happen during a massive data change.  From there we can move on from 3 forward, so we go from 3:6,  4:6,
-     * 5:6, and 6:6,   This should mean an older system say on v2, can jump from v2 to v3, then from v3 directly to v6.
-     */
-    @Test
-    public void versionBounds() {
-        //
-        final MigrationRelationship<TestVersionImpl> relationship1_3 =
-                new MigrationRelationship<>( new TestVersionImpl( 1 ), new TestVersionImpl( 3 ) );
-
-        final MigrationRelationship<TestVersionImpl> relationship2_3 =
-                new MigrationRelationship<>( new TestVersionImpl( 2 ), new TestVersionImpl( 3 ) );
-
-        //our current state, a necessity based on the data structure
-        final MigrationRelationship<TestVersionImpl> relationship3_6 =
-                new MigrationRelationship<>( new TestVersionImpl( 3 ), new TestVersionImpl( 6 ) );
-
-
-        final MigrationRelationship<TestVersionImpl> relationship4_6 =
-                new MigrationRelationship<>( new TestVersionImpl( 4 ), new TestVersionImpl( 6 ) );
-
-
-        final MigrationRelationship<TestVersionImpl> relationship5_6 =
-                new MigrationRelationship<>( new TestVersionImpl( 5 ), new TestVersionImpl( 6 ) );
-
-
-        final MigrationRelationship<TestVersionImpl> current =
-                new MigrationRelationship<>( new TestVersionImpl( 6 ), new TestVersionImpl( 6 ) );
-
-
-        final VersionedMigrationSet<TestVersionImpl> set =
-                new VersionedMigrationSet<>( relationship1_3, relationship2_3, relationship3_6, relationship4_6,
-                        relationship5_6, current );
-
-
-        try {
-            set.getMigrationRelationship( 0 );
-            fail( "I should throw an exception" );
-        }
-        catch ( IllegalArgumentException iae ) {
-            //swallow, it's outside the range
-        }
-
-        MigrationRelationship<TestVersionImpl> migrationRelationship = set.getMigrationRelationship( 1 );
-
-        assertEquals( relationship1_3, migrationRelationship );
-
-        migrationRelationship = set.getMigrationRelationship( 2 );
-
-        assertEquals( relationship2_3, migrationRelationship );
-
-
-        //now go from v3, we should get 3 to 6
-
-        migrationRelationship = set.getMigrationRelationship( 3 );
-
-        assertEquals( relationship3_6, migrationRelationship );
-
-        migrationRelationship = set.getMigrationRelationship( 4 );
-
-        assertEquals( relationship4_6, migrationRelationship );
-
-        migrationRelationship = set.getMigrationRelationship( 5 );
-
-        assertEquals( relationship5_6, migrationRelationship );
-
-        migrationRelationship = set.getMigrationRelationship( 6 );
-
-        assertEquals( current, migrationRelationship );
-
-
-        try {
-            set.getMigrationRelationship( 7 );
-            fail( "I should throw an exception" );
-        }
-        catch ( IllegalArgumentException iae ) {
-            //swallow, it's outside the range
-        }
-    }
-
-
-    @Test( expected = IllegalArgumentException.class )
-    public void testNoInput() {
-        new VersionedMigrationSet<TestVersionImpl>();
-    }
-
-
-    /**
-     * Create the test version impl.  Just returns the version provided
-     */
-    private static final class TestVersionImpl implements VersionedData {
-
-        private final int version;
-
-
-        private TestVersionImpl( final int version ) {this.version = version;}
-
-
-        @Override
-        public int getImplementationVersion() {
-            return version;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
index d504e47..91a0b88 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
@@ -24,12 +24,11 @@ import org.safehaus.guicyfig.GuicyFigModule;
 import org.apache.usergrid.persistence.core.consistency.TimeService;
 import org.apache.usergrid.persistence.core.consistency.TimeServiceImpl;
 import org.apache.usergrid.persistence.core.guice.ProxyImpl;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.DataMigration2;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationPlugin;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.task.NamedTaskExecutorImpl;
 import org.apache.usergrid.persistence.core.task.TaskExecutor;
 import org.apache.usergrid.persistence.graph.GraphFig;
@@ -56,6 +55,7 @@ import org.apache.usergrid.persistence.graph.serialization.impl.EdgesObservableI
 import org.apache.usergrid.persistence.graph.serialization.impl.GraphManagerFactoryImpl;
 import org.apache.usergrid.persistence.graph.serialization.impl.NodeSerializationImpl;
 import org.apache.usergrid.persistence.graph.serialization.impl.TargetIdObservableImpl;
+import org.apache.usergrid.persistence.graph.serialization.impl.migration.GraphMigration;
 import org.apache.usergrid.persistence.graph.serialization.impl.migration.GraphMigrationPlugin;
 import org.apache.usergrid.persistence.graph.serialization.impl.migration.GraphNode;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumnFamilies;
@@ -131,8 +131,8 @@ public abstract class GraphModule extends AbstractModule {
 
 
         //wire up the edg migration
-        Multibinder<DataMigration2<GraphNode>> dataMigrationMultibinder =
-                Multibinder.newSetBinder( binder(), new TypeLiteral<DataMigration2<GraphNode>>() {} );
+        Multibinder<DataMigration<GraphNode>> dataMigrationMultibinder =
+                Multibinder.newSetBinder( binder(), new TypeLiteral<DataMigration<GraphNode>>() {}, GraphMigration.class );
 
 
         dataMigrationMultibinder.addBinding().to( EdgeDataMigrationImpl.class );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
index a843b3c..614b4bf 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
@@ -22,7 +22,7 @@ package org.apache.usergrid.persistence.graph.serialization;
 
 import java.util.Iterator;
 
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedData;
+import org.apache.usergrid.persistence.core.migration.data.VersionedData;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.Edge;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
index 262d665..a3d48de 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
@@ -31,8 +31,8 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.migration.data.MigrationInfoCache;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.SearchEdgeType;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
index af157a6..2d9b47f 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
@@ -23,11 +23,11 @@ import com.google.inject.Inject;
 import com.netflix.astyanax.Keyspace;
 import com.netflix.astyanax.MutationBatch;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
-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.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.ProgressObserver;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.ProgressObserver;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.GraphManager;
 import org.apache.usergrid.persistence.graph.GraphManagerFactory;
@@ -50,7 +50,7 @@ import java.util.concurrent.atomic.AtomicLong;
  * The migration data provider assumes that is will visit every node in the graph
  * all edges from these source node will then be re-indexed.
  */
-public class EdgeDataMigrationImpl implements DataMigration2<GraphNode> {
+public class EdgeDataMigrationImpl implements DataMigration<GraphNode> {
 
     private static final Logger logger = LoggerFactory.getLogger(EdgeDataMigrationImpl.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigration.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigration.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigration.java
new file mode 100644
index 0000000..245506a
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigration.java
@@ -0,0 +1,53 @@
+/*
+ * 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.graph.serialization.impl.migration;/*
+ * 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 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 GraphMigration {}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigrationPlugin.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigrationPlugin.java
index c989822..8da102d 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigrationPlugin.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/GraphMigrationPlugin.java
@@ -27,9 +27,9 @@ package org.apache.usergrid.persistence.graph.serialization.impl.migration;
 import java.util.Set;
 
 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 org.apache.usergrid.persistence.core.migration.data.AbstractMigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -46,7 +46,8 @@ public class GraphMigrationPlugin extends AbstractMigrationPlugin<GraphNode> {
 
 
     @Inject
-    public GraphMigrationPlugin( final Set<DataMigration2<GraphNode>> entityDataMigrations,
+    public GraphMigrationPlugin(@GraphMigration
+                                    final Set<DataMigration<GraphNode>> entityDataMigrations,
                                       final MigrationDataProvider<GraphNode> entityIdScopeDataMigrationProvider,
                                       final MigrationInfoSerialization migrationInfoSerialization ) {
         super( entityDataMigrations, entityIdScopeDataMigrationProvider, migrationInfoSerialization );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
index 3201a92..42411d3 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
@@ -21,9 +21,8 @@ package org.apache.usergrid.persistence.graph.guice;
 
 import org.apache.usergrid.persistence.core.guice.CommonModule;
 import org.apache.usergrid.persistence.core.guice.TestModule;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.TestMigrationDataProvider;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.TestMigrationDataProvider;
 import org.apache.usergrid.persistence.graph.serialization.impl.migration.GraphNode;
 
 import com.google.inject.TypeLiteral;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImplTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImplTest.java
index 09259f1..a269c15 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImplTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImplTest.java
@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
 import org.apache.usergrid.persistence.core.guice.DataMigrationResetRule;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
 import org.apache.usergrid.persistence.core.migration.data.TestProgressObserver;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
@@ -142,7 +142,7 @@ public class EdgeDataMigrationImplTest implements DataMigrationResetRule.DataMig
         //perform the migration
 
         assertEquals( "Correct version returned", returned, GraphDataVersions.META_SHARDING.getVersion() );
-        assertFalse( "Progress observer should not have failed", progressObserver.getFailed() );
+        assertFalse( "Progress observer should not have failed", progressObserver.isFailed() );
         assertTrue( "Progress observer should have update messages", progressObserver.getUpdates().size() > 0 );
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/rest/src/main/java/org/apache/usergrid/rest/MigrateResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/MigrateResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/MigrateResource.java
index 84b1085..9ab5dc3 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/MigrateResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/MigrateResource.java
@@ -77,13 +77,13 @@ public class MigrateResource extends AbstractContextResource {
 
             @Override
             public void run() {
-                logger.info( "Rebuilding all indexes" );
+                logger.info( "Migrating Data " );
 
                 try {
                     emf.migrateData();
                 }
                 catch ( Exception e ) {
-                    logger.error( "Unable to rebuild indexes", e );
+                    logger.error( "Unable to migrate data", e );
                 }
             }
         };


[3/3] incubator-usergrid git commit: Refactored packages

Posted by to...@apache.org.
Refactored packages

Fixes system setup migration wiring

Added more tests


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

Branch: refs/heads/USERGRID-405
Commit: cf32557a101b7d654f2d2d2090b385cb74110220
Parents: 494f8ae
Author: Todd Nine <tn...@apigee.com>
Authored: Wed Mar 4 23:13:32 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Wed Mar 4 23:13:32 2015 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/CoreModule.java    |  14 +-
 .../corepersistence/CpEntityManagerFactory.java |   4 +-
 .../migration/CoreMigration.java                |  53 +++
 .../migration/CoreMigrationPlugin.java          |   8 +-
 .../migration/EntityTypeMappingMigration.java   |   8 +-
 .../migration/MigrationModuleVersion.java       |   8 +-
 .../rx/impl/AbstractGraphVisitorImpl.java       |   5 +-
 .../MvccEntitySerializationStrategy.java        |   2 +-
 ...vccEntitySerializationStrategyProxyImpl.java |   4 +-
 .../serialization/impl/SerializationModule.java |  15 +-
 .../impl/migration/CollectionMigration.java     |  53 +++
 .../migration/CollectionMigrationPlugin.java    |   9 +-
 .../migration/MvccEntityDataMigrationImpl.java  |  13 +-
 .../collection/guice/TestCollectionModule.java  |   6 +-
 ...ntitySerializationStrategyProxyV1_3Test.java |   1 -
 ...ctMvccEntityDataMigrationV1ToV3ImplTest.java |  10 +-
 .../MvccEntityDataMigrationV1ToV3ImplTest.java  |  20 +-
 .../MvccEntityDataMigrationV2ToV3ImplTest.java  |   3 +-
 .../persistence/core/guice/CommonModule.java    |   2 +-
 .../core/hystrix/HystrixCassandra.java          |  30 +-
 .../migration/data/AbstractMigrationPlugin.java | 128 +++++++
 .../core/migration/data/DataMigration.java      |  58 +++
 .../data/DataMigrationManagerImpl.java          |  21 +-
 .../migration/data/MigrationDataProvider.java   |  43 +++
 .../core/migration/data/MigrationPlugin.java    |  51 +++
 .../migration/data/MigrationRelationship.java   | 100 +++++
 .../core/migration/data/ProgressObserver.java   |  63 ++++
 .../core/migration/data/VersionedData.java      |  38 ++
 .../migration/data/VersionedMigrationSet.java   | 153 ++++++++
 .../data/newimpls/AbstractMigrationPlugin.java  | 126 -------
 .../migration/data/newimpls/DataMigration2.java |  58 ---
 .../data/newimpls/MigrationDataProvider.java    |  43 ---
 .../data/newimpls/MigrationPlugin.java          |  51 ---
 .../data/newimpls/MigrationRelationship.java    | 100 -----
 .../data/newimpls/ProgressObserver.java         |  50 ---
 .../migration/data/newimpls/VersionedData.java  |  38 --
 .../data/newimpls/VersionedMigrationSet.java    | 153 --------
 .../data/DataMigrationManagerImplTest.java      | 366 +++++++------------
 .../data/MigrationInfoSerializationTest.java    | 112 +++---
 .../data/TestMigrationDataProvider.java         |  61 ++++
 .../migration/data/TestProgressObserver.java    |  24 +-
 .../data/VersionedMigrationSetTest.java         | 198 ++++++++++
 .../newimpls/TestMigrationDataProvider.java     |  61 ----
 .../newimpls/VersionedMigrationSetTest.java     | 194 ----------
 .../persistence/graph/guice/GraphModule.java    |  14 +-
 .../EdgeMetadataSerialization.java              |   2 +-
 .../EdgeMetadataSerializationProxyImpl.java     |   4 +-
 .../impl/migration/EdgeDataMigrationImpl.java   |  12 +-
 .../impl/migration/GraphMigration.java          |  53 +++
 .../impl/migration/GraphMigrationPlugin.java    |   9 +-
 .../graph/guice/TestGraphModule.java            |   5 +-
 .../migration/EdgeDataMigrationImplTest.java    |   4 +-
 .../apache/usergrid/rest/MigrateResource.java   |   4 +-
 53 files changed, 1370 insertions(+), 1295 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/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 9f01feb..62be6cf 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
@@ -21,8 +21,10 @@ 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.CoreMigration;
 import org.apache.usergrid.corepersistence.migration.CoreMigrationPlugin;
 import org.apache.usergrid.corepersistence.migration.EntityTypeMappingMigration;
+import org.apache.usergrid.corepersistence.migration.MigrationModuleVersion;
 import org.apache.usergrid.corepersistence.rx.impl.AllEntitiesInSystemImpl;
 import org.apache.usergrid.corepersistence.rx.impl.AllNodesInGraphImpl;
 import org.apache.usergrid.corepersistence.rx.impl.AllApplicationsObservableImpl;
@@ -34,9 +36,9 @@ import org.apache.usergrid.persistence.collection.guice.CollectionModule;
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.MvccEntityDataMigrationImpl;
 import org.apache.usergrid.persistence.core.guice.CommonModule;
-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.MigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.MigrationPlugin;
 import org.apache.usergrid.persistence.graph.guice.GraphModule;
 import org.apache.usergrid.persistence.graph.serialization.impl.migration.GraphNode;
 import org.apache.usergrid.persistence.index.guice.IndexModule;
@@ -121,12 +123,12 @@ public class CoreModule  extends AbstractModule {
          * Create our migrations for within our core plugin
          *
          */
-        Multibinder<DataMigration2<EntityIdScope>> dataMigrationMultibinder =
-                    Multibinder.newSetBinder( binder(), new TypeLiteral<DataMigration2<EntityIdScope>>() {} );
+        Multibinder<DataMigration<EntityIdScope>> dataMigrationMultibinder =
+                    Multibinder.newSetBinder( binder(), new TypeLiteral<DataMigration<EntityIdScope>>() {}, CoreMigration.class );
 
 
-        dataMigrationMultibinder.addBinding().to( MvccEntityDataMigrationImpl.class );
         dataMigrationMultibinder.addBinding().to( EntityTypeMappingMigration.class );
+        dataMigrationMultibinder.addBinding().to( MigrationModuleVersion.class );
 
 
         //wire up the collection migration plugin

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/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 e0d7daa..3b39bc9 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
@@ -43,7 +43,7 @@ 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.migration.data.newimpls.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.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;
@@ -367,7 +367,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
         this.rebuildApplicationIndexes(applicationId, new ProgressObserver() {
             @Override
             public void onProgress(EntityRef entity) {
-                logger.info("Restored entity {}:{}", entity.getType(), entity.getUuid());
+                logger.info( "Restored entity {}:{}", entity.getType(), entity.getUuid() );
             }
 
         });

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigration.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigration.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigration.java
new file mode 100644
index 0000000..4df32da
--- /dev/null
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/migration/CoreMigration.java
@@ -0,0 +1,53 @@
+/*
+ * 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;/*
+ * 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 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 CoreMigration {}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/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
index b95900f..91c1570 100644
--- 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
@@ -24,9 +24,9 @@ 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 org.apache.usergrid.persistence.core.migration.data.AbstractMigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -43,7 +43,7 @@ public class CoreMigrationPlugin extends AbstractMigrationPlugin<EntityIdScope>
 
 
     @Inject
-    public CoreMigrationPlugin( final Set<DataMigration2<EntityIdScope>> entityDataMigrations,
+    public CoreMigrationPlugin( @CoreMigration final Set<DataMigration<EntityIdScope>> entityDataMigrations,
                                 final MigrationDataProvider<EntityIdScope> entityIdScopeDataMigrationProvider,
                                 final MigrationInfoSerialization migrationInfoSerialization ) {
         super( entityDataMigrations, entityIdScopeDataMigrationProvider, migrationInfoSerialization );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/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 80d7ebe..1a5ef13 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
@@ -26,9 +26,9 @@ import java.util.concurrent.atomic.AtomicLong;
 import org.apache.usergrid.corepersistence.ManagerCache;
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
 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.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.ProgressObserver;
 import org.apache.usergrid.persistence.map.MapManager;
 import org.apache.usergrid.persistence.map.MapScope;
 
@@ -42,7 +42,7 @@ import rx.functions.Func1;
 /**
  * Migration to ensure that our entity id is written into our map data
  */
-public class EntityTypeMappingMigration implements DataMigration2<EntityIdScope> {
+public class EntityTypeMappingMigration implements DataMigration<EntityIdScope> {
 
     private final ManagerCache managerCache;
     private final MigrationDataProvider<EntityIdScope> allEntitiesInSystemObservable;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/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
index 1c124ac..9ddc219 100644
--- 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
@@ -24,9 +24,9 @@ import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntityS
 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.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 org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.ProgressObserver;
 import org.apache.usergrid.persistence.graph.serialization.impl.EdgeMetadataSerializationV2Impl;
 import org.apache.usergrid.persistence.graph.serialization.impl.migration.GraphMigrationPlugin;
 
@@ -37,7 +37,7 @@ 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> {
+public class MigrationModuleVersion implements DataMigration<EntityIdScope> {
 
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AbstractGraphVisitorImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AbstractGraphVisitorImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AbstractGraphVisitorImpl.java
index 07b7a3d..b8cb80b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AbstractGraphVisitorImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/rx/impl/AbstractGraphVisitorImpl.java
@@ -21,10 +21,7 @@ package org.apache.usergrid.corepersistence.rx.impl;
 
 
 import org.apache.usergrid.corepersistence.AllApplicationsObservable;
-import org.apache.usergrid.corepersistence.util.CpNamingUtils;
-import org.apache.usergrid.persistence.collection.CollectionScope;
-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.migration.data.MigrationDataProvider;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.GraphManager;
 import org.apache.usergrid.persistence.graph.GraphManagerFactory;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/MvccEntitySerializationStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/MvccEntitySerializationStrategy.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/MvccEntitySerializationStrategy.java
index de3cab3..7028620 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/MvccEntitySerializationStrategy.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/MvccEntitySerializationStrategy.java
@@ -26,7 +26,7 @@ import java.util.UUID;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntitySet;
 import org.apache.usergrid.persistence.collection.MvccEntity;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedData;
+import org.apache.usergrid.persistence.core.migration.data.VersionedData;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
 import org.apache.usergrid.persistence.model.entity.Id;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyImpl.java
index 19bfc9e..b815ef4 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyImpl.java
@@ -29,8 +29,8 @@ import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerial
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.CollectionMigrationPlugin;
 import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.migration.data.MigrationInfoCache;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Optional;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationModule.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationModule.java
index 241a274..9d6d7fb 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationModule.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationModule.java
@@ -21,20 +21,20 @@ package org.apache.usergrid.persistence.collection.serialization.impl;
 import org.apache.usergrid.persistence.collection.mvcc.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
+import org.apache.usergrid.persistence.collection.serialization.impl.migration.CollectionMigration;
 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.collection.serialization.impl.migration.MvccEntityDataMigrationImpl;
 import org.apache.usergrid.persistence.core.guice.ProxyImpl;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.DataMigration2;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationPlugin;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Inject;
 import com.google.inject.Key;
-import com.google.inject.Provider;
 import com.google.inject.Provides;
 import com.google.inject.Singleton;
 import com.google.inject.TypeLiteral;
@@ -67,8 +67,9 @@ public class SerializationModule extends AbstractModule {
 
         //migrations
         //we want to make sure our generics are retained, so we use a typeliteral
-        Multibinder<DataMigration2<EntityIdScope>> dataMigrationMultibinder =
-                Multibinder.newSetBinder( binder(), new TypeLiteral<DataMigration2<EntityIdScope>>() {} );
+        Multibinder<DataMigration<EntityIdScope>> dataMigrationMultibinder =
+                Multibinder.newSetBinder( binder(), new TypeLiteral<DataMigration<EntityIdScope>>() {},
+                    CollectionMigration.class );
 
 
         dataMigrationMultibinder.addBinding().to( MvccEntityDataMigrationImpl.class );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigration.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigration.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigration.java
new file mode 100644
index 0000000..cec4d6f
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigration.java
@@ -0,0 +1,53 @@
+/*
+ * 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.serialization.impl.migration;/*
+ * 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 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 CollectionMigration {}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigrationPlugin.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigrationPlugin.java
index 0cf25b2..55e42ff 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigrationPlugin.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/CollectionMigrationPlugin.java
@@ -27,9 +27,9 @@ package org.apache.usergrid.persistence.collection.serialization.impl.migration;
 import java.util.Set;
 
 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 org.apache.usergrid.persistence.core.migration.data.AbstractMigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -46,7 +46,8 @@ public class CollectionMigrationPlugin extends AbstractMigrationPlugin<EntityIdS
 
 
     @Inject
-    public CollectionMigrationPlugin( final Set<DataMigration2<EntityIdScope>> entityDataMigrations,
+    public CollectionMigrationPlugin( @CollectionMigration
+                                          final Set<DataMigration<EntityIdScope>> entityDataMigrations,
                                       final MigrationDataProvider<EntityIdScope> entityIdScopeDataMigrationProvider,
                                       final MigrationInfoSerialization migrationInfoSerialization ) {
         super( entityDataMigrations, entityIdScopeDataMigrationProvider, migrationInfoSerialization );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
index 05e5db5..beaaef9 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
@@ -32,7 +32,6 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntityVersionCleanupFactory;
 import org.apache.usergrid.persistence.collection.MvccEntity;
-import org.apache.usergrid.persistence.collection.impl.EntityDeletedTask;
 import org.apache.usergrid.persistence.collection.impl.EntityVersionCleanupTask;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
@@ -41,11 +40,11 @@ import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntityS
 import org.apache.usergrid.persistence.collection.serialization.impl.UniqueValueImpl;
 import org.apache.usergrid.persistence.collection.util.EntityUtils;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationException;
-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.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.ProgressObserver;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.ProgressObserver;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.field.Field;
@@ -68,7 +67,7 @@ import rx.schedulers.Schedulers;
  * Data migration strategy for entities
  */
 @Singleton
-public class MvccEntityDataMigrationImpl implements DataMigration2<EntityIdScope> {
+public class MvccEntityDataMigrationImpl implements DataMigration<EntityIdScope> {
 
 
     private static final Logger LOGGER = LoggerFactory.getLogger( MvccEntityDataMigrationImpl.class );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/guice/TestCollectionModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/guice/TestCollectionModule.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/guice/TestCollectionModule.java
index b42ad94..5718e4f 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/guice/TestCollectionModule.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/guice/TestCollectionModule.java
@@ -20,13 +20,11 @@
 package org.apache.usergrid.persistence.collection.guice;
 
 
-import java.util.Collections;
-
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
 import org.apache.usergrid.persistence.core.guice.CommonModule;
 import org.apache.usergrid.persistence.core.guice.TestModule;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.TestMigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.TestMigrationDataProvider;
 
 import com.google.inject.TypeLiteral;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyV1_3Test.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyV1_3Test.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyV1_3Test.java
index 5c8a61f..42b10c4 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyV1_3Test.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyProxyV1_3Test.java
@@ -29,7 +29,6 @@ import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerial
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.CollectionMigrationPlugin;
 import org.apache.usergrid.persistence.core.guice.ProxyImpl;
 import org.apache.usergrid.persistence.core.migration.data.MigrationInfoSerialization;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
index 9894f07..747ea7b 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
@@ -33,15 +33,13 @@ import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.CollectionDataVersions;
-import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV1Impl;
-import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV3Impl;
 import org.apache.usergrid.persistence.core.guice.DataMigrationResetRule;
 import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
 import org.apache.usergrid.persistence.core.migration.data.TestProgressObserver;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
+import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;
@@ -150,7 +148,7 @@ public abstract class AbstractMvccEntityDataMigrationV1ToV3ImplTest implements D
         final CollectionDataVersions expectedVersion = expectedTargetVersion();
 
         assertEquals( "Correct version returned", newVersion, expectedVersion.getVersion() );
-        assertFalse( "Progress observer should not have failed", progressObserver.getFailed() );
+        assertFalse( "Progress observer should not have failed", progressObserver.isFailed() );
         assertTrue( "Progress observer should have update messages", progressObserver.getUpdates().size() > 0 );
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
index f333fba..7d02b4b 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
@@ -20,42 +20,24 @@
 package org.apache.usergrid.persistence.collection.serialization.impl.migration;
 
 
-import java.util.UUID;
-
 import org.junit.Rule;
-import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
-import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.CollectionDataVersions;
 import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV1Impl;
 import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV3Impl;
-import org.apache.usergrid.persistence.core.guice.DataMigrationResetRule;
 import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
-import org.apache.usergrid.persistence.core.migration.data.TestProgressObserver;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationDataProvider;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationRelationship;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
-import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.google.inject.Inject;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import net.jcip.annotations.NotThreadSafe;
 
-import rx.Observable;
-
 import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV2ToV3ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV2ToV3ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV2ToV3ImplTest.java
index 165105d..1d8c521 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV2ToV3ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV2ToV3ImplTest.java
@@ -26,12 +26,11 @@ import org.junit.runner.RunWith;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.CollectionDataVersions;
-import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV1Impl;
 import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV2Impl;
 import org.apache.usergrid.persistence.collection.serialization.impl.MvccEntitySerializationStrategyV3Impl;
 import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
index 5e61753..bc84b6b 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
@@ -31,7 +31,7 @@ import org.apache.usergrid.persistence.core.astyanax.CassandraConfigImpl;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.consistency.TimeService;
 import org.apache.usergrid.persistence.core.consistency.TimeServiceImpl;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationPlugin;
+import org.apache.usergrid.persistence.core.migration.data.MigrationPlugin;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
 import org.apache.usergrid.persistence.core.migration.schema.MigrationManager;
 import org.apache.usergrid.persistence.core.migration.schema.MigrationManagerFig;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/hystrix/HystrixCassandra.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/hystrix/HystrixCassandra.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/hystrix/HystrixCassandra.java
index 76e0c2d..ab71782 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/hystrix/HystrixCassandra.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/hystrix/HystrixCassandra.java
@@ -30,8 +30,6 @@ import com.netflix.hystrix.HystrixThreadPoolProperties;
 
 /**
  * A utility class that creates graph observables wrapped in Hystrix for timeouts and circuit breakers.
- *
- * TODO USERGRId-405 restore this class before merge
  */
 public class HystrixCassandra {
 
@@ -43,32 +41,32 @@ public class HystrixCassandra {
      */
     public static final HystrixCommand.Setter
             USER_GROUP = HystrixCommand.Setter.withGroupKey(   HystrixCommandGroupKey.Factory.asKey( "user" ) ).andThreadPoolPropertiesDefaults(
-            HystrixThreadPoolProperties.Setter().withCoreSize( 100 ) );
+            HystrixThreadPoolProperties.Setter().withCoreSize( 1000 ) );
 
     /**
      * Command group for asynchronous operations
      */
     public static final HystrixCommand.Setter
             ASYNC_GROUP = HystrixCommand.Setter.withGroupKey( HystrixCommandGroupKey.Factory.asKey( "async" ) ).andThreadPoolPropertiesDefaults(
-            HystrixThreadPoolProperties.Setter().withCoreSize( 50 ) );
+            HystrixThreadPoolProperties.Setter().withCoreSize( 1000 ) );
 
 
     /**
      * Execute an user operation
      */
     public static <R> OperationResult<R> user( final Execution<R> execution) {
-//        return new HystrixCommand<OperationResult<R>>( USER_GROUP ) {
-//
-//            @Override
-//            protected OperationResult<R> run() {
+        return new HystrixCommand<OperationResult<R>>( USER_GROUP ) {
+
+            @Override
+            protected OperationResult<R> run() {
                 try {
                     return  execution.execute();
                 }
                 catch ( ConnectionException e ) {
                     throw new RuntimeException( e );
                 }
-//            }
-//        }.execute();
+            }
+        }.execute();
     }
 
 
@@ -78,18 +76,18 @@ public class HystrixCassandra {
     public static <R> OperationResult<R> async( final Execution<R> execution) {
 
 
-//        return new HystrixCommand<OperationResult<R>>( ASYNC_GROUP ) {
-//
-//            @Override
-//            protected OperationResult<R> run() {
+        return new HystrixCommand<OperationResult<R>>( ASYNC_GROUP ) {
+
+            @Override
+            protected OperationResult<R> run() {
                 try {
                     return  execution.execute();
                 }
                 catch ( ConnectionException e ) {
                     throw new RuntimeException( e );
                 }
-//            }
-//        }.execute();
+            }
+        }.execute();
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java
new file mode 100644
index 0000000..1d351d1
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java
@@ -0,0 +1,128 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+import java.util.Set;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Standard implementation logic for plugins to extend
+ * @param <T>
+ */
+public abstract class AbstractMigrationPlugin<T> implements MigrationPlugin {
+
+
+
+    private static final Logger LOG = LoggerFactory.getLogger( AbstractMigrationPlugin.class );
+
+
+    private final Set<DataMigration<T>> entityDataMigrations;
+    private final MigrationDataProvider<T> entityIdScopeDataMigrationProvider;
+    private final MigrationInfoSerialization migrationInfoSerialization;
+
+
+    protected AbstractMigrationPlugin( final Set<DataMigration<T>> entityDataMigrations,
+                                       final MigrationDataProvider<T> entityIdScopeDataMigrationProvider,
+                                       final MigrationInfoSerialization migrationInfoSerialization ) {
+        this.entityDataMigrations = entityDataMigrations;
+        this.entityIdScopeDataMigrationProvider = entityIdScopeDataMigrationProvider;
+        this.migrationInfoSerialization = migrationInfoSerialization;
+    }
+
+
+    @Override
+    public void run( final ProgressObserver observer ) {
+
+        //run until complete
+        while(runMigration( observer )){
+         LOG.info( "Migration complete, checking for next run" );
+        }
+
+    }
+
+
+    @Override
+    public int getMaxVersion() {
+
+        int max = 0;
+
+        for(DataMigration<T> entityMigration: entityDataMigrations){
+            max = Math.max( max, entityMigration.getMaxVersion() );
+        }
+
+        return max;
+    }
+
+
+    /**
+     * Try to run the migration
+     *
+     * @return True if we ran a migration
+     */
+    private boolean runMigration( final ProgressObserver po ) {
+        DataMigration<T> migrationToExecute = null;
+
+
+        final int version = migrationInfoSerialization.getVersion( getName() );
+
+        for ( DataMigration<T> entityMigration : entityDataMigrations ) {
+            if ( entityMigration.supports( version ) ) {
+                if ( migrationToExecute != null ) {
+                    throw new DataMigrationException(
+                            "Two migrations attempted to migration the same version, this is not allowed.  Class '"
+                                    + migrationToExecute.getClass().getName() + "' and class '" + entityMigration
+                                    .getClass().getName()
+                                    + "' both support this version. This means something is wired incorrectly" );
+                }
+
+                migrationToExecute = entityMigration;
+            }
+        }
+
+        if(migrationToExecute == null){
+            LOG.info( "No migrations found to execute" );
+            return false;
+        }
+
+        po.start();
+
+
+        //run the migration
+        final int newSystemVersion = migrationToExecute.migrate( version, entityIdScopeDataMigrationProvider, po );
+
+        //write the version
+        migrationInfoSerialization.setVersion( getName(), newSystemVersion );
+
+        po.stop();
+
+        //signal we've run a migration and return
+        return true;
+
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigration.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigration.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigration.java
new file mode 100644
index 0000000..ce250cc
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigration.java
@@ -0,0 +1,58 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+/**
+ * Data migration.  The internal version to migrate
+ *
+ * @param <T>
+ */
+public interface DataMigration<T> {
+
+    /**
+     * Perform the migration, returning an observable with a single emitted value
+     * @param currentVersion the current version of the system
+     * @param migrationDataProvider
+     * @param observer The observer to receive updates of the progress
+     *
+     * @return The version that the system is now running
+     */
+    public int migrate(final int currentVersion, MigrationDataProvider<T> migrationDataProvider, ProgressObserver observer);
+
+    /**
+     * Check if this version supports migration from the current system version.  If this returns false,
+     * migrate will not be invoked
+     * @return
+     */
+    public boolean supports(final int currentVersion);
+
+    /**
+     * Get the max version this migration can migrate to
+     * @return
+     */
+    public int getMaxVersion();
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImpl.java
index 41e76e8..7b97e8e 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/DataMigrationManagerImpl.java
@@ -24,19 +24,13 @@ import java.io.StringWriter;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.TimeUnit;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.usergrid.persistence.core.migration.data.newimpls.MigrationPlugin;
-import org.apache.usergrid.persistence.core.migration.data.newimpls.ProgressObserver;
 import org.apache.usergrid.persistence.core.migration.schema.MigrationException;
 
 import com.google.common.base.Preconditions;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
 
@@ -89,6 +83,8 @@ public class DataMigrationManagerImpl implements DataMigrationManager {
             final ProgressObserver observer = new CassandraProgressObserver(plugin.getName());
 
             plugin.run( observer );
+
+
         }
 
 
@@ -98,6 +94,7 @@ public class DataMigrationManagerImpl implements DataMigrationManager {
     @Override
     public boolean isRunning() {
 
+        //we have to get our state from cassandra
         for(final String pluginName :getPluginNames()){
            if( migrationInfoSerialization.getStatusCode(pluginName) == StatusCode.RUNNING.status){
                return true;
@@ -174,6 +171,18 @@ public class DataMigrationManagerImpl implements DataMigrationManager {
 
 
         @Override
+        public void start() {
+            migrationInfoSerialization.setStatusCode( pluginName, StatusCode.RUNNING.status );
+        }
+
+
+        @Override
+        public void stop() {
+            migrationInfoSerialization.setStatusCode( pluginName, StatusCode.COMPLETE.status );
+        }
+
+
+        @Override
         public void failed( final int migrationVersion, final String reason ) {
 
             final String storedMessage = String.format( "Failed to migrate, reason is appended.  Error '%s'", reason );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationDataProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationDataProvider.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationDataProvider.java
new file mode 100644
index 0000000..e232d7b
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationDataProvider.java
@@ -0,0 +1,43 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+import rx.Observable;
+
+
+/**
+ * An interface for data providers to implement.  The migration must take the migrationdata provider as an argument
+ * @param <T>
+ */
+public interface MigrationDataProvider<T> {
+
+
+    /**
+     * Get data that can be used in the migration
+     * @return
+     */
+    public Observable<T> getData();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationPlugin.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationPlugin.java
new file mode 100644
index 0000000..897ce27
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationPlugin.java
@@ -0,0 +1,51 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+
+/**
+ * A simple interface to return migration plugins.  All versions within this migration plugin should have a name
+ */
+public interface MigrationPlugin {
+
+
+    /**
+     * Get the name of the plugin.  Must be unique
+     * @return
+     */
+    public String getName();
+
+    /**
+     * Run any migrations that may need to be run in this plugin
+     */
+    public void run(ProgressObserver observer);
+
+
+    /**
+     * Get the max version this plugin supports
+     * @return
+     */
+    int getMaxVersion();
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationRelationship.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationRelationship.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationRelationship.java
new file mode 100644
index 0000000..806768e
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationRelationship.java
@@ -0,0 +1,100 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+/**
+ * Simple relationship that defines the current state of the source and destination data versions.  Note that
+ * ina current system, the from and then to will be the same instance
+ */
+public class MigrationRelationship<T extends VersionedData> {
+
+    //public so it's FAST.  It's also immutable
+
+
+    public final T from;
+    public final T to;
+
+    private final int fromVersion;
+    private final int toVersion;
+
+
+    public MigrationRelationship( T from, T to ) {
+        this.from = from;
+        this.to = to;
+
+        fromVersion = from.getImplementationVersion();
+        toVersion = to.getImplementationVersion();
+    }
+
+
+    /**
+     * Returns true if we need to perform dual writes.  IE. the from is not the same as the to
+     * @return
+     */
+    public boolean needsMigration(){
+        return fromVersion != toVersion;
+    }
+
+
+    /**
+     * Return true if this is the migration relationship we should use.  The version matches the from
+     * and is <= the to
+     * @param currentVersion
+     * @return
+     */
+    public boolean correctRelationship(final int currentVersion){
+        return currentVersion == fromVersion && currentVersion <= toVersion;
+    }
+
+
+    @Override
+    public boolean equals( final Object o ) {
+        if ( this == o ) {
+            return true;
+        }
+        if ( !( o instanceof MigrationRelationship ) ) {
+            return false;
+        }
+
+        final MigrationRelationship that = ( MigrationRelationship ) o;
+
+        if ( !from.equals( that.from ) ) {
+            return false;
+        }
+        if ( !to.equals( that.to ) ) {
+            return false;
+        }
+
+        return true;
+    }
+
+
+    @Override
+    public int hashCode() {
+        int result = from.hashCode();
+        result = 31 * result + to.hashCode();
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/ProgressObserver.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/ProgressObserver.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/ProgressObserver.java
new file mode 100644
index 0000000..50abc6f
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/ProgressObserver.java
@@ -0,0 +1,63 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+public interface ProgressObserver {
+
+    /**
+     * Signal the process started
+     */
+    public void start();
+
+    /**
+     * Signal the process has stopped
+     */
+    public void stop();
+
+    /**
+     * Mark the migration as failed
+     *
+     * @param migrationVersion The migration version running during the failure
+     * @param reason The reason to save
+     */
+    public void failed( final int migrationVersion, final String reason );
+
+    /**
+     * Mark the migration as failed with a stack trace
+     *
+     * @param migrationVersion The migration version running during the failure
+     * @param reason The error description to save
+     * @param throwable The error that happened
+     */
+    public void failed( final int migrationVersion, final String reason, final Throwable throwable );
+
+
+    /**
+     * Update the status of the migration with the message
+     *
+     * @param message The message to save for the status
+     */
+    public void update( final int migrationVersion, final String message );
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedData.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedData.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedData.java
new file mode 100644
index 0000000..266697a
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedData.java
@@ -0,0 +1,38 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+/**
+ * Marker interface for implementations that may migrate their internal format
+ */
+public interface VersionedData {
+
+    /**
+     * Get the version of the implementation
+     * @return
+     */
+    public int getImplementationVersion();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSet.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSet.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSet.java
new file mode 100644
index 0000000..cadd919
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/VersionedMigrationSet.java
@@ -0,0 +1,153 @@
+/*
+ *
+ *  *
+ *  * 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.core.migration.data;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.base.Preconditions;
+
+
+/**
+ * A set that represents a set of tuples that are used for
+ * @param <T>
+ */
+public class VersionedMigrationSet<T extends VersionedData> {
+
+
+    /**
+     * Cache so that after our initial lookup, it O(1) since this will be used heavily
+     *
+     */
+    private Map<Integer, MigrationRelationship<T>> cacheVersion = new HashMap<>();
+
+    private List<MigrationRelationship<T>> orderedVersions = new ArrayList<>();
+
+
+    /**
+     * Construct this set from a group of tuples.  Imagine the following versions
+     *
+     * v1,
+     * v2,
+     * v3,
+     * v4
+     *
+     * Migrations can jump from v1->v3, but not directly to v4 without an extraneous migration.  This would have 2 relationships
+     *
+     * v1, v3
+     * v2, v3
+     * and
+     * v3, v4
+     *
+     *
+     * @param migrations
+     */
+    public VersionedMigrationSet( final MigrationRelationship<T>... migrations ){
+        Preconditions.checkNotNull(migrations, "versions must not be null");
+        Preconditions.checkArgument( migrations.length > 0, "You must specify at least 1 migrationrelationship" );
+
+        orderedVersions.addAll( Arrays.asList(migrations ) );
+
+        Collections.sort( orderedVersions, new VersionedDataComparator() );
+
+    }
+
+
+    /**
+     * Get the migration relationship based on our current version. This will return a range that includes the current
+     * system version as the source, and the highest version we can roll to in the to field
+     * @param currentVersion
+     * @return The MigrationRelationship.  Note the from and the to could be the same version in a current system.
+     */
+    public MigrationRelationship<T> getMigrationRelationship( final int currentVersion ){
+
+        final MigrationRelationship<T> relationship = cacheVersion.get( currentVersion );
+
+        if(relationship != null){
+            return relationship;
+        }
+
+        //not there, find it.  Not the most efficient, but it happens once per version, which rarely changes, so not a big deal
+
+
+        for(MigrationRelationship<T> current: orderedVersions){
+
+            //not our instance, the from is too high
+            //our from is this instance, so we support this tuple.  Our future is >= as well, so we can perform this I/O
+            if ( current.correctRelationship( currentVersion )) {
+                cacheVersion.put( currentVersion, current );
+                return current;
+            }
+
+        }
+
+        //if we get here, something is wrong
+        throw new IllegalArgumentException( "Could not find a migration version for version " + currentVersion + " min found was " + orderedVersions.get( orderedVersions.size()-1 ) );
+
+
+    }
+
+
+    /**
+     * Given the current system version, return the maximum migration version we can move to
+     * @param currentVersion
+     * @return
+     */
+    public int getMaxVersion(final int currentVersion){
+        return getMigrationRelationship( currentVersion ).to.getImplementationVersion();
+    }
+
+
+
+    /**
+     * Orders from high to low
+     */
+    private final class VersionedDataComparator implements Comparator<MigrationRelationship<T>>
+    {
+
+        @Override
+        public int compare( final MigrationRelationship<T> o1, final MigrationRelationship<T> o2 ) {
+            //Put higher target version first, since that's what we want to match based on current state and source
+
+            //order by the source.  Put highest source first
+            int  compare = Integer.compare( o1.to.getImplementationVersion(), o2.to.getImplementationVersion() ) *-1;
+
+
+            //put higher from first, if we fall within a range here we're good
+            if(compare == 0){
+                compare =  Integer.compare( o1.from.getImplementationVersion(), o2.from.getImplementationVersion() ) *-1;
+            }
+
+            return compare;
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/AbstractMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/AbstractMigrationPlugin.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/AbstractMigrationPlugin.java
deleted file mode 100644
index 17d88d0..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/AbstractMigrationPlugin.java
+++ /dev/null
@@ -1,126 +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.core.migration.data.newimpls;
-
-
-import java.util.Set;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.usergrid.persistence.core.migration.data.DataMigrationException;
-import org.apache.usergrid.persistence.core.migration.data.MigrationInfoSerialization;
-
-
-/**
- * Standard implementation logic for plugins to extend
- * @param <T>
- */
-public abstract class AbstractMigrationPlugin<T> implements MigrationPlugin {
-
-
-
-    private static final Logger LOG = LoggerFactory.getLogger( AbstractMigrationPlugin.class );
-
-
-    private final Set<DataMigration2<T>> entityDataMigrations;
-    private final MigrationDataProvider<T> entityIdScopeDataMigrationProvider;
-    private final MigrationInfoSerialization migrationInfoSerialization;
-
-
-    protected AbstractMigrationPlugin( final Set<DataMigration2<T>> entityDataMigrations,
-                                       final MigrationDataProvider<T> entityIdScopeDataMigrationProvider,
-                                       final MigrationInfoSerialization migrationInfoSerialization ) {
-        this.entityDataMigrations = entityDataMigrations;
-        this.entityIdScopeDataMigrationProvider = entityIdScopeDataMigrationProvider;
-        this.migrationInfoSerialization = migrationInfoSerialization;
-    }
-
-
-    @Override
-    public void run( final ProgressObserver observer ) {
-
-        //run until complete
-        while(runMigration( observer )){
-         LOG.info( "Migration complete, checking for next run" );
-        }
-
-    }
-
-
-    @Override
-    public int getMaxVersion() {
-
-        int max = 0;
-
-        for(DataMigration2<T> entityMigration: entityDataMigrations){
-            max = Math.max( max, entityMigration.getMaxVersion() );
-        }
-
-        return max;
-    }
-
-
-    /**
-     * Try to run the migration
-     *
-     * @return True if we ran a migration
-     */
-    private boolean runMigration( final ProgressObserver po ) {
-        DataMigration2<T> migrationToExecute = null;
-
-
-        final int version = migrationInfoSerialization.getVersion( getName() );
-
-        for ( DataMigration2<T> entityMigration : entityDataMigrations ) {
-            if ( entityMigration.supports( version ) ) {
-                if ( migrationToExecute != null ) {
-                    throw new DataMigrationException(
-                            "Two migrations attempted to migration the same version, this is not allowed.  Class '"
-                                    + migrationToExecute.getClass().getName() + "' and class '" + entityMigration
-                                    .getClass().getName()
-                                    + "' both support this version. This means something is wired incorrectly" );
-                }
-
-                migrationToExecute = entityMigration;
-            }
-        }
-
-        if(migrationToExecute == null){
-            LOG.info( "No migrations found to execute" );
-            return false;
-        }
-
-        //run the migration
-        final int newSystemVersion = migrationToExecute.migrate( version, entityIdScopeDataMigrationProvider, po );
-
-        //write the version
-        migrationInfoSerialization.setVersion( getName(), newSystemVersion );
-
-        //signal we've run a migration and return
-        return true;
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf32557a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/DataMigration2.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/DataMigration2.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/DataMigration2.java
deleted file mode 100644
index 303c11c..0000000
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/newimpls/DataMigration2.java
+++ /dev/null
@@ -1,58 +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.core.migration.data.newimpls;
-
-
-/**
- * Data migration.  The internal version to migrate
- *
- * @param <T>
- */
-public interface DataMigration2<T> {
-
-    /**
-     * Perform the migration, returning an observable with a single emitted value
-     * @param currentVersion the current version of the system
-     * @param migrationDataProvider
-     * @param observer The observer to receive updates of the progress
-     *
-     * @return The version that the system is now running
-     */
-    public int migrate(final int currentVersion, MigrationDataProvider<T> migrationDataProvider, ProgressObserver observer);
-
-    /**
-     * Check if this version supports migration from the current system version.  If this returns false,
-     * migrate will not be invoked
-     * @return
-     */
-    public boolean supports(final int currentVersion);
-
-    /**
-     * Get the max version this migration can migrate to
-     * @return
-     */
-    public int getMaxVersion();
-
-
-}