http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV1Impl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV1Impl.java
index 62c35bb,62c35bb..0bf48d7
--- 
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,7 -35,7 +35,7 @@@ import org.apache.usergrid.persistence.
  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.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.model.entity.Id;
  
  import com.google.inject.Inject;
@@@ -118,7 -118,7 +118,7 @@@ public class MvccLogEntrySerializationS
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV2Impl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyV2Impl.java
index 325762d,325762d..28e0723
--- 
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,7 -35,7 +35,7 @@@ import org.apache.usergrid.persistence.
  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.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.model.entity.Id;
  
  import com.google.inject.Inject;
@@@ -106,7 -106,7 +106,7 @@@ public class MvccLogEntrySerializationS
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
index 0753281,0753281..14639cf
--- 
a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
+++ 
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
@@@ -29,7 -29,7 +29,7 @@@ import com.datastax.driver.core.querybu
  import com.datastax.driver.core.querybuilder.Using;
  import org.apache.usergrid.persistence.core.CassandraConfig;
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.model.entity.SimpleId;
  import org.apache.usergrid.persistence.model.field.*;
  
@@@ -47,9 -47,9 +47,6 @@@ import org.apache.usergrid.persistence.
  
  import com.google.common.base.Preconditions;
  
--import com.netflix.astyanax.ColumnListMutation;
--
--
  
  /**
   * Reads and writes to UniqueValues column family.
@@@ -498,12 -498,12 +495,12 @@@ public abstract class UniqueValueSerial
      public abstract Collection<MultiTenantColumnFamilyDefinition> 
getColumnFamilies();
  
      @Override
--    public abstract Collection<TableDefinition> getTables();
++    public abstract Collection<TableDefinitionImpl> getTables();
  
      /**
       * Get the CQL table definition for the unique values log table
       */
--    protected abstract TableDefinition getUniqueValuesTable();
++    protected abstract TableDefinitionImpl getUniqueValuesTable();
  
  
      protected abstract List<Object> deserializePartitionKey(ByteBuffer bb);
@@@ -525,7 -525,7 +522,7 @@@
      /**
       * Get the CQL table definition for the unique values log table
       */
--    protected abstract TableDefinition getEntityUniqueLogTable();
++    protected abstract TableDefinitionImpl getEntityUniqueLogTable();
  
  
      public class AllUniqueFieldsIterator implements Iterable<UniqueValue>, 
Iterator<UniqueValue> {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyProxyImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyProxyImpl.java
index 61f0f80,61f0f80..6bb03ac
--- 
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
@@@ -31,7 -31,7 +31,7 @@@ import org.apache.usergrid.persistence.
  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.datastax.impl.TableDefinitionImpl;
  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;
@@@ -164,7 -164,7 +164,7 @@@ public class UniqueValueSerializationSt
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
          return Collections.emptyList();
      }
  

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV1Impl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV1Impl.java
index 1435c1e,1435c1e..9f59906
--- 
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
@@@ -33,7 -33,7 +33,7 @@@ import org.apache.usergrid.persistence.
  import org.apache.usergrid.persistence.core.CassandraFig;
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
  import org.apache.usergrid.persistence.core.datastax.CQLUtils;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.model.entity.Id;
  import org.apache.usergrid.persistence.model.field.Field;
  
@@@ -73,13 -73,13 +73,13 @@@ public class UniqueValueSerializationSt
          new HashMap<String, String>(){{ put( "column1", "ASC" ); }};
  
  
--    private final static TableDefinition uniqueValues =
--        new TableDefinition( UNIQUE_VALUES_TABLE, 
UNIQUE_VALUES_PARTITION_KEYS, UNIQUE_VALUES_COLUMN_KEYS,
--            UNIQUE_VALUES_COLUMNS, TableDefinition.CacheOption.KEYS, 
UNIQUE_VALUES_CLUSTERING_ORDER);
++    private final static TableDefinitionImpl uniqueValues =
++        new TableDefinitionImpl( UNIQUE_VALUES_TABLE, 
UNIQUE_VALUES_PARTITION_KEYS, UNIQUE_VALUES_COLUMN_KEYS,
++            UNIQUE_VALUES_COLUMNS, TableDefinitionImpl.CacheOption.KEYS, 
UNIQUE_VALUES_CLUSTERING_ORDER);
  
--    private final static TableDefinition uniqueValuesLog =
--        new TableDefinition( UNIQUE_VALUES_LOG_TABLE, 
UNIQUE_VALUES_LOG_PARTITION_KEYS, UNIQUE_VALUES_LOG_COLUMN_KEYS,
--            UNIQUE_VALUES_LOG_COLUMNS, TableDefinition.CacheOption.KEYS, 
UNIQUE_VALUES_LOG_CLUSTERING_ORDER);
++    private final static TableDefinitionImpl uniqueValuesLog =
++        new TableDefinitionImpl( UNIQUE_VALUES_LOG_TABLE, 
UNIQUE_VALUES_LOG_PARTITION_KEYS, UNIQUE_VALUES_LOG_COLUMN_KEYS,
++            UNIQUE_VALUES_LOG_COLUMNS, TableDefinitionImpl.CacheOption.KEYS, 
UNIQUE_VALUES_LOG_CLUSTERING_ORDER);
  
  
  
@@@ -106,10 -106,10 +106,10 @@@
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
--        final TableDefinition uniqueValues = getUniqueValuesTable();
--        final TableDefinition uniqueValuesLog = getEntityUniqueLogTable();
++        final TableDefinitionImpl uniqueValues = getUniqueValuesTable();
++        final TableDefinitionImpl uniqueValuesLog = getEntityUniqueLogTable();
  
          return Arrays.asList( uniqueValues, uniqueValuesLog );
  
@@@ -118,14 -118,14 +118,14 @@@
  
  
      @Override
--    protected TableDefinition getUniqueValuesTable(){
++    protected TableDefinitionImpl getUniqueValuesTable(){
  
          return uniqueValues;
      }
  
  
      @Override
--    protected TableDefinition getEntityUniqueLogTable(){
++    protected TableDefinitionImpl getEntityUniqueLogTable(){
  
          return uniqueValuesLog;
  

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV2Impl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyV2Impl.java
index 518937d,518937d..1af4846
--- 
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
@@@ -27,13 -27,13 +27,12 @@@ import com.datastax.driver.core.DataTyp
  import com.datastax.driver.core.ProtocolVersion;
  import com.datastax.driver.core.Session;
  
--import org.apache.cassandra.utils.ByteBufferUtil;
  import 
org.apache.usergrid.persistence.collection.serialization.SerializationFig;
  import org.apache.usergrid.persistence.core.CassandraConfig;
  import org.apache.usergrid.persistence.core.CassandraFig;
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
  import org.apache.usergrid.persistence.core.datastax.CQLUtils;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.model.entity.Id;
  
  import com.google.inject.Inject;
@@@ -69,13 -69,13 +68,13 @@@ public class UniqueValueSerializationSt
      private static final Map<String, String> 
UNIQUE_VALUES_LOG_CLUSTERING_ORDER =
          new HashMap<String, String>(){{ put( "column1", "ASC" );}};
  
--    private final static TableDefinition uniqueValues =
--        new TableDefinition( UNIQUE_VALUES_TABLE, 
UNIQUE_VALUES_PARTITION_KEYS, UNIQUE_VALUES_COLUMN_KEYS,
--            UNIQUE_VALUES_COLUMNS, TableDefinition.CacheOption.KEYS, 
UNIQUE_VALUES_CLUSTERING_ORDER);
++    private final static TableDefinitionImpl uniqueValues =
++        new TableDefinitionImpl( UNIQUE_VALUES_TABLE, 
UNIQUE_VALUES_PARTITION_KEYS, UNIQUE_VALUES_COLUMN_KEYS,
++            UNIQUE_VALUES_COLUMNS, TableDefinitionImpl.CacheOption.KEYS, 
UNIQUE_VALUES_CLUSTERING_ORDER);
  
--    private final static TableDefinition uniqueValuesLog =
--        new TableDefinition( UNIQUE_VALUES_LOG_TABLE, 
UNIQUE_VALUES_LOG_PARTITION_KEYS, UNIQUE_VALUES_LOG_COLUMN_KEYS,
--            UNIQUE_VALUES_LOG_COLUMNS, TableDefinition.CacheOption.KEYS, 
UNIQUE_VALUES_LOG_CLUSTERING_ORDER);
++    private final static TableDefinitionImpl uniqueValuesLog =
++        new TableDefinitionImpl( UNIQUE_VALUES_LOG_TABLE, 
UNIQUE_VALUES_LOG_PARTITION_KEYS, UNIQUE_VALUES_LOG_COLUMN_KEYS,
++            UNIQUE_VALUES_LOG_COLUMNS, TableDefinitionImpl.CacheOption.KEYS, 
UNIQUE_VALUES_LOG_CLUSTERING_ORDER);
  
  
      /**
@@@ -102,10 -102,10 +101,10 @@@
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
--        final TableDefinition uniqueValues = getUniqueValuesTable();
--        final TableDefinition uniqueValuesLog = getEntityUniqueLogTable();
++        final TableDefinitionImpl uniqueValues = getUniqueValuesTable();
++        final TableDefinitionImpl uniqueValuesLog = getEntityUniqueLogTable();
  
          return Arrays.asList( uniqueValues, uniqueValuesLog );
  
@@@ -113,13 -113,13 +112,13 @@@
  
  
      @Override
--    protected TableDefinition getUniqueValuesTable(){
++    protected TableDefinitionImpl getUniqueValuesTable(){
          return uniqueValues;
      }
  
  
      @Override
--    protected TableDefinition getEntityUniqueLogTable(){
++    protected TableDefinitionImpl getEntityUniqueLogTable(){
          return uniqueValuesLog;
      }
  

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/CQLUtils.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/CQLUtils.java
index 0d6a312,0d6a312..698915b
--- 
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
@@@ -23,43 -23,43 +23,23 @@@ import com.fasterxml.jackson.core.JsonP
  import com.fasterxml.jackson.databind.ObjectMapper;
  import com.google.inject.Inject;
  import org.apache.usergrid.persistence.core.CassandraFig;
--import org.apache.usergrid.persistence.core.util.StringUtils;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  
  import java.nio.ByteBuffer;
  import java.util.*;
  
  public class CQLUtils {
  
--    private final CassandraFig cassandraFig;
      private final static ObjectMapper mapper = new ObjectMapper();
  
--    public enum ACTION {
--        CREATE, UPDATE
--    }
--
      static String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS";
      static String ALTER_TABLE = "ALTER TABLE";
--    static String WITH ="WITH";
--    static String AND = "AND";
--    static String EQUAL = "=";
--    static String COMPRESSION = "compression";
--    static String COMPACTION = "compaction";
--    static String CACHING = "caching";
--    static String GC_GRACE_SECONDS = "gc_grace_seconds";
--    static String PRIMARY_KEY = "PRIMARY KEY";
--    static String COMPACT_STORAGE = "COMPACT STORAGE";
--    static String CLUSTERING_ORDER_BY = "CLUSTERING ORDER BY";
--    static String COMMA = ",";
--    static String PAREN_LEFT = "(";
--    static String PAREN_RIGHT = ")";
  
      static String COMPOSITE_TYPE = 
"'org.apache.cassandra.db.marshal.DynamicCompositeType(a=>org.apache.cassandra.db.marshal.AsciiType,A=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.AsciiType),b=>org.apache.cassandra.db.marshal.BytesType,B=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.BytesType),i=>org.apache.cassandra.db.marshal.IntegerType,I=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.IntegerType),l=>org.apache.cassandra.db.marshal.LongType,L=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.LongType),s=>org.apache.cassandra.db.marshal.UTF8Type,S=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.UTF8Type),t=>org.apache.cassandra.db.marshal.TimeUUIDType,T=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType),u=>org.apache.cassandra.db.marshal.UUIDType,U=>org.apache.cassandra.db.marshal.Rever
 
sedType(org.apache.cassandra.db.marshal.UUIDType),x=>org.apache.cassandra.db.marshal.LexicalUUIDType,X=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.LexicalUUIDType))'";
  
--    @Inject
--    public CQLUtils ( final CassandraFig cassandraFig ){
--
--        this.cassandraFig = cassandraFig;
  
++    @Inject
++    public CQLUtils ( ) {
      }
  
  
@@@ -81,64 -81,64 +61,6 @@@
          return mapper.writeValueAsString(map).replace("\"", "'");
      }
  
--
--    public static String getTableCQL( CassandraFig cassandraFig, 
TableDefinition tableDefinition,
--                               ACTION tableAction) throws Exception {
--
--        StringJoiner cql = new StringJoiner(" ");
--
--        if ( tableAction.equals(ACTION.CREATE) ){
--            cql.add(CREATE_TABLE);
--        } else if ( tableAction.equals(ACTION.UPDATE) ){
--            cql.add(ALTER_TABLE);
--        }else{
--            throw new Exception("Invalid Action specified.  Must of of type 
CQLUtils.Action");
--        }
--
--        cql.add( tableDefinition.getTableName() );
--
--
--
--        if ( tableAction.equals(ACTION.CREATE) ){
--
--            cql.add(PAREN_LEFT).add( 
spaceSeparatedKeyValue(tableDefinition.getColumns()) ).add(COMMA)
--                .add(PRIMARY_KEY)
--                .add(PAREN_LEFT).add(PAREN_LEFT)
--                .add( StringUtils.join(tableDefinition.getPartitionKeys(), 
COMMA) ).add(PAREN_RIGHT);
--
--            if ( tableDefinition.getColumnKeys() != null && 
!tableDefinition.getColumnKeys().isEmpty() ){
--
--                cql.add(COMMA).add( 
StringUtils.join(tableDefinition.getColumnKeys(), COMMA) );
--            }
--
--            cql.add(PAREN_RIGHT).add(PAREN_RIGHT)
--                .add(WITH)
--                .add(CLUSTERING_ORDER_BY)
--                .add(PAREN_LEFT)
--                .add( 
spaceSeparatedKeyValue(tableDefinition.getClusteringOrder()) )
--                .add(PAREN_RIGHT)
--                .add(AND)
--                .add(COMPACT_STORAGE)
--                .add(AND);
--
--        } else if ( tableAction.equals(ACTION.UPDATE) ){
--            cql.add(WITH);
--
--        }
--
--
--        cql.add(COMPACTION).add(EQUAL).add( getMapAsCQLString( 
tableDefinition.getCompaction() ) )
--            .add(AND)
--            .add(COMPRESSION).add(EQUAL).add( getMapAsCQLString( 
tableDefinition.getCompression() ) )
--            .add(AND)
--            .add(GC_GRACE_SECONDS).add(EQUAL).add( 
tableDefinition.getGcGraceSeconds() )
--            .add(AND)
--            .add(CACHING).add(EQUAL).add( getCachingOptions( cassandraFig, 
tableDefinition.getCacheOption() ) );
--
--        return cql.toString();
--
--    }
--
      public static String quote( String value){
  
          return "\"" + value + "\"";
@@@ -162,7 -162,7 +84,7 @@@
      }
  
  
--    public static String getCachingOptions(CassandraFig cassandraFig, 
TableDefinition.CacheOption cacheOption) throws JsonProcessingException {
++    public static String getCachingOptions(CassandraFig cassandraFig, 
TableDefinitionImpl.CacheOption cacheOption) throws JsonProcessingException {
  
          // Cassandra 2.0 and below has a different CQL syntax for caching
          if( Double.parseDouble( cassandraFig.getVersion() ) <= 2.0 ){
@@@ -177,7 -177,7 +99,7 @@@
      }
  
  
--    public static String getCacheValue( TableDefinition.CacheOption 
cacheOption ) throws JsonProcessingException {
++    public static String getCacheValue( TableDefinitionImpl.CacheOption 
cacheOption ) throws JsonProcessingException {
  
  
          Map<String, Object>  cacheValue = new HashMap<>(2);
@@@ -213,7 -213,7 +135,7 @@@
  
      }
  
--    public static String getLegacyCacheValue( TableDefinition.CacheOption 
cacheOption ){
++    public static String getLegacyCacheValue( TableDefinitionImpl.CacheOption 
cacheOption ){
  
          String cacheValue;
          switch (cacheOption) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/TableDefinition.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/TableDefinition.java
index d749d40,d749d40..8178129
--- 
a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/TableDefinition.java
+++ 
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/TableDefinition.java
@@@ -20,108 -20,108 +20,15 @@@
  package org.apache.usergrid.persistence.core.datastax;
  
  
--import com.datastax.driver.core.DataType;
--import com.google.common.base.Preconditions;
++import org.apache.usergrid.persistence.core.CassandraFig;
  
--import java.util.Collection;
--import java.util.HashMap;
--import java.util.Map;
++public interface TableDefinition {
  
--public class TableDefinition {
--
--
--    public enum CacheOption {
--
--        ALL, KEYS, ROWS, NONE
--    }
--
--
--    private final String tableName;
--    private final Collection<String> partitionKeys;
--    private final Collection<String> columnKeys;
--    private final Map<String, DataType.Name> columns;
--    private final CacheOption cacheOption;
--    private final Map<String, Object> compaction;
--    private final String bloomFilterChance;
--    private final String readRepairChance;
--    private final Map<String, Object> compression;
--    private final String gcGraceSeconds;
--    private final Map<String, String> clusteringOrder;
--
--    public TableDefinition( final String tableName, final Collection<String> 
partitionKeys,
--                            final Collection<String> columnKeys, final 
Map<String, DataType.Name> columns,
--                            final CacheOption cacheOption, final Map<String, 
String> clusteringOrder){
--
--        Preconditions.checkNotNull(tableName, "Table name cannot be null");
--        Preconditions.checkNotNull(partitionKeys, "Primary Key(s) cannot be 
null");
--        Preconditions.checkNotNull(columns, "Columns cannot be null");
--        Preconditions.checkNotNull(cacheOption, "CacheOption cannot be null");
--
--
--        this.tableName = tableName;
--        this.partitionKeys = partitionKeys;
--        this.columnKeys = columnKeys;
--        this.columns = columns;
--        this.cacheOption = cacheOption;
--        this.clusteringOrder = clusteringOrder;
--
--
--        // this are default settings always used
--        this.compaction = new HashMap<>(1);
--        compaction.put( "class", "LeveledCompactionStrategy" );
--        this.bloomFilterChance = "0.1d";
--        this.readRepairChance = "0.1d";
--        this.compression = new HashMap<>(1);
--        compression.put("sstable_compression", "LZ4Compressor");
--        this.gcGraceSeconds = "864000";
--
--
--
--    }
--
--    public String getTableName() {
--        return tableName;
--    }
--
--    public Collection<String> getPartitionKeys() {
--        return partitionKeys;
--    }
--
--    public Collection<String> getColumnKeys() {
--        return columnKeys;
--    }
--
--    public Map<String, DataType.Name> getColumns() {
--        return columns;
--    }
--
--    public CacheOption getCacheOption() {
--        return cacheOption;
--    }
--
--    public Map<String, Object> getCompaction() {
--        return compaction;
--    }
--
--    public String getBloomFilterChance() {
--        return bloomFilterChance;
--    }
--
--    public String getReadRepairChance() {
--        return readRepairChance;
--    }
--
--    public Map<String, Object> getCompression() {
--        return compression;
--    }
--
--    public String getGcGraceSeconds() {
--        return gcGraceSeconds;
--    }
--
--    public Map<String, String> getClusteringOrder() {
--        return clusteringOrder;
++    enum ACTION {
++        CREATE, UPDATE
      }
  
++    String getTableName();
  
++    String getTableCQL( CassandraFig cassandraFig, ACTION tableAction ) 
throws Exception;
  }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/TableDefinitionImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/TableDefinitionImpl.java
index 0000000,0000000..a5a92e2
new file mode 100644
--- /dev/null
+++ 
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/TableDefinitionImpl.java
@@@ -1,0 -1,0 +1,210 @@@
++/*
++ * 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.datastax.impl;
++
++
++import com.datastax.driver.core.DataType;
++import com.google.common.base.Preconditions;
++import org.apache.usergrid.persistence.core.CassandraFig;
++import org.apache.usergrid.persistence.core.datastax.CQLUtils;
++import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.util.StringUtils;
++
++import java.util.Collection;
++import java.util.HashMap;
++import java.util.Map;
++import java.util.StringJoiner;
++
++import static 
org.apache.usergrid.persistence.core.datastax.CQLUtils.getCachingOptions;
++import static 
org.apache.usergrid.persistence.core.datastax.CQLUtils.getMapAsCQLString;
++import static 
org.apache.usergrid.persistence.core.datastax.CQLUtils.spaceSeparatedKeyValue;
++
++public class TableDefinitionImpl implements TableDefinition {
++
++    public enum CacheOption {
++        ALL, KEYS, ROWS, NONE
++    }
++
++    private final String tableName;
++    private final Collection<String> partitionKeys;
++    private final Collection<String> columnKeys;
++    private final Map<String, DataType.Name> columns;
++    private final CacheOption cacheOption;
++    private final Map<String, Object> compaction;
++    private final String bloomFilterChance;
++    private final String readRepairChance;
++    private final Map<String, Object> compression;
++    private final String gcGraceSeconds;
++    private final Map<String, String> clusteringOrder;
++
++    static String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS";
++    static String ALTER_TABLE = "ALTER TABLE";
++    static String WITH ="WITH";
++    static String AND = "AND";
++    static String EQUAL = "=";
++    static String COMPRESSION = "compression";
++    static String COMPACTION = "compaction";
++    static String CACHING = "caching";
++    static String GC_GRACE_SECONDS = "gc_grace_seconds";
++    static String PRIMARY_KEY = "PRIMARY KEY";
++    static String COMPACT_STORAGE = "COMPACT STORAGE";
++    static String CLUSTERING_ORDER_BY = "CLUSTERING ORDER BY";
++    static String COMMA = ",";
++    static String PAREN_LEFT = "(";
++    static String PAREN_RIGHT = ")";
++
++    static String COMPOSITE_TYPE = 
"'org.apache.cassandra.db.marshal.DynamicCompositeType(a=>org.apache.cassandra.db.marshal.AsciiType,A=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.AsciiType),b=>org.apache.cassandra.db.marshal.BytesType,B=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.BytesType),i=>org.apache.cassandra.db.marshal.IntegerType,I=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.IntegerType),l=>org.apache.cassandra.db.marshal.LongType,L=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.LongType),s=>org.apache.cassandra.db.marshal.UTF8Type,S=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.UTF8Type),t=>org.apache.cassandra.db.marshal.TimeUUIDType,T=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType),u=>org.apache.cassandra.db.marshal.UUIDType,U=>org.apache.cassandra.db.marshal.Rever
 
sedType(org.apache.cassandra.db.marshal.UUIDType),x=>org.apache.cassandra.db.marshal.LexicalUUIDType,X=>org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.LexicalUUIDType))'";
++
++
++    public TableDefinitionImpl(final String tableName, final 
Collection<String> partitionKeys,
++                               final Collection<String> columnKeys, final 
Map<String, DataType.Name> columns,
++                               final CacheOption cacheOption, final 
Map<String, String> clusteringOrder){
++
++        Preconditions.checkNotNull(tableName, "Table name cannot be null");
++        Preconditions.checkNotNull(partitionKeys, "Primary Key(s) cannot be 
null");
++        Preconditions.checkNotNull(columns, "Columns cannot be null");
++        Preconditions.checkNotNull(cacheOption, "CacheOption cannot be null");
++
++
++        this.tableName = tableName;
++        this.partitionKeys = partitionKeys;
++        this.columnKeys = columnKeys;
++        this.columns = columns;
++        this.cacheOption = cacheOption;
++        this.clusteringOrder = clusteringOrder;
++
++
++        // this are default settings always used
++        this.compaction = new HashMap<>(1);
++        compaction.put( "class", "LeveledCompactionStrategy" );
++        this.bloomFilterChance = "0.1d";
++        this.readRepairChance = "0.1d";
++        this.compression = new HashMap<>(1);
++        compression.put("sstable_compression", "LZ4Compressor");
++        this.gcGraceSeconds = "864000";
++
++
++
++    }
++
++    public String getTableName() {
++        return tableName;
++    }
++
++    @Override
++    public String getTableCQL(CassandraFig cassandraFig, ACTION tableAction) 
throws Exception {
++
++        StringJoiner cql = new StringJoiner(" ");
++
++        if ( tableAction.equals( ACTION.CREATE) ){
++            cql.add(CREATE_TABLE);
++        } else if ( tableAction.equals( ACTION.UPDATE) ){
++            cql.add(ALTER_TABLE);
++        }else{
++            throw new Exception("Invalid Action specified.  Must of of type 
CQLUtils.Action");
++        }
++
++        cql.add( getTableName() );
++
++
++
++        if ( tableAction.equals( ACTION.CREATE) ){
++
++            cql.add(PAREN_LEFT).add( spaceSeparatedKeyValue( getColumns()) 
).add(COMMA)
++                .add(PRIMARY_KEY)
++                .add(PAREN_LEFT).add(PAREN_LEFT)
++                .add( StringUtils.join(getPartitionKeys(), COMMA) 
).add(PAREN_RIGHT);
++
++            if ( getColumnKeys() != null && !getColumnKeys().isEmpty() ){
++
++                cql.add(COMMA).add( StringUtils.join(getColumnKeys(), COMMA) 
);
++            }
++
++            cql.add(PAREN_RIGHT).add(PAREN_RIGHT)
++                .add(WITH)
++                .add(CLUSTERING_ORDER_BY)
++                .add(PAREN_LEFT)
++                .add( spaceSeparatedKeyValue(getClusteringOrder()) )
++                .add(PAREN_RIGHT)
++                .add(AND)
++                .add(COMPACT_STORAGE)
++                .add(AND);
++
++        } else if ( tableAction.equals( ACTION.UPDATE) ){
++            cql.add(WITH);
++
++        }
++
++
++        cql.add(COMPACTION).add(EQUAL).add( getMapAsCQLString( 
getCompaction() ) )
++            .add(AND)
++            .add(COMPRESSION).add(EQUAL).add( getMapAsCQLString( 
getCompression() ) )
++            .add(AND)
++            .add(GC_GRACE_SECONDS).add(EQUAL).add( getGcGraceSeconds() )
++            .add(AND)
++            .add(CACHING).add(EQUAL).add( getCachingOptions( cassandraFig, 
getCacheOption() ) );
++
++        return cql.toString();
++    }
++
++
++
++    public Collection<String> getPartitionKeys() {
++        return partitionKeys;
++    }
++
++    public Collection<String> getColumnKeys() {
++        return columnKeys;
++    }
++
++    public Map<String, DataType.Name> getColumns() {
++        return columns;
++    }
++
++    public CacheOption getCacheOption() {
++        return cacheOption;
++    }
++
++    public Map<String, Object> getCompaction() {
++        return compaction;
++    }
++
++    public String getBloomFilterChance() {
++        return bloomFilterChance;
++    }
++
++    public String getReadRepairChance() {
++        return readRepairChance;
++    }
++
++    public Map<String, Object> getCompression() {
++        return compression;
++    }
++
++    public String getGcGraceSeconds() {
++        return gcGraceSeconds;
++    }
++
++    public Map<String, String> getClusteringOrder() {
++        return clusteringOrder;
++    }
++
++
++}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/TableDefinitionStringImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/TableDefinitionStringImpl.java
index 0000000,0000000..8e7d854
new file mode 100644
--- /dev/null
+++ 
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/TableDefinitionStringImpl.java
@@@ -1,0 -1,0 +1,48 @@@
++/*
++ * 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.datastax.impl;
++
++import org.apache.usergrid.persistence.core.CassandraFig;
++import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++
++
++public class TableDefinitionStringImpl implements TableDefinition {
++
++    private String tableName;
++    private String cql;
++
++
++    public TableDefinitionStringImpl( String tableName, String cql ) {
++        this.tableName = tableName;
++        this.cql = cql;
++    }
++
++
++    @Override
++    public String getTableName() {
++        return tableName;
++    }
++
++
++    @Override
++    public String getTableCQL(CassandraFig cassandraFig, ACTION tableAction) 
throws Exception {
++        return cql;
++    }
++}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/MigrationInfoSerializationImpl.java
index ee04293,ee04293..2fe24a9
--- 
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,7 -27,7 +27,7 @@@ import org.apache.cassandra.db.marshal.
  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.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.core.migration.util.AstyanaxUtils;
  import org.apache.usergrid.persistence.model.entity.Id;
  import org.apache.usergrid.persistence.model.entity.SimpleId;
@@@ -208,7 -208,7 +208,7 @@@ public class MigrationInfoSerialization
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/Migration.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/Migration.java
index 952f898,952f898..b2ab031
--- 
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
@@@ -19,11 -19,11 +19,11 @@@
  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;
  
++import java.util.Collection;
++
  
  /**
   * @author tnine

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
index c5d1312,c5d1312..71b35e0
--- 
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
@@@ -27,6 -27,6 +27,7 @@@ import org.apache.usergrid.persistence.
  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.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -79,13 -79,13 +80,15 @@@ public class MigrationManagerImpl imple
  
                  final Collection<MultiTenantColumnFamilyDefinition> 
columnFamilies = migration.getColumnFamilies();
  
--                final Collection<TableDefinition> tables = 
migration.getTables();
++                final Collection<TableDefinitionImpl> tables = 
migration.getTables();
  
  
                  if ((columnFamilies == null || columnFamilies.size() == 0) &&
                      (tables == null || tables.size() == 0)) {
                      logger.warn(
--                        "Class {} implements {} but returns null for 
getColumnFamilies and getTables for migration.  Either implement this method or 
remove the interface from the 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;
                  }
@@@ -98,7 -98,7 +101,7 @@@
  
  
                  if ( tables != null && !tables.isEmpty() ) {
--                    for (TableDefinition tableDefinition : tables) {
++                    for (TableDefinitionImpl tableDefinition : tables) {
  
                          createTable(tableDefinition);
  
@@@ -140,18 -140,18 +143,19 @@@
  
      }
  
--    private void createTable(TableDefinition tableDefinition ) throws 
Exception {
++    private void createTable(TableDefinitionImpl tableDefinition ) throws 
Exception {
  
          KeyspaceMetadata keyspaceMetadata = 
dataStaxCluster.getClusterSession().getCluster().getMetadata()
              
.getKeyspace(CQLUtils.quote(cassandraFig.getApplicationKeyspace()));
  
--        boolean exists =  keyspaceMetadata != null && 
keyspaceMetadata.getTable(tableDefinition.getTableName()) != null;
++        boolean exists =  keyspaceMetadata != null
++            && keyspaceMetadata.getTable(tableDefinition.getTableName()) != 
null;
  
          if( exists ){
              return;
          }
  
--        String CQL = CQLUtils.getTableCQL(cassandraFig, tableDefinition, 
CQLUtils.ACTION.CREATE);
++        String CQL = tableDefinition.getTableCQL(cassandraFig, 
TableDefinition.ACTION.CREATE);
          if (logger.isDebugEnabled()) {
              logger.debug(CQL);
          }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/CQLUtilsTest.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/CQLUtilsTest.java
index 34dd370,34dd370..37311ba
--- 
a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/CQLUtilsTest.java
+++ 
b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/CQLUtilsTest.java
@@@ -22,6 -22,6 +22,7 @@@ package org.apache.usergrid.persistence
  import com.datastax.driver.core.DataType;
  import com.google.inject.Inject;
  import org.apache.usergrid.persistence.core.CassandraFig;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.core.guice.TestCommonModule;
  import org.apache.usergrid.persistence.core.test.ITRunner;
  import org.apache.usergrid.persistence.core.test.UseModules;
@@@ -69,17 -69,17 +70,17 @@@ public class CQLUtilsTest 
  
  
  
--        TableDefinition table1 = new TableDefinition(
++        TableDefinitionImpl table1 = new TableDefinitionImpl(
              CQLUtils.quote("table1"),
              partitionKeys,
              columnKeys,
              columns,
--            TableDefinition.CacheOption.KEYS,
++            TableDefinitionImpl.CacheOption.KEYS,
              clusteringOrder
              );
  
--        String createCQL = CQLUtils.getTableCQL(cassandraFig, table1, 
CQLUtils.ACTION.CREATE);
--        String updateCQL = CQLUtils.getTableCQL(cassandraFig, table1, 
CQLUtils.ACTION.UPDATE);
++        String createCQL = table1.getTableCQL(cassandraFig, 
TableDefinition.ACTION.CREATE);
++        String updateCQL = table1.getTableCQL(cassandraFig, 
TableDefinition.ACTION.UPDATE);
  
          assertTrue(
              createCQL.contains(CQLUtils.CREATE_TABLE ) &&
@@@ -121,16 -121,16 +122,16 @@@
  
  
  
--        TableDefinition table1 = new TableDefinition(
++        TableDefinitionImpl table1 = new TableDefinitionImpl(
              CQLUtils.quote("table1"),
              partitionKeys,
              columnKeys,
              columns,
--            TableDefinition.CacheOption.KEYS,
++            TableDefinitionImpl.CacheOption.KEYS,
              clusteringOrder
          );
  
--        String createCQL = CQLUtils.getTableCQL(cassandraFig, table1, 
CQLUtils.ACTION.CREATE);
++        String createCQL = table1.getTableCQL(cassandraFig, 
TableDefinition.ACTION.CREATE);
          logger.info(createCQL);
          assertTrue(
              createCQL.contains( "\"keys_only\"" ) &&
@@@ -164,16 -164,16 +165,16 @@@
  
  
  
--        TableDefinition table1 = new TableDefinition(
++        TableDefinitionImpl table1 = new TableDefinitionImpl(
              CQLUtils.quote("table1"),
              partitionKeys,
              columnKeys,
              columns,
--            TableDefinition.CacheOption.KEYS,
++            TableDefinitionImpl.CacheOption.KEYS,
              clusteringOrder
          );
  
--        String createCQL = CQLUtils.getTableCQL(cassandraFig, table1, 
CQLUtils.ACTION.CREATE);
++        String createCQL = table1.getTableCQL(cassandraFig, 
TableDefinition.ACTION.CREATE);
          logger.info(createCQL);
          assertTrue(
              createCQL.contains( "'keys':'ALL'"  ) &&

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/TableDefinitionTest.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/TableDefinitionTest.java
index 3acce69,3acce69..b5f98d9
--- 
a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/TableDefinitionTest.java
+++ 
b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/datastax/TableDefinitionTest.java
@@@ -19,6 -19,6 +19,7 @@@
  package org.apache.usergrid.persistence.core.datastax;
  
  
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.junit.Test;
  
  import java.util.ArrayList;
@@@ -32,7 -32,7 +33,7 @@@ public class TableDefinitionTest 
      public void testNullTableName(){
  
          try{
--            TableDefinition table1 = new TableDefinition(null, null, null, 
null, null, null);
++            TableDefinitionImpl table1 = new TableDefinitionImpl(null, null, 
null, null, null, null);
          } catch (NullPointerException npe){
              assertEquals("Table name cannot be null", npe.getMessage());
          }
@@@ -44,7 -44,7 +45,7 @@@
      public void testNullPrimaryKeys(){
  
          try{
--            TableDefinition table1 = new TableDefinition("table1", null, 
null, null, null, null);
++            TableDefinitionImpl table1 = new TableDefinitionImpl("table1", 
null, null, null, null, null);
          } catch (NullPointerException npe){
              assertEquals("Primary Key(s) cannot be null", npe.getMessage());
          }
@@@ -56,7 -56,7 +57,7 @@@
      public void testNullColumns(){
  
          try{
--            TableDefinition table1 = new TableDefinition("table1",
++            TableDefinitionImpl table1 = new TableDefinitionImpl("table1",
                  new ArrayList<>(), null, null, null, null);
          } catch (NullPointerException npe){
              assertEquals("Columns cannot be null", npe.getMessage());
@@@ -69,7 -69,7 +70,7 @@@
      public void testNullCacheOption(){
  
          try{
--            TableDefinition table1 = new TableDefinition("table1",
++            TableDefinitionImpl table1 = new TableDefinitionImpl("table1",
                  new ArrayList<>(),
                  new ArrayList<>(), new HashMap<>(), null, null);
          } catch (NullPointerException npe){

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
index 46acd1c,46acd1c..5e90d8f
--- 
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
@@@ -26,7 -26,7 +26,7 @@@ import java.util.Collection
  import java.util.Collections;
  import java.util.Iterator;
  
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -290,7 -290,7 +290,7 @@@ public class EdgeMetadataSerializationP
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
index d7a5c80,d7a5c80..b1049f2
--- 
a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
+++ 
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
@@@ -37,7 -37,7 +37,7 @@@ import org.apache.usergrid.persistence.
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
  import org.apache.usergrid.persistence.core.astyanax.StringColumnParser;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.core.migration.schema.Migration;
  import org.apache.usergrid.persistence.core.scope.ApplicationScope;
  import org.apache.usergrid.persistence.core.util.ValidationUtils;
@@@ -379,7 -379,7 +379,7 @@@ public class EdgeMetadataSerializationV
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
index 1f81864,1f81864..34cb1d2
--- 
a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
+++ 
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
@@@ -37,7 -37,7 +37,7 @@@ import org.apache.usergrid.persistence.
  import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
  import org.apache.usergrid.persistence.core.astyanax.StringColumnParser;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.core.migration.schema.Migration;
  import org.apache.usergrid.persistence.core.scope.ApplicationScope;
  import org.apache.usergrid.persistence.core.shard.ExpandingShardLocator;
@@@ -467,7 -467,7 +467,7 @@@ public class EdgeMetadataSerializationV
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
index 2429d5a,2429d5a..12e9237
--- 
a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
+++ 
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
@@@ -38,7 -38,7 +38,7 @@@ import org.apache.usergrid.persistence.
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.core.migration.schema.Migration;
  import org.apache.usergrid.persistence.core.scope.ApplicationScope;
  import org.apache.usergrid.persistence.core.util.ValidationUtils;
@@@ -112,7 -112,7 +112,7 @@@ public class NodeSerializationImpl impl
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
index 098c152,098c152..764536e
--- 
a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
+++ 
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
@@@ -34,7 -34,7 +34,7 @@@ import org.apache.usergrid.persistence.
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.core.scope.ApplicationScope;
  import org.apache.usergrid.persistence.core.util.ValidationUtils;
  import org.apache.usergrid.persistence.graph.GraphFig;
@@@ -188,7 -188,7 +188,7 @@@ public class EdgeShardSerializationImp
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
index f4e19d6,f4e19d6..9d0b157
--- 
a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
+++ 
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
@@@ -33,7 -33,7 +33,7 @@@ import org.apache.usergrid.persistence.
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
  import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import 
org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdge;
  import 
org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumnFamilies;
  import 
org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeRowKey;
@@@ -146,7 -146,7 +146,7 @@@ public class SizebasedEdgeColumnFamilie
      }
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> getTables() {
  
          return Collections.emptyList();
      }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8cd381d/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
----------------------------------------------------------------------
diff --cc 
stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
index 2c77ebf64,2c77ebf64..6253cec
--- 
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
@@@ -31,7 -31,7 +31,7 @@@ import com.datastax.driver.core.querybu
  import org.apache.usergrid.persistence.core.CassandraConfig;
  import 
org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
  import org.apache.usergrid.persistence.core.datastax.CQLUtils;
--import org.apache.usergrid.persistence.core.datastax.TableDefinition;
++import org.apache.usergrid.persistence.core.datastax.impl.TableDefinitionImpl;
  import org.apache.usergrid.persistence.core.shard.ExpandingShardLocator;
  import org.apache.usergrid.persistence.core.shard.StringHashUtils;
  import org.apache.usergrid.persistence.map.MapKeyResults;
@@@ -306,15 -306,15 +306,15 @@@ public class MapSerializationImpl imple
  
  
      @Override
--    public Collection<TableDefinition> getTables() {
++    public Collection<TableDefinitionImpl> 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 TableDefinitionImpl mapEntries =
++            new TableDefinitionImpl( MAP_ENTRIES_TABLE, 
MAP_ENTRIES_PARTITION_KEYS, MAP_ENTRIES_COLUMN_KEYS,
++                MAP_ENTRIES_COLUMNS, TableDefinitionImpl.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 TableDefinitionImpl mapKeys =
++            new TableDefinitionImpl( MAP_KEYS_TABLE, MAP_KEYS_PARTITION_KEYS, 
MAP_KEYS_COLUMN_KEYS,
++                MAP_KEYS_COLUMNS, TableDefinitionImpl.CacheOption.KEYS, 
MAP_KEYS_CLUSTERING_ORDER);
  
  
  

Reply via email to