From 500a529e7dc8947149b419adbac922596bb341b7 Mon Sep 17 00:00:00 2001 From: Sylvain Lebresne Date: Mon, 10 Sep 2012 18:50:21 +0200 Subject: [PATCH] Make CQL3 the default CQL implementation patch by slebresne; reviewed by jbellis for CASSANDRA-4640 --- CHANGES.txt | 1 + NEWS.txt | 9 +++++++-- bin/cqlsh | 2 +- src/java/org/apache/cassandra/service/ClientState.java | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 838ed1b175..0ad5b66e65 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -55,6 +55,7 @@ * Finer grained exceptions hierarchy and provides error code with exceptions (CASSANDRA-3979) * Adds events push to binary protocol (CASSANDRA-4480) * Rewrite nodetool help (CASSANDRA-2293) + * Make CQL3 the default for CQL (CASSANDRA-4640) 1.1.6 * (cql3) fix potential NPE with both equal and unequal restriction (CASSANDRA-4532) diff --git a/NEWS.txt b/NEWS.txt index 1ab5ebe475..9d06b99ff8 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -11,6 +11,7 @@ by version X, but the inverse is not necessarily the case.) 1.2 === + Upgrading --------- - 1.2 is NOT network-compatible with versions older than 1.0. That @@ -45,13 +46,17 @@ Upgrading - The default partitioner was changed from RandomPartitioner to Murmur3Partitioner which provides faster hashing as well as improved performance with secondary indexes. + - The default version of CQL (and cqlsh) is now CQL3. CQL2 is still + available but you will have to use the thrift set_cql_version method + (that is already supported in 1.1) to use CQL2. For cqlsh, you will need + to use 'cqlsh -2'. - CQL3 is now considered final in this release. Compared to the beta version that is part of 1.1, this final version has a few additions (collections), but also some changes in the syntax for the options of the create/alter keyspace/table statements. Typically, the syntax to create a keyspace is now: - CREATE KEYSPACE ks WITH replication = { 'class' : 'CompactionStrategy', - 'replication_faction' : 2 }; + CREATE KEYSPACE ks WITH replication = { 'class' : 'SimpleStrategy', + 'replication_factor' : 2 }; Please refer to the CQL3 documentation for details. Features diff --git a/bin/cqlsh b/bin/cqlsh index 24217aed25..d8393babca 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -114,7 +114,7 @@ CONFIG_FILE = os.path.expanduser(os.path.join('~', '.cqlshrc')) HISTORY = os.path.expanduser(os.path.join('~', '.cqlsh_history')) DEFAULT_HOST = 'localhost' DEFAULT_PORT = 9160 -DEFAULT_CQLVER = '2' +DEFAULT_CQLVER = '3' epilog = """Connects to %(DEFAULT_HOST)s:%(DEFAULT_PORT)d by default. These defaults can be changed by setting $CQLSH_HOST and/or $CQLSH_PORT. When a diff --git a/src/java/org/apache/cassandra/service/ClientState.java b/src/java/org/apache/cassandra/service/ClientState.java index b85b359af8..6e47950d6d 100644 --- a/src/java/org/apache/cassandra/service/ClientState.java +++ b/src/java/org/apache/cassandra/service/ClientState.java @@ -46,7 +46,7 @@ public class ClientState { private static final int MAX_CACHE_PREPARED = 10000; // Enough to keep buggy clients from OOM'ing us private static final Logger logger = LoggerFactory.getLogger(ClientState.class); - public static final SemanticVersion DEFAULT_CQL_VERSION = org.apache.cassandra.cql.QueryProcessor.CQL_VERSION; + public static final SemanticVersion DEFAULT_CQL_VERSION = org.apache.cassandra.cql3.QueryProcessor.CQL_VERSION; // Current user for the session private AuthenticatedUser user;