usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [09/33] usergrid git commit: MapSerialization schema now created by DataStax driver. Add getTables into Migration interface for creating schema via DataStax driver and CQL.
Date Wed, 11 May 2016 05:46:02 GMT
MapSerialization schema now created by DataStax driver.  Add getTables into Migration interface
for creating schema via DataStax driver and CQL.


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

Branch: refs/heads/datastax-cass-driver
Commit: c0f8a4a28576ab58b1eb0b173a73966655a863c1
Parents: 25454f9
Author: Michael Russo <michaelarusso@gmail.com>
Authored: Fri Feb 12 16:34:04 2016 -0800
Committer: Michael Russo <michaelarusso@gmail.com>
Committed: Fri Feb 12 16:34:04 2016 -0800

----------------------------------------------------------------------
 .../MvccEntitySerializationStrategyImpl.java    |   7 +
 ...vccEntitySerializationStrategyProxyImpl.java |   6 +
 .../MvccEntitySerializationStrategyV3Impl.java  |   7 +
 .../MvccLogEntrySerializationProxyImpl.java     |   6 +
 ...MvccLogEntrySerializationStrategyV1Impl.java |   7 +
 ...MvccLogEntrySerializationStrategyV2Impl.java |   7 +
 ...iqueValueSerializationStrategyProxyImpl.java |   6 +
 .../UniqueValueSerializationStrategyV1Impl.java |   8 +
 .../UniqueValueSerializationStrategyV2Impl.java |   7 +
 .../persistence/core/datastax/CQLUtils.java     |   4 +-
 .../data/MigrationInfoSerializationImpl.java    |   7 +
 .../core/migration/schema/Migration.java        |   3 +-
 .../migration/schema/MigrationManagerImpl.java  |  43 ++++-
 .../map/impl/MapSerializationImpl.java          | 172 +++++--------------
 .../persistence/map/MapManagerTest.java         |   1 +
 15 files changed, 153 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
index 57199e2..3e2d391 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
@@ -25,6 +25,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.UUID;
 
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -342,6 +343,12 @@ public abstract class MvccEntitySerializationStrategyImpl implements
MvccEntityS
         return Collections.singleton( cf );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     /**
      * Do the write on the correct row for the entity id with the operation

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/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 1fe342e..19735cc 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
@@ -27,6 +27,7 @@ import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.CollectionMigrationPlugin;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.migration.data.MigrationInfoCache;
 import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
 import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
@@ -186,6 +187,11 @@ public class MvccEntitySerializationStrategyProxyImpl implements MvccEntitySeria
         return Collections.emptyList();
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+        return Collections.emptyList();
+    }
+
 
     @Override
     public int getImplementationVersion() {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
index 57607d0..2fa5d09 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.JsonFactory;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.netflix.astyanax.serializers.StringSerializer;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -304,6 +305,12 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
         return Collections.singleton( cf );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     /**
      * Do the write on the correct row for the entity id with the operation

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationProxyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationProxyImpl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationProxyImpl.java
index 8e34f01..b27651d 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationProxyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationProxyImpl.java
@@ -30,6 +30,7 @@ import org.apache.usergrid.persistence.collection.VersionSet;
 import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.CollectionMigrationPlugin;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.migration.data.MigrationInfoCache;
 import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
 import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
@@ -146,6 +147,11 @@ public class MvccLogEntrySerializationProxyImpl implements MvccLogEntrySerializa
         return Collections.emptyList();
     }
 
+    @Override
+    public Collection<TableDefinition> getTables(){
+        return Collections.emptyList();
+    }
+
 
     @Override
     public int getImplementationVersion() {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV1Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV1Impl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV1Impl.java
index e0c0909..62c35bb 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV1Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV1Impl.java
@@ -35,6 +35,7 @@ import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.inject.Inject;
@@ -115,4 +116,10 @@ public class MvccLogEntrySerializationStrategyV1Impl
 
         return Collections.singleton( cf );
     }
+
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV2Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV2Impl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV2Impl.java
index 1bfc289..325762d 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV2Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV2Impl.java
@@ -35,6 +35,7 @@ import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.inject.Inject;
@@ -103,4 +104,10 @@ public class MvccLogEntrySerializationStrategyV2Impl extends MvccLogEntrySeriali
 
         return Collections.singleton( cf );
     }
+
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyProxyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyProxyImpl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyProxyImpl.java
index 1de4052..87b1641 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyProxyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyProxyImpl.java
@@ -29,6 +29,7 @@ import org.apache.usergrid.persistence.collection.serialization.UniqueValueSeria
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSet;
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.CollectionMigrationPlugin;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.migration.data.MigrationInfoCache;
 import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
 import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
@@ -171,6 +172,11 @@ public class UniqueValueSerializationStrategyProxyImpl implements UniqueValueSer
         return Collections.emptyList();
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+        return Collections.emptyList();
+    }
+
 
     @Override
     public int getImplementationVersion() {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV1Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV1Impl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV1Impl.java
index 6a1cb58..dafbf2b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV1Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV1Impl.java
@@ -22,6 +22,7 @@ package org.apache.usergrid.persistence.collection.serialization.impl;
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 
 import org.apache.cassandra.db.marshal.BytesType;
 
@@ -33,6 +34,7 @@ import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.field.Field;
 
@@ -99,6 +101,12 @@ public class UniqueValueSerializationStrategyV1Impl  extends UniqueValueSerializ
         return Arrays.asList( uniqueLookupCF, uniqueLogCF );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     @Override
     protected MultiTenantColumnFamily<ScopedRowKey<CollectionPrefixedKey<Field>>,
EntityVersion> getUniqueValuesCF() {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV2Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV2Impl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV2Impl.java
index 40622a4..17b8b37 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV2Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV2Impl.java
@@ -22,6 +22,7 @@ package org.apache.usergrid.persistence.collection.serialization.impl;
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 
 import org.apache.cassandra.db.marshal.BytesType;
 
@@ -33,6 +34,7 @@ import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.field.Field;
 
@@ -99,6 +101,11 @@ public class UniqueValueSerializationStrategyV2Impl  extends UniqueValueSerializ
         return Arrays.asList( uniqueLookupCF, uniqueLogCF );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
 
     @Override
     protected MultiTenantColumnFamily<ScopedRowKey<TypeField>, EntityVersion>
getUniqueValuesCF() {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/CQLUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/CQLUtils.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/CQLUtils.java
index 7dee9c8..f2e4f57 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/CQLUtils.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/CQLUtils.java
@@ -30,7 +30,7 @@ import java.util.*;
 public class CQLUtils {
 
 
-    enum ACTION {
+    public enum ACTION {
         CREATE, UPDATE
     }
 
@@ -84,7 +84,7 @@ public class CQLUtils {
             throw new Exception("Invalid Action specified.  Must of of type CQLUtils.Action");
         }
 
-        cql.add( quote( tableDefinition.getTableName() ) );
+        cql.add( tableDefinition.getTableName() );
 
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationImpl.java
index e02cafe..18427f7 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationImpl.java
@@ -27,6 +27,7 @@ import org.apache.cassandra.db.marshal.BytesType;
 import org.apache.cassandra.db.marshal.UTF8Type;
 
 import org.apache.usergrid.persistence.core.astyanax.*;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.migration.util.AstayanxUtils;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
@@ -205,4 +206,10 @@ public class MigrationInfoSerializationImpl implements MigrationInfoSerializatio
                         UTF8Type.class.getSimpleName(), BytesType.class.getSimpleName(),
                         MultiTenantColumnFamilyDefinition.CacheOption.KEYS ) );
     }
+
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/Migration.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/Migration.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/Migration.java
index 3896df2..952f898 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/Migration.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/Migration.java
@@ -22,6 +22,7 @@ package org.apache.usergrid.persistence.core.migration.schema;
 import java.util.Collection;
 
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 
 
 /**
@@ -34,5 +35,5 @@ public interface Migration {
      */
     Collection<MultiTenantColumnFamilyDefinition> getColumnFamilies();
 
-    //Collection<String> getTables();
+    Collection<TableDefinition> getTables();
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
index 8eb0576..39a78b7 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
@@ -26,6 +26,7 @@ import com.datastax.driver.core.Session;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.datastax.CQLUtils;
 import org.apache.usergrid.persistence.core.datastax.DataStaxCluster;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,17 +80,35 @@ public class MigrationManagerImpl implements MigrationManager {
 
                 final Collection<MultiTenantColumnFamilyDefinition> columnFamilies
= migration.getColumnFamilies();
 
+                final Collection<TableDefinition> tables = migration.getTables();
 
-                if ( columnFamilies == null || columnFamilies.size() == 0 ) {
+
+                if ((columnFamilies == null || columnFamilies.size() == 0) &&
+                    (tables == null || tables.size() == 0)) {
                     logger.warn(
-                            "Class {} implements {} but returns null column families for
migration.  Either implement this method or remove the interface from the class",
-                            migration.getClass(), Migration.class );
+                        "Class {} implements {} but returns null for getColumnFamilies and
getTables for migration.  Either implement this method or remove the interface from the class",
+                        migration.getClass().getSimpleName(), Migration.class.getSimpleName());
                     continue;
                 }
 
-                for ( MultiTenantColumnFamilyDefinition cf : columnFamilies ) {
-                    testAndCreateColumnFamilyDef( cf );
+                if (columnFamilies != null && columnFamilies.isEmpty()) {
+                    for (MultiTenantColumnFamilyDefinition cf : columnFamilies) {
+                        testAndCreateColumnFamilyDef(cf);
+                    }
+                }
+
+
+                if ( tables != null && !tables.isEmpty() ) {
+                    for (TableDefinition tableDefinition : tables) {
+
+                        createTable(tableDefinition);
+
+                    }
                 }
+
+
+
+
             }
         }
         catch ( Throwable t ) {
@@ -120,6 +139,20 @@ public class MigrationManagerImpl implements MigrationManager {
         waitForSchemaAgreement();
     }
 
+    private void createTable(TableDefinition tableDefinition ) throws Exception {
+
+        logger.info("Creating, if not exists, table: {}", tableDefinition.getTableName());
+        String CQL = CQLUtils.getTableCQL( tableDefinition, CQLUtils.ACTION.CREATE );
+        logger.info( CQL );
+        if (logger.isDebugEnabled()){
+            logger.debug( CQL );
+        }
+        dataStaxCluster.getApplicationSession()
+            .execute( CQL );
+
+        waitForSchemaAgreement();
+    }
+
 
     /**
      * Execute CQL to create the keyspace if it does not already exists.  Always update the
keyspace with the

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
index 5fc6ee1..958b6f2 100644
--- a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
+++ b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
@@ -21,30 +21,17 @@ package org.apache.usergrid.persistence.map.impl;
 
 
 import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import java.util.*;
 
 import com.datastax.driver.core.*;
 import com.datastax.driver.core.querybuilder.Clause;
 import com.datastax.driver.core.querybuilder.QueryBuilder;
 import com.datastax.driver.core.querybuilder.Using;
-import org.apache.cassandra.db.marshal.BytesType;
-import org.apache.cassandra.db.marshal.UTF8Type;
 
-import org.apache.usergrid.persistence.core.astyanax.BucketScopedRowKey;
-import org.apache.usergrid.persistence.core.astyanax.BucketScopedRowKeySerializer;
 import org.apache.usergrid.persistence.core.astyanax.CassandraConfig;
-import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
-import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
-import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
-import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
 import org.apache.usergrid.persistence.core.datastax.CQLUtils;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.shard.ExpandingShardLocator;
 import org.apache.usergrid.persistence.core.shard.StringHashUtils;
 import org.apache.usergrid.persistence.map.MapScope;
@@ -53,52 +40,41 @@ import com.google.common.base.Preconditions;
 import com.google.common.hash.Funnel;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
-import com.netflix.astyanax.Keyspace;
-import com.netflix.astyanax.model.CompositeBuilder;
-import com.netflix.astyanax.model.CompositeParser;
-import com.netflix.astyanax.serializers.BooleanSerializer;
-import com.netflix.astyanax.serializers.StringSerializer;
 
 
 @Singleton
 public class MapSerializationImpl implements MapSerialization {
 
-    private static final String MAP_KEYS_TABLE = CQLUtils.quote("Map_Keys");
-    private static final String MAP_ENTRIES_TABLE = CQLUtils.quote("Map_Entries");
-
-    private static final MapKeySerializer KEY_SERIALIZER = new MapKeySerializer();
-
-    private static final BucketScopedRowKeySerializer<String> MAP_KEY_SERIALIZER =
-        new BucketScopedRowKeySerializer<>( KEY_SERIALIZER );
-
 
-    private static final MapEntrySerializer ENTRY_SERIALIZER = new MapEntrySerializer();
-    private static final ScopedRowKeySerializer<MapEntryKey> MAP_ENTRY_SERIALIZER =
-        new ScopedRowKeySerializer<>( ENTRY_SERIALIZER );
+    private static final String MAP_ENTRIES_TABLE = CQLUtils.quote("Map_Entries");
+    private static final Collection<String> MAP_ENTRIES_PARTITION_KEYS = Collections.singletonList("key");
+    private static final Collection<String> MAP_ENTRIES_COLUMN_KEYS = Collections.singletonList("column1");
+    private static final Map<String, String> MAP_ENTRIES_COLUMNS =
+        new HashMap<String, String>() {{
+            put( "key", "blob");
+            put( "column1", "blob");
+            put( "value", "blob"); }};
+    private static final Map<String, String> MAP_ENTRIES_CLUSTERING_ORDER =
+        new HashMap<String, String>(){{ put("column1", "ASC"); }};
 
+    private static final String MAP_KEYS_TABLE = CQLUtils.quote("Map_Keys");
+    private static final Collection<String> MAP_KEYS_PARTITION_KEYS = Collections.singletonList("key");
+    private static final Collection<String> MAP_KEYS_COLUMN_KEYS = Collections.singletonList("column1");
+    private static final Map<String, String> MAP_KEYS_COLUMNS =
+        new HashMap<String, String>() {{
+            put( "key", "blob");
+            put( "column1", "blob");
+            put( "value", "blob"); }};
+    private static final Map<String, String> MAP_KEYS_CLUSTERING_ORDER =
+        new HashMap<String, String>(){{ put("column1", "ASC"); }};
 
-    private static final BooleanSerializer BOOLEAN_SERIALIZER = BooleanSerializer.get();
 
-    private static final StringSerializer STRING_SERIALIZER = StringSerializer.get();
 
 
     private static final StringResultsBuilderCQL STRING_RESULTS_BUILDER_CQL = new StringResultsBuilderCQL();
 
 
     /**
-     * CFs where the row key contains the source node id
-     */
-    public static final MultiTenantColumnFamily<ScopedRowKey<MapEntryKey>, Boolean>
MAP_ENTRIES =
-        new MultiTenantColumnFamily<>( "Map_Entries", MAP_ENTRY_SERIALIZER, BOOLEAN_SERIALIZER
);
-
-
-    /**
-     * CFs where the row key contains the source node id
-     */
-    public static final MultiTenantColumnFamily<BucketScopedRowKey<String>, String>
MAP_KEYS =
-        new MultiTenantColumnFamily<>( "Map_Keys", MAP_KEY_SERIALIZER, STRING_SERIALIZER
);
-
-    /**
      * Number of buckets to hash across.
      */
     private static final int[] NUM_BUCKETS = { 20 };
@@ -115,16 +91,13 @@ public class MapSerializationImpl implements MapSerialization {
     private static final ExpandingShardLocator<String> BUCKET_LOCATOR =
         new ExpandingShardLocator<>( MAP_KEY_FUNNEL, NUM_BUCKETS );
 
-    private final Keyspace keyspace;
     private final CassandraConfig cassandraConfig;
 
     private final Session session;
 
 
     @Inject
-    public MapSerializationImpl( final Keyspace keyspace, final CassandraConfig cassandraConfig,
-                                 final Session session ) {
-        this.keyspace = keyspace;
+    public MapSerializationImpl( final CassandraConfig cassandraConfig, final Session session
) {
         this.session = session;
         this.cassandraConfig = cassandraConfig;
     }
@@ -321,17 +294,27 @@ public class MapSerializationImpl implements MapSerialization {
     @Override
     public Collection<MultiTenantColumnFamilyDefinition> getColumnFamilies() {
 
-        final MultiTenantColumnFamilyDefinition mapEntries =
-            new MultiTenantColumnFamilyDefinition( MAP_ENTRIES, BytesType.class.getSimpleName(),
-                BytesType.class.getSimpleName(), BytesType.class.getSimpleName(),
-                MultiTenantColumnFamilyDefinition.CacheOption.KEYS );
+        // This here only until all traces of Astyanax are removed.
+        return Collections.emptyList();
+
+    }
+
+
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        final TableDefinition mapEntries =
+            new TableDefinition( MAP_ENTRIES_TABLE, MAP_ENTRIES_PARTITION_KEYS, MAP_ENTRIES_COLUMN_KEYS,
+                MAP_ENTRIES_COLUMNS, TableDefinition.CacheOption.KEYS, MAP_ENTRIES_CLUSTERING_ORDER);
+
+        final TableDefinition mapKeys =
+            new TableDefinition( MAP_KEYS_TABLE, MAP_KEYS_PARTITION_KEYS, MAP_KEYS_COLUMN_KEYS,
+                MAP_KEYS_COLUMNS, TableDefinition.CacheOption.KEYS, MAP_KEYS_CLUSTERING_ORDER);
+
 
-        final MultiTenantColumnFamilyDefinition mapKeys =
-            new MultiTenantColumnFamilyDefinition( MAP_KEYS, BytesType.class.getSimpleName(),
-                UTF8Type.class.getSimpleName(), BytesType.class.getSimpleName(),
-                MultiTenantColumnFamilyDefinition.CacheOption.KEYS );
 
         return Arrays.asList( mapEntries, mapKeys );
+
     }
 
 
@@ -350,6 +333,7 @@ public class MapSerializationImpl implements MapSerialization {
 
 
 
+
     private <T> T getValuesCQL( final MapScope scope, final Collection<String>
keys, final ResultsBuilderCQL<T> builder ) {
 
         final List<ByteBuffer> serializedKeys = new ArrayList<>();
@@ -368,78 +352,6 @@ public class MapSerializationImpl implements MapSerialization {
 
 
 
-
-    /**
-     * Inner class to serialize and edgeIdTypeKey
-     */
-    private static class MapKeySerializer implements CompositeFieldSerializer<String>
{
-
-
-        @Override
-        public void toComposite( final CompositeBuilder builder, final String key ) {
-            builder.addString( key );
-        }
-
-
-        @Override
-        public String fromComposite( final CompositeParser composite ) {
-            final String key = composite.readString();
-
-            return key;
-        }
-    }
-
-
-    /**
-     * Inner class to serialize and edgeIdTypeKey
-     */
-    private static class MapEntrySerializer implements CompositeFieldSerializer<MapEntryKey>
{
-
-        @Override
-        public void toComposite( final CompositeBuilder builder, final MapEntryKey key )
{
-
-            builder.addString( key.mapName );
-            builder.addString( key.key );
-        }
-
-
-        @Override
-        public MapEntryKey fromComposite( final CompositeParser composite ) {
-
-            final String mapName = composite.readString();
-
-            final String entryKey = composite.readString();
-
-            return new MapEntryKey( mapName, entryKey );
-        }
-    }
-
-
-    /**
-     * Entries for serializing map entries and keys to a row
-     */
-    private static class MapEntryKey {
-        public final String mapName;
-        public final String key;
-
-
-        private MapEntryKey( final String mapName, final String key ) {
-            this.mapName = mapName;
-            this.key = key;
-        }
-
-
-        /**
-         * Create a scoped row key from the key
-         */
-        public static ScopedRowKey<MapEntryKey> fromKey( final MapScope mapScope, final
String key ) {
-
-            return ScopedRowKey.fromKey( mapScope.getApplication(), new MapEntryKey( mapScope.getName(),
key ) );
-        }
-    }
-
-
-
     /**
      * Build the results from the row keys
      */

http://git-wip-us.apache.org/repos/asf/usergrid/blob/c0f8a4a2/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
index 2a68247..bd109d1 100644
--- a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
+++ b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
@@ -27,6 +27,7 @@ import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
 import org.junit.Before;
+import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;


Mime
View raw message