cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject [4/6] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Date Mon, 27 Jul 2015 20:40:15 GMT
Merge branch 'cassandra-2.1' into cassandra-2.2


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

Branch: refs/heads/trunk
Commit: fcb5bd67d2d2287560306756d3e624195eebecce
Parents: 6f0c7d9 9dbf32c
Author: Robert Stupp <snazy@snazy.de>
Authored: Mon Jul 27 22:38:39 2015 +0200
Committer: Robert Stupp <snazy@snazy.de>
Committed: Mon Jul 27 22:38:39 2015 +0200

----------------------------------------------------------------------
 CHANGES.txt                                       |  2 ++
 .../apache/cassandra/thrift/CassandraServer.java  | 18 ++++++++++++------
 .../transport/messages/BatchMessage.java          | 11 +++++++++--
 .../transport/messages/ExecuteMessage.java        |  4 ++++
 .../transport/messages/QueryMessage.java          |  4 ++++
 5 files changed, 31 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fcb5bd67/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 17ec705,5aee7ba..36d0485
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,16 -1,5 +1,18 @@@
 -2.1.9
 +2.2.1
 + * UDF / UDA execution time in trace (CASSANDRA-9723)
 + * Remove repair snapshot leftover on startup (CASSANDRA-7357)
 + * Use random nodes for batch log when only 2 racks (CASSANDRA-8735)
++Merged from 2.1:
+  * Add consistency level to tracing ouput (CASSANDRA-9827)
 +Merged from 2.0:
 + * Log when messages are dropped due to cross_node_timeout (CASSANDRA-9793)
 +
 +2.2.0
 + * Fix cqlsh copy methods and other windows specific issues (CASSANDRA-9795) 
 + * Don't wrap byte arrays in SequentialWriter (CASSANDRA-9797)
 + * sum() and avg() functions missing for smallint and tinyint types (CASSANDRA-9671)
 + * Revert CASSANDRA-9542 (allow native functions in UDA) (CASSANDRA-9771)
 +Merged from 2.1:
   * Fix MarshalException when upgrading superColumn family (CASSANDRA-9582)
   * Fix broken logging for "empty" flushes in Memtable (CASSANDRA-9837)
   * Handle corrupt files on startup (CASSANDRA-9686)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fcb5bd67/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/thrift/CassandraServer.java
index 04d3d13,fd87b57..64662bf
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@@ -1932,22 -2022,16 +1938,22 @@@ public class CassandraServer implement
          }
      }
  
 -    public CqlPreparedResult prepare_cql3_query(ByteBuffer query, Compression compression)
 -    throws InvalidRequestException, TException
 +    public CqlResult execute_prepared_cql_query(int itemId, List<ByteBuffer> bindVariables)
throws TException
      {
 -        if (logger.isDebugEnabled())
 -            logger.debug("prepare_cql3_query");
 -
 -        validateCQLVersion(3);
 +        throw new InvalidRequestException("CQL2 has been removed in Cassandra 2.2. Please
use CQL3 instead");
 +    }
  
 -        String queryString = uncompress(query, compression);
 -        ThriftClientState cState = state();
 +    public CqlResult execute_prepared_cql3_query(int itemId, List<ByteBuffer> bindVariables,
ConsistencyLevel cLevel) throws TException
 +    {
 +        if (startSessionIfRequested())
 +        {
 +            // TODO we don't have [typed] access to CQL bind variables here.  CASSANDRA-4560
is open to add support.
-             Tracing.instance.begin("execute_prepared_cql3_query", Collections.<String,
String>emptyMap());
++            Tracing.instance.begin("execute_prepared_cql3_query", ImmutableMap.of("consistency_level",
cLevel.name()));
 +        }
 +        else
 +        {
 +            logger.debug("execute_prepared_cql3_query");
 +        }
  
          try
          {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fcb5bd67/src/java/org/apache/cassandra/transport/messages/BatchMessage.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/transport/messages/BatchMessage.java
index 4755ad3,b34b156..2db380b
--- a/src/java/org/apache/cassandra/transport/messages/BatchMessage.java
+++ b/src/java/org/apache/cassandra/transport/messages/BatchMessage.java
@@@ -166,8 -166,15 +166,15 @@@ public class BatchMessage extends Messa
              if (state.traceNextQuery())
              {
                  state.createTracingSession();
+ 
+                 ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
+                 if(options.getConsistency() != null)
+                     builder.put("consistency_level", options.getConsistency().name());
+                 if(options.getSerialConsistency() != null)
+                     builder.put("serial_consistency_level", options.getSerialConsistency().name());
+ 
                  // TODO we don't have [typed] access to CQL bind variables here.  CASSANDRA-4560
is open to add support.
-                 Tracing.instance.begin("Execute batch of CQL3 queries", state.getClientAddress(),
Collections.<String, String>emptyMap());
 -                Tracing.instance.begin("Execute batch of CQL3 queries", builder.build());
++                Tracing.instance.begin("Execute batch of CQL3 queries", state.getClientAddress(),
builder.build());
              }
  
              QueryHandler handler = ClientState.getCQLQueryHandler();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fcb5bd67/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
index 3eddc7d,7dd5f83..718595c
--- a/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
+++ b/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
@@@ -127,12 -126,16 +127,16 @@@ public class ExecuteMessage extends Mes
                  ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
                  if (options.getPageSize() > 0)
                      builder.put("page_size", Integer.toString(options.getPageSize()));
+                 if(options.getConsistency() != null)
+                     builder.put("consistency_level", options.getConsistency().name());
+                 if(options.getSerialConsistency() != null)
+                     builder.put("serial_consistency_level", options.getSerialConsistency().name());
  
                  // TODO we don't have [typed] access to CQL bind variables here.  CASSANDRA-4560
is open to add support.
 -                Tracing.instance.begin("Execute CQL3 prepared query", builder.build());
 +                Tracing.instance.begin("Execute CQL3 prepared query", state.getClientAddress(),
builder.build());
              }
  
 -            Message.Response response = handler.processPrepared(statement, state, options);
 +            Message.Response response = handler.processPrepared(statement, state, options,
getCustomPayload());
              if (options.skipMetadata() && response instanceof ResultMessage.Rows)
                  ((ResultMessage.Rows)response).result.metadata.setSkipMetadata();
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fcb5bd67/src/java/org/apache/cassandra/transport/messages/QueryMessage.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/transport/messages/QueryMessage.java
index 4e21678,2dd98cc..6d22dd1
--- a/src/java/org/apache/cassandra/transport/messages/QueryMessage.java
+++ b/src/java/org/apache/cassandra/transport/messages/QueryMessage.java
@@@ -112,11 -111,15 +112,15 @@@ public class QueryMessage extends Messa
                  builder.put("query", query);
                  if (options.getPageSize() > 0)
                      builder.put("page_size", Integer.toString(options.getPageSize()));
+                 if(options.getConsistency() != null)
+                     builder.put("consistency_level", options.getConsistency().name());
+                 if(options.getSerialConsistency() != null)
+                     builder.put("serial_consistency_level", options.getSerialConsistency().name());
  
 -                Tracing.instance.begin("Execute CQL3 query", builder.build());
 +                Tracing.instance.begin("Execute CQL3 query", state.getClientAddress(), builder.build());
              }
  
 -            Message.Response response = state.getClientState().getCQLQueryHandler().process(query,
state, options);
 +            Message.Response response = ClientState.getCQLQueryHandler().process(query,
state, options, getCustomPayload());
              if (options.skipMetadata() && response instanceof ResultMessage.Rows)
                  ((ResultMessage.Rows)response).result.metadata.setSkipMetadata();
  


Mime
View raw message