cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [2/2] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Date Mon, 14 Oct 2013 17:03:57 GMT
Merge branch 'cassandra-1.2' into cassandra-2.0

Conflicts:
	src/java/org/apache/cassandra/cql3/QueryProcessor.java
	src/java/org/apache/cassandra/cql3/UpdateParameters.java


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

Branch: refs/heads/cassandra-2.0
Commit: 9bb16c3c9420007f6ce2d7cda0f6000e498aba98
Parents: 810f067 623ed79
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Oct 14 19:03:48 2013 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Oct 14 19:03:48 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/cql3/QueryProcessor.java   | 25 +++++++++++---------
 .../apache/cassandra/cql3/UpdateParameters.java | 15 ++++++++----
 .../cql3/statements/SelectStatement.java        |  8 +++----
 4 files changed, 30 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9bb16c3c/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index cd06acc,48fcf58..22b9f29
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -49,43 -24,10 +49,44 @@@ Merged from 1.2
   * stress: add username/password authentication support (CASSANDRA-6068)
   * Fix indexed queries with row cache enabled on parent table (CASSANDRA-5732)
   * Fix compaction race during columnfamily drop (CASSANDRA-5957)
+  * Fix validation of empty column names for compact tables (CASSANDRA-6152)
  
  
 -1.2.10
 +2.0.1
 + * Fix bug that could allow reading deleted data temporarily (CASSANDRA-6025)
 + * Improve memory use defaults (CASSANDRA-5069)
 + * Make ThriftServer more easlly extensible (CASSANDRA-6058)
 + * Remove Hadoop dependency from ITransportFactory (CASSANDRA-6062)
 + * add file_cache_size_in_mb setting (CASSANDRA-5661)
 + * Improve error message when yaml contains invalid properties (CASSANDRA-5958)
 + * Improve leveled compaction's ability to find non-overlapping L0 compactions
 +   to work on concurrently (CASSANDRA-5921)
 + * Notify indexer of columns shadowed by range tombstones (CASSANDRA-5614)
 + * Log Merkle tree stats (CASSANDRA-2698)
 + * Switch from crc32 to adler32 for compressed sstable checksums (CASSANDRA-5862)
 + * Improve offheap memcpy performance (CASSANDRA-5884)
 + * Use a range aware scanner for cleanup (CASSANDRA-2524)
 + * Cleanup doesn't need to inspect sstables that contain only local data
 +   (CASSANDRA-5722)
 + * Add ability for CQL3 to list partition keys (CASSANDRA-4536)
 + * Improve native protocol serialization (CASSANDRA-5664)
 + * Upgrade Thrift to 0.9.1 (CASSANDRA-5923)
 + * Require superuser status for adding triggers (CASSANDRA-5963)
 + * Make standalone scrubber handle old and new style leveled manifest
 +   (CASSANDRA-6005)
 + * Fix paxos bugs (CASSANDRA-6012, 6013, 6023)
 + * Fix paged ranges with multiple replicas (CASSANDRA-6004)
 + * Fix potential AssertionError during tracing (CASSANDRA-6041)
 + * Fix NPE in sstablesplit (CASSANDRA-6027)
 + * Migrate pre-2.0 key/value/column aliases to system.schema_columns
 +   (CASSANDRA-6009)
 + * Paging filter empty rows too agressively (CASSANDRA-6040)
 + * Support variadic parameters for IN clauses (CASSANDRA-4210)
 + * cqlsh: return the result of CAS writes (CASSANDRA-5796)
 + * Fix validation of IN clauses with 2ndary indexes (CASSANDRA-6050)
 + * Support named bind variables in CQL (CASSANDRA-6033)
 +Merged from 1.2:
 + * Allow cache-keys-to-save to be set at runtime (CASSANDRA-5980)
   * Avoid second-guessing out-of-space state (CASSANDRA-5605)
   * Tuning knobs for dealing with large blobs and many CFs (CASSANDRA-5982)
   * (Hadoop) Fix CQLRW for thrift tables (CASSANDRA-6002)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9bb16c3c/src/java/org/apache/cassandra/cql3/QueryProcessor.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java
index 72351d5,71a57f4..7ddff96
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@@ -102,28 -102,31 +102,31 @@@ public class QueryProcesso
          }
      }
  
-     public static void validateColumnNames(Iterable<ByteBuffer> columns)
-     throws InvalidRequestException
 -    public static void validateColumnNames(Iterable<ByteBuffer> columnNames) throws
InvalidRequestException
++    public static void validateCellNames(Iterable<ByteBuffer> cellNames) throws InvalidRequestException
      {
-         for (ByteBuffer name : columns)
-         {
-             if (name.remaining() > Column.MAX_NAME_LENGTH)
-                 throw new InvalidRequestException(String.format("column name is too long
(%s > %s)",
-                                                                 name.remaining(),
-                                                                 Column.MAX_NAME_LENGTH));
-             if (name.remaining() == 0)
-                 throw new InvalidRequestException("zero-length column name");
-         }
 -        for (ByteBuffer name : columnNames)
 -            validateColumnName(name);
++        for (ByteBuffer name : cellNames)
++            validateCellName(name);
+     }
+ 
 -    public static void validateColumnName(ByteBuffer name) throws InvalidRequestException
++    public static void validateCellName(ByteBuffer name) throws InvalidRequestException
+     {
 -        if (name.remaining() > IColumn.MAX_NAME_LENGTH)
++        if (name.remaining() > Column.MAX_NAME_LENGTH)
+             throw new InvalidRequestException(String.format("The sum of all clustering columns
is too long (%s > %s)",
+                                                             name.remaining(),
 -                                                            IColumn.MAX_NAME_LENGTH));
++                                                            Column.MAX_NAME_LENGTH));
+ 
+         if (name.remaining() == 0)
+             throw new InvalidRequestException("Invalid empty value for clustering column
of COMPACT TABLE");
      }
  
 -    private static ResultMessage processStatement(CQLStatement statement, ConsistencyLevel
cl, QueryState queryState, List<ByteBuffer> variables)
 +    private static ResultMessage processStatement(CQLStatement statement, QueryState queryState,
QueryOptions options)
      throws RequestExecutionException, RequestValidationException
      {
 -        logger.trace("Process {} @CL.{}", statement, cl);
 +        logger.trace("Process {} @CL.{}", statement, options.getConsistency());
          ClientState clientState = queryState.getClientState();
 -        statement.validate(clientState);
          statement.checkAccess(clientState);
 -        ResultMessage result = statement.execute(cl, queryState, variables);
 +        statement.validate(clientState);
 +        ResultMessage result = statement.execute(queryState, options);
          return result == null ? new ResultMessage.Void() : result;
      }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9bb16c3c/src/java/org/apache/cassandra/cql3/UpdateParameters.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/UpdateParameters.java
index 2e2e86b,b938fea..0034b16
--- a/src/java/org/apache/cassandra/cql3/UpdateParameters.java
+++ b/src/java/org/apache/cassandra/cql3/UpdateParameters.java
@@@ -22,9 -22,9 +22,10 @@@ import java.util.Collections
  import java.util.List;
  import java.util.Map;
  
 +import org.apache.cassandra.config.CFMetaData;
  import org.apache.cassandra.cql3.statements.ColumnGroupMap;
  import org.apache.cassandra.db.*;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
  import org.apache.cassandra.utils.Pair;
  
  /**
@@@ -51,23 -49,31 +52,29 @@@ public class UpdateParameter
          this.prefetchedLists = prefetchedLists;
      }
  
-     public Column makeColumn(ByteBuffer name, ByteBuffer value)
+     public Column makeColumn(ByteBuffer name, ByteBuffer value) throws InvalidRequestException
      {
 -        QueryProcessor.validateColumnName(name);
 -        return ttl > 0
 -             ? new ExpiringColumn(name, value, timestamp, ttl)
 -             : new Column(name, value, timestamp);
++        QueryProcessor.validateCellName(name);
 +        return Column.create(name, value, timestamp, ttl, metadata);
      }
  
-     public Column makeTombstone(ByteBuffer name)
+     public Column makeTombstone(ByteBuffer name) throws InvalidRequestException
      {
 -        QueryProcessor.validateColumnName(name);
++        QueryProcessor.validateCellName(name);
          return new DeletedColumn(name, localDeletionTime, timestamp);
      }
  
-     public RangeTombstone makeRangeTombstone(ByteBuffer start, ByteBuffer end)
+     public RangeTombstone makeRangeTombstone(ByteBuffer start, ByteBuffer end) throws InvalidRequestException
      {
 -        QueryProcessor.validateColumnName(start);
 -        QueryProcessor.validateColumnName(end);
++        QueryProcessor.validateCellName(start);
++        QueryProcessor.validateCellName(end);
          return new RangeTombstone(start, end, timestamp, localDeletionTime);
      }
  
-     public RangeTombstone makeTombstoneForOverwrite(ByteBuffer start, ByteBuffer end)
+     public RangeTombstone makeTombstoneForOverwrite(ByteBuffer start, ByteBuffer end) throws
InvalidRequestException
      {
 -        QueryProcessor.validateColumnName(start);
 -        QueryProcessor.validateColumnName(end);
++        QueryProcessor.validateCellName(start);
++        QueryProcessor.validateCellName(end);
          return new RangeTombstone(start, end, timestamp - 1, localDeletionTime);
      }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9bb16c3c/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 85e9cbc,44a1e64..6391199
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@@ -397,11 -366,11 +397,11 @@@ public class SelectStatement implement
          }
          else
          {
--            SortedSet<ByteBuffer> columnNames = getRequestedColumns(variables);
--            if (columnNames == null) // in case of IN () for the last column of the key
++            SortedSet<ByteBuffer> cellNames = getRequestedColumns(variables);
++            if (cellNames == null) // in case of IN () for the last column of the key
                  return null;
--            QueryProcessor.validateColumnNames(columnNames);
--            return new NamesQueryFilter(columnNames, true);
++            QueryProcessor.validateCellNames(cellNames);
++            return new NamesQueryFilter(cellNames, true);
          }
      }
  


Mime
View raw message