Merge branch 'cassandra-2.0' into trunk Conflicts: src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/aac421aa Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/aac421aa Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/aac421aa Branch: refs/heads/trunk Commit: aac421aaa1d2cf214839eedd55abf35958ae4487 Parents: f007a35 b0e4f00 Author: Aleksey Yeschenko <alek...@apache.org> Authored: Wed Feb 12 02:05:16 2014 +0300 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Wed Feb 12 02:05:16 2014 +0300 ---------------------------------------------------------------------- CHANGES.txt | 3 +++ .../cql3/statements/ModificationStatement.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/aac421aa/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index eec6296,aec6f5e..8e7e249 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,35 -1,3 +1,37 @@@ +2.1 + * add listsnapshots command to nodetool (CASSANDRA-5742) + * Introduce AtomicBTreeColumns (CASSANDRA-6271) + * Multithreaded commitlog (CASSANDRA-3578) + * allocate fixed index summary memory pool and resample cold index summaries + to use less memory (CASSANDRA-5519) + * Removed multithreaded compaction (CASSANDRA-6142) + * Parallelize fetching rows for low-cardinality indexes (CASSANDRA-1337) + * change logging from log4j to logback (CASSANDRA-5883) + * switch to LZ4 compression for internode communication (CASSANDRA-5887) + * Stop using Thrift-generated Index* classes internally (CASSANDRA-5971) + * Remove 1.2 network compatibility code (CASSANDRA-5960) + * Remove leveled json manifest migration code (CASSANDRA-5996) + * Remove CFDefinition (CASSANDRA-6253) + * Use AtomicIntegerFieldUpdater in RefCountedMemory (CASSANDRA-6278) + * User-defined types for CQL3 (CASSANDRA-5590) + * Use of o.a.c.metrics in nodetool (CASSANDRA-5871, 6406) + * Batch read from OTC's queue and cleanup (CASSANDRA-1632) + * Secondary index support for collections (CASSANDRA-4511, 6383) + * SSTable metadata(Stats.db) format change (CASSANDRA-6356) + * Push composites support in the storage engine + (CASSANDRA-5417, CASSANDRA-6520) + * Add snapshot space used to cfstats (CASSANDRA-6231) + * Add cardinality estimator for key count estimation (CASSANDRA-5906) + * CF id is changed to be non-deterministic. Data dir/key cache are created + uniquely for CF id (CASSANDRA-5202) + * New counters implementation (CASSANDRA-6504) + * Replace UnsortedColumns and TreeMapBackedSortedColumns with rewritten + ArrayBackedSortedColumns (CASSANDRA-6630, CASSANDRA-6662) + * Add option to use row cache with a given amount of rows (CASSANDRA-5357) + * Avoid repairing already repaired data (CASSANDRA-5351) ++ * Reject counter updates with USING TTL/TIMESTAMP (CASSANDRA-6649) ++ + 2.0.6 * Add compatibility for Hadoop 0.2.x (CASSANDRA-5201) * Fix EstimatedHistogram races (CASSANDRA-6682) @@@ -45,8 -16,8 +47,9 @@@ Merged from 1.2 * Fix partition and range deletes not triggering flush (CASSANDRA-6655) * Fix mean cells and mean row size per sstable calculations (CASSANDRA-6667) * Compact hints after partial replay to clean out tombstones (CASSANDRA-6666) + * Log USING TTL/TIMESTAMP in a counter update warning (CASSANDRA-6649) + 2.0.5 * Reduce garbage generated by bloom filter lookups (CASSANDRA-6609) * Add ks.cf names to tombstone logging (CASSANDRA-6597) http://git-wip-us.apache.org/repos/asf/cassandra/blob/aac421aa/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java index 3775bde,676286c..6d18f1b --- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java @@@ -126,7 -131,26 +126,13 @@@ public abstract class ModificationState public void validate(ClientState state) throws InvalidRequestException { if (hasConditions() && attrs.isTimestampSet()) -- throw new InvalidRequestException("Custom timestamps are not allowed when conditions are used"); ++ throw new InvalidRequestException("Cannot provide custom timestamp for conditional updates"); + - if (isCounter()) - { - if (attrs.isTimestampSet() && !loggedCounterTimestamp) - { - logger.warn("Detected use of 'USING TIMESTAMP' in a counter UPDATE. This is invalid " + - "because counters do not use timestamps, and the timestamp has been ignored. " + - "Such queries will be rejected in Cassandra 2.1+ - please fix your queries before then."); - loggedCounterTimestamp = true; - } ++ if (isCounter() && attrs.isTimestampSet()) ++ throw new InvalidRequestException("Cannot provide custom timestamp for counter updates"); + - if (attrs.isTimeToLiveSet() && !loggedCounterTTL) - { - logger.warn("Detected use of 'USING TTL' in a counter UPDATE. This is invalid " + - "because counter tables do not support TTL, and the TTL value has been ignored. " + - "Such queries will be rejected in Cassandra 2.1+ - please fix your queries before then."); - loggedCounterTTL = true; - } - } ++ if (isCounter() && attrs.isTimeToLiveSet()) ++ throw new InvalidRequestException("Cannot provide custom TTL for counter updates"); } public void addOperation(Operation op) @@@ -655,15 -690,15 +661,15 @@@ Attributes preparedAttributes = attrs.prepare(keyspace(), columnFamily()); preparedAttributes.collectMarkerSpecification(boundNames); - ModificationStatement stmt = prepareInternal(cfDef, boundNames, preparedAttributes); + ModificationStatement stmt = prepareInternal(metadata, boundNames, preparedAttributes); - if (ifNotExists || (conditions != null && !conditions.isEmpty())) + if (ifNotExists || !conditions.isEmpty()) { if (stmt.isCounter()) throw new InvalidRequestException("Conditional updates are not supported on counter tables"); if (attrs.timestamp != null) -- throw new InvalidRequestException("Cannot provide custom timestamp for conditional update"); ++ throw new InvalidRequestException("Cannot provide custom timestamp for conditional updates"); if (ifNotExists) {