Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2ACEC10C62 for ; Thu, 22 Aug 2013 01:35:52 +0000 (UTC) Received: (qmail 14439 invoked by uid 500); 22 Aug 2013 01:35:52 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 14417 invoked by uid 500); 22 Aug 2013 01:35:52 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 14409 invoked by uid 99); 22 Aug 2013 01:35:52 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Aug 2013 01:35:52 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C067B8C2462; Thu, 22 Aug 2013 01:35:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aleksey@apache.org To: commits@cassandra.apache.org Message-Id: <06ca18b7f77149929ec82eeb343a3f3f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Add CQL2 deprecation warning Date: Thu, 22 Aug 2013 01:35:51 +0000 (UTC) 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 Authored: Thu Aug 22 04:35:29 2013 +0300 Committer: Aleksey Yeschenko 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 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 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 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();