Merge branch 'cassandra-2.0' into cassandra-2.1.0

Conflicts:
        CHANGES.txt
        src/java/org/apache/cassandra/cql3/Constants.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/af188ed3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/af188ed3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/af188ed3

Branch: refs/heads/trunk
Commit: af188ed364e421a56b3181c040519701cbaf0624
Parents: 1811281 ecf1bae
Author: Aleksey Yeschenko <alek...@apache.org>
Authored: Wed Aug 20 02:39:00 2014 +0300
Committer: Aleksey Yeschenko <alek...@apache.org>
Committed: Wed Aug 20 02:39:00 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                              | 2 ++
 src/java/org/apache/cassandra/cql3/Constants.java        | 4 ++--
 src/java/org/apache/cassandra/cql3/UpdateParameters.java | 7 +++++++
 3 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/af188ed3/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 5113057,304d9bf..183d849
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,18 +1,37 @@@
 -2.0.10
 - * Throw InvalidRequestException when queries contain relations on entire
 -   collection columns (CASSANDRA-7506)
 +2.1.0
 + * (cqlsh) Fix COPY FROM handling of null/empty primary key
 +   values (CASSANDRA-7792)
 + * Fix ordering of static cells (CASSANDRA-7763)
 +Merged from 2.0:
   * Fix PRSI handling of CQL3 row markers for row cleanup (CASSANDRA-7787)
 - * (cqlsh) enable CTRL-R history search with libedit (CASSANDRA-7577)
   * Fix dropping collection when it's the last regular column (CASSANDRA-7744)
   * Properly reject operations on list index with conditions (CASSANDRA-7499)
 - * (Hadoop) allow ACFRW to limit nodes to local DC (CASSANDRA-7252)
++Merged from 1.2:
++ * Validate empty cell names from counter updates (CASSANDRA-7798)
 +
 +
 +2.1.0-rc6
 + * Fix OOM issue from netty caching over time (CASSANDRA-7743)
 + * json2sstable couldn't import JSON for CQL table (CASSANDRA-7477)
 + * Invalidate all caches on table drop (CASSANDRA-7561)
 + * Skip strict endpoint selection for ranges if RF == nodes (CASSANRA-7765)
 + * Fix Thrift range filtering without 2ary index lookups (CASSANDRA-7741)
 + * Add tracing entries about concurrent range requests (CASSANDRA-7599)
 + * (cqlsh) Fix DESCRIBE for NTS keyspaces (CASSANDRA-7729)
 + * Remove netty buffer ref-counting (CASSANDRA-7735)
 + * Pass mutated cf to index updater for use by PRSI (CASSANDRA-7742)
 + * Include stress yaml example in release and deb (CASSANDRA-7717)
 + * workaround for netty issue causing corrupted data off the wire 
(CASSANDRA-7695)
 + * cqlsh DESC CLUSTER fails retrieving ring information (CASSANDRA-7687)
 + * Fix binding null values inside UDT (CASSANDRA-7685)
 + * Fix UDT field selection with empty fields (CASSANDRA-7670)
 + * Bogus deserialization of static cells from sstable (CASSANDRA-7684)
 + * Fix NPE on compaction leftover cleanup for dropped table (CASSANDRA-7770)
 +Merged from 2.0:
   * (cqlsh) Wait up to 10 sec for a tracing session (CASSANDRA-7222)
   * Fix NPE in FileCacheService.sizeInBytes (CASSANDRA-7756)
 - * (cqlsh) cqlsh should automatically disable tracing when selecting
 -   from system_traces (CASSANDRA-7641)
 - * (Hadoop) Add CqlOutputFormat (CASSANDRA-6927)
 - * Don't depend on cassandra config for nodetool ring (CASSANDRA-7508)
 - * (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)
 + * Remove duplicates from StorageService.getJoiningNodes (CASSANDRA-7478)
 + * Clone token map outside of hot gossip loops (CASSANDRA-7758)
   * Fix MS expiring map timeout for Paxos messages (CASSANDRA-7752)
   * Do not flush on truncate if durable_writes is false (CASSANDRA-7750)
   * Give CRR a default input_cql Statement (CASSANDRA-7226)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/af188ed3/src/java/org/apache/cassandra/cql3/Constants.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/Constants.java
index 48f62dc,5189517..a8f0120
--- a/src/java/org/apache/cassandra/cql3/Constants.java
+++ b/src/java/org/apache/cassandra/cql3/Constants.java
@@@ -329,8 -322,9 +329,8 @@@ public abstract class Constant
              if (bytes == null)
                  throw new InvalidRequestException("Invalid null value for 
counter increment");
              long increment = ByteBufferUtil.toLong(bytes);
 -            prefix = maybeUpdatePrefix(cf.metadata(), prefix);
 -            ByteBuffer cname = columnName == null ? prefix.build() : 
prefix.add(columnName.key).build();
 +            CellName cname = cf.getComparator().create(prefix, column);
-             cf.addCounter(cname, increment);
+             cf.addColumn(params.makeCounter(cname, increment));
          }
      }
  
@@@ -351,8 -345,9 +351,8 @@@
              if (increment == Long.MIN_VALUE)
                  throw new InvalidRequestException("The negation of " + 
increment + " overflows supported counter precision (signed 8 bytes integer)");
  
 -            prefix = maybeUpdatePrefix(cf.metadata(), prefix);
 -            ByteBuffer cname = columnName == null ? prefix.build() : 
prefix.add(columnName.key).build();
 +            CellName cname = cf.getComparator().create(prefix, column);
-             cf.addCounter(cname, -increment);
+             cf.addColumn(params.makeCounter(cname, -increment));
          }
      }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/af188ed3/src/java/org/apache/cassandra/cql3/UpdateParameters.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/UpdateParameters.java
index 8a47536,c543d6c..d31b8d9
--- a/src/java/org/apache/cassandra/cql3/UpdateParameters.java
+++ b/src/java/org/apache/cassandra/cql3/UpdateParameters.java
@@@ -23,10 -23,10 +23,11 @@@ 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.db.composites.CellName;
 +import org.apache.cassandra.db.filter.ColumnSlice;
  import org.apache.cassandra.exceptions.InvalidRequestException;
 -import org.apache.cassandra.utils.Pair;
++import org.apache.cassandra.utils.FBUtilities;
  
  /**
   * A simple container that simplify passing parameters for collections 
methods.
@@@ -52,33 -52,39 +53,39 @@@ public class UpdateParameter
          this.prefetchedLists = prefetchedLists;
      }
  
 -    public Column makeColumn(ByteBuffer name, ByteBuffer value) throws 
InvalidRequestException
 +    public Cell makeColumn(CellName name, ByteBuffer value) throws 
InvalidRequestException
      {
 -        QueryProcessor.validateCellName(name);
 -        return Column.create(name, value, timestamp, ttl, metadata);
 +        QueryProcessor.validateCellName(name, metadata.comparator);
 +        return AbstractCell.create(name, value, timestamp, ttl, metadata);
      }
  
 -    public Column makeCounter(ByteBuffer name, long delta) throws 
InvalidRequestException
 -    {
 -        QueryProcessor.validateCellName(name);
 -        return new CounterUpdateColumn(name, delta, 
System.currentTimeMillis());
 -    }
++     public Cell makeCounter(CellName name, long delta) throws 
InvalidRequestException
++     {
++         QueryProcessor.validateCellName(name, metadata.comparator);
++         return new BufferCounterUpdateCell(name, delta, 
FBUtilities.timestampMicros());
++     }
+ 
 -    public Column makeTombstone(ByteBuffer name) throws 
InvalidRequestException
 +    public Cell makeTombstone(CellName name) throws InvalidRequestException
      {
 -        QueryProcessor.validateCellName(name);
 -        return new DeletedColumn(name, localDeletionTime, timestamp);
 +        QueryProcessor.validateCellName(name, metadata.comparator);
 +        return new BufferDeletedCell(name, localDeletionTime, timestamp);
      }
  
 -    public RangeTombstone makeRangeTombstone(ByteBuffer start, ByteBuffer 
end) throws InvalidRequestException
 +    public RangeTombstone makeRangeTombstone(ColumnSlice slice) throws 
InvalidRequestException
      {
 -        QueryProcessor.validateCellName(start);
 -        QueryProcessor.validateCellName(end);
 -        return new RangeTombstone(start, end, timestamp, localDeletionTime);
 +        QueryProcessor.validateComposite(slice.start, metadata.comparator);
 +        QueryProcessor.validateComposite(slice.finish, metadata.comparator);
 +        return new RangeTombstone(slice.start, slice.finish, timestamp, 
localDeletionTime);
      }
  
 -    public RangeTombstone makeTombstoneForOverwrite(ByteBuffer start, 
ByteBuffer end) throws InvalidRequestException
 +    public RangeTombstone makeTombstoneForOverwrite(ColumnSlice slice) throws 
InvalidRequestException
      {
 -        QueryProcessor.validateCellName(start);
 -        QueryProcessor.validateCellName(end);
 -        return new RangeTombstone(start, end, timestamp - 1, 
localDeletionTime);
 +        QueryProcessor.validateComposite(slice.start, metadata.comparator);
 +        QueryProcessor.validateComposite(slice.finish, metadata.comparator);
 +        return new RangeTombstone(slice.start, slice.finish, timestamp - 1, 
localDeletionTime);
      }
  
 -    public List<Pair<ByteBuffer, Column>> getPrefetchedList(ByteBuffer 
rowKey, ByteBuffer cql3ColumnName)
 +    public List<Cell> getPrefetchedList(ByteBuffer rowKey, ColumnIdentifier 
cql3ColumnName)
      {
          if (prefetchedLists == null)
              return Collections.emptyList();

Reply via email to