You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2013/08/22 03:35:51 UTC
git commit: Add CQL2 deprecation warning
Updated Branches:
refs/heads/cassandra-2.0.0 8551ff93e -> 5fe46e145
Add CQL2 deprecation warning
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5fe46e14
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5fe46e14
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5fe46e14
Branch: refs/heads/cassandra-2.0.0
Commit: 5fe46e145adfe54a1fc4521fd274833e3bce4ac2
Parents: 8551ff9
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Thu Aug 22 04:35:29 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Thu Aug 22 04:35:29 2013 +0300
----------------------------------------------------------------------
NEWS.txt | 3 ++
interface/cassandra.thrift | 30 +++++++++++++-------
.../cassandra/thrift/CassandraServer.java | 16 +++++++++++
3 files changed, 39 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5fe46e14/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index 81b5e12..717dd4a 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -72,6 +72,9 @@ Operations
has been changed from 5MB to 160MB.
- cqlsh DESCRIBE SCHEMA no longer outputs the schema of system_* keyspaces;
use DESCRIBE FULL SCHEMA if you need the schema of system_* keyspaces.
+ - CQL2 has been deprecated, and will be removed entirely in 2.2. See
+ CASSANDRA-5918 for details.
+
Features
--------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5fe46e14/interface/cassandra.thrift
----------------------------------------------------------------------
diff --git a/interface/cassandra.thrift b/interface/cassandra.thrift
index 3f294eb..c42554d 100644
--- a/interface/cassandra.thrift
+++ b/interface/cassandra.thrift
@@ -827,10 +827,10 @@ service Cassandra {
/** updates properties of a column family. returns the new schema id. */
string system_update_column_family(1:required CfDef cf_def)
throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde),
-
+
+
/**
- * Executes a CQL (Cassandra Query Language) statement and returns a
- * CqlResult containing the results.
+ * @deprecated Will become a no-op in 2.2. Please use the CQL3 version instead.
*/
CqlResult execute_cql_query(1:required binary query, 2:required Compression compression)
throws (1:InvalidRequestException ire,
@@ -838,6 +838,10 @@ service Cassandra {
3:TimedOutException te,
4:SchemaDisagreementException sde)
+ /**
+ * Executes a CQL3 (Cassandra Query Language) statement and returns a
+ * CqlResult containing the results.
+ */
CqlResult execute_cql3_query(1:required binary query, 2:required Compression compression, 3:required ConsistencyLevel consistency)
throws (1:InvalidRequestException ire,
2:UnavailableException ue,
@@ -846,21 +850,23 @@ service Cassandra {
/**
- * Prepare a CQL (Cassandra Query Language) statement by compiling and returning
- * - the type of CQL statement
- * - an id token of the compiled CQL stored on the server side.
- * - a count of the discovered bound markers in the statement
+ * @deprecated Will become a no-op in 2.2. Please use the CQL3 version instead.
*/
CqlPreparedResult prepare_cql_query(1:required binary query, 2:required Compression compression)
throws (1:InvalidRequestException ire)
+ /**
+ * Prepare a CQL3 (Cassandra Query Language) statement by compiling and returning
+ * - the type of CQL statement
+ * - an id token of the compiled CQL stored on the server side.
+ * - a count of the discovered bound markers in the statement
+ */
CqlPreparedResult prepare_cql3_query(1:required binary query, 2:required Compression compression)
throws (1:InvalidRequestException ire)
-
+
/**
- * Executes a prepared CQL (Cassandra Query Language) statement by passing an id token and a list of variables
- * to bind and returns a CqlResult containing the results.
+ * @deprecated Will become a no-op in 2.2. Please use the CQL3 version instead.
*/
CqlResult execute_prepared_cql_query(1:required i32 itemId, 2:required list<binary> values)
throws (1:InvalidRequestException ire,
@@ -868,6 +874,10 @@ service Cassandra {
3:TimedOutException te,
4:SchemaDisagreementException sde)
+ /**
+ * Executes a prepared CQL3 (Cassandra Query Language) statement by passing an id token, a list of variables
+ * to bind, and the consistency level, and returns a CqlResult containing the results.
+ */
CqlResult execute_prepared_cql3_query(1:required i32 itemId, 2:required list<binary> values, 3:required ConsistencyLevel consistency)
throws (1:InvalidRequestException ire,
2:UnavailableException ue,
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5fe46e14/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index e9473d9..1099834 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -77,6 +77,8 @@ public class CassandraServer implements Cassandra.Iface
private final static List<ColumnOrSuperColumn> EMPTY_COLUMNS = Collections.emptyList();
+ private volatile boolean loggedCQL2Warning = false;
+
/*
* RequestScheduler to perform the scheduling of incoming requests
*/
@@ -1866,6 +1868,8 @@ public class CassandraServer implements Cassandra.Iface
throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException
{
validateCQLVersion(2);
+ maybeLogCQL2Warning();
+
try
{
String queryString = uncompress(query, compression);
@@ -1936,6 +1940,7 @@ public class CassandraServer implements Cassandra.Iface
logger.debug("prepare_cql_query");
validateCQLVersion(2);
+ maybeLogCQL2Warning();
try
{
@@ -1973,6 +1978,7 @@ public class CassandraServer implements Cassandra.Iface
throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException
{
validateCQLVersion(2);
+ maybeLogCQL2Warning();
if (startSessionIfRequested())
{
@@ -2072,6 +2078,16 @@ public class CassandraServer implements Cassandra.Iface
}
}
+ private void maybeLogCQL2Warning()
+ {
+ if (!loggedCQL2Warning)
+ {
+ logger.warn("CQL2 has been deprecated since Cassandra 2.0, and will be removed entirely in version 2.2."
+ + " Please switch to CQL3 before then.");
+ loggedCQL2Warning = true;
+ }
+ }
+
public ByteBuffer trace_next_query() throws TException
{
UUID sessionId = UUIDGen.getTimeUUID();