Merge branch 'cassandra-2.0' into cassandra-2.1 Conflicts: src/java/org/apache/cassandra/config/CFMetaData.java src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java src/java/org/apache/cassandra/db/marshal/CounterColumnType.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9c38a103 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9c38a103 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9c38a103 Branch: refs/heads/cassandra-2.1 Commit: 9c38a103bab8244ea2887cdb821752e0c815f79b Parents: cdcf646 d0005a8 Author: Tyler Hobbs <ty...@datastax.com> Authored: Fri Jan 30 16:41:23 2015 -0600 Committer: Tyler Hobbs <ty...@datastax.com> Committed: Fri Jan 30 16:41:23 2015 -0600 ---------------------------------------------------------------------- CHANGES.txt | 7 ++++--- .../apache/cassandra/cql3/statements/AlterTableStatement.java | 4 ++++ src/java/org/apache/cassandra/cql3/statements/CFPropDefs.java | 5 +++++ .../cassandra/cql3/statements/CreateTableStatement.java | 6 ++++++ 4 files changed, 19 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c38a103/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 92c1a17,4754867..129e1c9 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,95 -1,13 +1,96 @@@ -2.0.13: +2.1.3 + * Upgrade libthrift to 0.9.2 (CASSANDRA-8685) + * Don't use the shared ref in sstableloader (CASSANDRA-8704) + * Purge internal prepared statements if related tables or + keyspaces are dropped (CASSANDRA-8693) + * (cqlsh) Handle unicode BOM at start of files (CASSANDRA-8638) + * Stop compactions before exiting offline tools (CASSANDRA-8623) + * Update tools/stress/README.txt to match current behaviour (CASSANDRA-7933) + * Fix schema from Thrift conversion with empty metadata (CASSANDRA-8695) + * Safer Resource Management (CASSANDRA-7705) + * Make sure we compact highly overlapping cold sstables with + STCS (CASSANDRA-8635) + * rpc_interface and listen_interface generate NPE on startup when specified + interface doesn't exist (CASSANDRA-8677) + * Fix ArrayIndexOutOfBoundsException in nodetool cfhistograms (CASSANDRA-8514) + * Switch from yammer metrics for nodetool cf/proxy histograms (CASSANDRA-8662) + * Make sure we don't add tmplink files to the compaction + strategy (CASSANDRA-8580) + * (cqlsh) Handle maps with blob keys (CASSANDRA-8372) + * (cqlsh) Handle DynamicCompositeType schemas correctly (CASSANDRA-8563) + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707) + * Add tooling to detect hot partitions (CASSANDRA-7974) + * Fix cassandra-stress user-mode truncation of partition generation (CASSANDRA-8608) + * Only stream from unrepaired sstables during inc repair (CASSANDRA-8267) + * Don't allow starting multiple inc repairs on the same sstables (CASSANDRA-8316) + * Invalidate prepared BATCH statements when related tables + or keyspaces are dropped (CASSANDRA-8652) + * Fix missing results in secondary index queries on collections + with ALLOW FILTERING (CASSANDRA-8421) + * Expose EstimatedHistogram metrics for range slices (CASSANDRA-8627) + * (cqlsh) Escape clqshrc passwords properly (CASSANDRA-8618) + * Fix NPE when passing wrong argument in ALTER TABLE statement (CASSANDRA-8355) + * Pig: Refactor and deprecate CqlStorage (CASSANDRA-8599) + * Don't reuse the same cleanup strategy for all sstables (CASSANDRA-8537) + * Fix case-sensitivity of index name on CREATE and DROP INDEX + statements (CASSANDRA-8365) + * Better detection/logging for corruption in compressed sstables (CASSANDRA-8192) + * Use the correct repairedAt value when closing writer (CASSANDRA-8570) + * (cqlsh) Handle a schema mismatch being detected on startup (CASSANDRA-8512) + * Properly calculate expected write size during compaction (CASSANDRA-8532) + * Invalidate affected prepared statements when a table's columns + are altered (CASSANDRA-7910) + * Stress - user defined writes should populate sequentally (CASSANDRA-8524) + * Fix regression in SSTableRewriter causing some rows to become unreadable + during compaction (CASSANDRA-8429) + * Run major compactions for repaired/unrepaired in parallel (CASSANDRA-8510) + * (cqlsh) Fix compression options in DESCRIBE TABLE output when compression + is disabled (CASSANDRA-8288) + * (cqlsh) Fix DESCRIBE output after keyspaces are altered (CASSANDRA-7623) + * Make sure we set lastCompactedKey correctly (CASSANDRA-8463) + * (cqlsh) Fix output of CONSISTENCY command (CASSANDRA-8507) + * (cqlsh) Fixed the handling of LIST statements (CASSANDRA-8370) + * Make sstablescrub check leveled manifest again (CASSANDRA-8432) + * Check first/last keys in sstable when giving out positions (CASSANDRA-8458) + * Disable mmap on Windows (CASSANDRA-6993) + * Add missing ConsistencyLevels to cassandra-stress (CASSANDRA-8253) + * Add auth support to cassandra-stress (CASSANDRA-7985) + * Fix ArrayIndexOutOfBoundsException when generating error message + for some CQL syntax errors (CASSANDRA-8455) + * Scale memtable slab allocation logarithmically (CASSANDRA-7882) + * cassandra-stress simultaneous inserts over same seed (CASSANDRA-7964) + * Reduce cassandra-stress sampling memory requirements (CASSANDRA-7926) + * Ensure memtable flush cannot expire commit log entries from its future (CASSANDRA-8383) + * Make read "defrag" async to reclaim memtables (CASSANDRA-8459) + * Remove tmplink files for offline compactions (CASSANDRA-8321) + * Reduce maxHintsInProgress (CASSANDRA-8415) + * BTree updates may call provided update function twice (CASSANDRA-8018) + * Release sstable references after anticompaction (CASSANDRA-8386) + * Handle abort() in SSTableRewriter properly (CASSANDRA-8320) + * Fix high size calculations for prepared statements (CASSANDRA-8231) + * Centralize shared executors (CASSANDRA-8055) + * Fix filtering for CONTAINS (KEY) relations on frozen collection + clustering columns when the query is restricted to a single + partition (CASSANDRA-8203) + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243) + * Add more log info if readMeter is null (CASSANDRA-8238) + * add check of the system wall clock time at startup (CASSANDRA-8305) + * Support for frozen collections (CASSANDRA-7859) + * Fix overflow on histogram computation (CASSANDRA-8028) + * Have paxos reuse the timestamp generation of normal queries (CASSANDRA-7801) + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291) + * Improve JBOD disk utilization (CASSANDRA-7386) + * Log failed host when preparing incremental repair (CASSANDRA-8228) + * Force config client mode in CQLSSTableWriter (CASSANDRA-8281) + * Fix sstableupgrade throws exception (CASSANDRA-8688) +Merged from 2.0: - ======= - 2.0.13: - * Fix SSTableSimpleUnsortedWriter ConcurrentModificationException (CASSANDRA-8619) + * Prevent non-zero default_time_to_live on tables with counters + (CASSANDRA-8678) + * Fix SSTableSimpleUnsortedWriter ConcurrentModificationException + (CASSANDRA-8619) * Round up time deltas lower than 1ms in BulkLoader (CASSANDRA-8645) * Add batch remove iterator to ABSC (CASSANDRA-8414, 8666) - - -2.0.12: + * Round up time deltas lower than 1ms in BulkLoader (CASSANDRA-8645) * Use more efficient slice size for querying internal secondary index tables (CASSANDRA-8550) * Fix potentially returning deleted rows with range tombstone (CASSANDRA-8558) http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c38a103/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c38a103/src/java/org/apache/cassandra/cql3/statements/CFPropDefs.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/cql3/statements/CFPropDefs.java index aee86a8,11aa9b2..343c0c0 --- a/src/java/org/apache/cassandra/cql3/statements/CFPropDefs.java +++ b/src/java/org/apache/cassandra/cql3/statements/CFPropDefs.java @@@ -149,22 -137,12 +149,27 @@@ public class CFPropDefs extends Propert return new HashMap<>(); return compressionOptions; } + public CachingOptions getCachingOptions() throws SyntaxException, ConfigurationException + { + CachingOptions options = null; + Object val = properties.get(KW_CACHING); + if (val == null) + return null; + else if (val instanceof Map) + options = CachingOptions.fromMap(getMap(KW_CACHING)); + else if (val instanceof String) // legacy syntax + { + options = CachingOptions.fromString(getSimple(KW_CACHING)); + logger.warn("Setting caching options with deprecated syntax."); + } + return options; + } + public Integer getDefaultTimeToLive() throws SyntaxException + { + return getInt(KW_DEFAULT_TIME_TO_LIVE, 0); + } + public void applyToCFMetadata(CFMetaData cfm) throws ConfigurationException, SyntaxException { if (hasProperty(KW_COMMENT)) http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c38a103/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java index 5f70ab8,5215118..17fd6fd --- a/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java @@@ -199,17 -207,21 +199,21 @@@ public class CreateTableStatement exten CreateTableStatement stmt = new CreateTableStatement(cfName, properties, ifNotExists, staticColumns); + boolean hasCounters = false; - Map<ByteBuffer, CollectionType> definedCollections = null; - for (Map.Entry<ColumnIdentifier, CQL3Type> entry : definitions.entrySet()) + Map<ByteBuffer, CollectionType> definedMultiCellCollections = null; + for (Map.Entry<ColumnIdentifier, CQL3Type.Raw> entry : definitions.entrySet()) { ColumnIdentifier id = entry.getKey(); - CQL3Type pt = entry.getValue(); - if (pt.isCollection()) + CQL3Type pt = entry.getValue().prepare(keyspace()); + if (pt.isCollection() && ((CollectionType) pt.getType()).isMultiCell()) { - if (definedCollections == null) - definedCollections = new HashMap<ByteBuffer, CollectionType>(); - definedCollections.put(id.key, (CollectionType)pt.getType()); + if (definedMultiCellCollections == null) + definedMultiCellCollections = new HashMap<>(); + definedMultiCellCollections.put(id.bytes, (CollectionType) pt.getType()); } + else if (entry.getValue().isCounter()) + hasCounters = true; + stmt.columns.put(id, pt.getType()); // we'll remove what is not a column below }