cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [6/7] git commit: switch defaultValidator to BytesType where CQL doesn't care
Date Fri, 09 Nov 2012 23:36:04 GMT
switch defaultValidator to BytesType where CQL doesn't care


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

Branch: refs/heads/trunk
Commit: fc5f877fb2c17e3003ba4b31817bd2ac10ee5f6a
Parents: dda7aee
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Nov 8 13:17:12 2012 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Nov 9 17:34:15 2012 -0600

----------------------------------------------------------------------
 .../statements/CreateColumnFamilyStatement.java    |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fc5f877f/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
b/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
index b8ea732..1f8ee7e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
@@ -34,16 +34,11 @@ import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
+import org.apache.cassandra.db.marshal.*;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.exceptions.RequestValidationException;
 import org.apache.cassandra.exceptions.UnauthorizedException;
 import org.apache.cassandra.db.ColumnFamilyType;
-import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.db.marshal.CollectionType;
-import org.apache.cassandra.db.marshal.ColumnToCollectionType;
-import org.apache.cassandra.db.marshal.CompositeType;
-import org.apache.cassandra.db.marshal.ReversedType;
-import org.apache.cassandra.db.marshal.CounterColumnType;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.service.ClientState;
 import org.apache.cassandra.service.MigrationManager;
@@ -279,7 +274,7 @@ public class CreateColumnFamilyStatement extends SchemaAlteringStatement
                         throw new InvalidRequestException(String.format("COMPACT STORAGE
with non-composite PRIMARY KEY require one column not part of the PRIMARY KEY (got: %s)",
StringUtils.join(stmt.columns.keySet(), ", ")));
 
                     // The only value we'll insert will be the empty one, so the default
validator don't matter
-                    stmt.defaultValidator = CFDefinition.definitionType;
+                    stmt.defaultValidator = BytesType.instance;
                     // We need to distinguish between
                     //   * I'm upgrading from thrift so the valueAlias is null
                     //   * I've define my table with only a PK (and the column value will
be empty)
@@ -303,7 +298,7 @@ public class CreateColumnFamilyStatement extends SchemaAlteringStatement
                 // the actual validator don't matter much (except that we want to recognize
counter CF as limitation apply to them).
                 stmt.defaultValidator = !stmt.columns.isEmpty() && (stmt.columns.values().iterator().next()
instanceof CounterColumnType)
                     ? CounterColumnType.instance
-                    : CFDefinition.definitionType;
+                    : BytesType.instance;
             }
 
 


Mime
View raw message