cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1101595 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/cql/QueryProcessor.java
Date Tue, 10 May 2011 18:57:51 GMT
Author: jbellis
Date: Tue May 10 18:57:50 2011
New Revision: 1101595

URL: http://svn.apache.org/viewvc?rev=1101595&view=rev
Log:
validate keyspace strategy_options during CQL create
patch by jbellis; reviewed by pyaskevich for CASSANDRA-2624

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1101595&r1=1101594&r2=1101595&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Tue May 10 18:57:50 2011
@@ -14,6 +14,7 @@
  * add support for presenting row key as a column in CQL result sets 
    (CASSANDRA-2622)
  * Don't allow {LOCAL|EACH}_QUORUM unless strategy is NTS (CASSANDRA-2627)
+ * validate keyspace strategy_options during CQL create (CASSANDRA-2624)
 
 
 0.8.0-beta2

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java?rev=1101595&r1=1101594&r2=1101595&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java
Tue May 10 18:57:50 2011
@@ -656,10 +656,12 @@ public class QueryProcessor
                 
                 try
                 {
-                    KSMetaData ksm = new KSMetaData(create.getName(),
-                                                    AbstractReplicationStrategy.getClass(create.getStrategyClass()),
-                                                    create.getStrategyOptions());
-                    applyMigrationOnStage(new AddKeyspace(ksm));
+                    KsDef ksd = new KsDef(create.getName(),
+                                          create.getStrategyClass(),
+                                          Collections.<org.apache.cassandra.thrift.CfDef>emptyList())
+                                .setStrategy_options(create.getStrategyOptions());
+                    ThriftValidation.validateKsDef(ksd);
+                    applyMigrationOnStage(new AddKeyspace(KSMetaData.fromThrift(ksd)));
                 }
                 catch (ConfigurationException e)
                 {



Mime
View raw message