[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/b45cb104 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b45cb104 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b45cb104 Branch: refs/heads/cassandra-3.0 Commit: b45cb10445731fdef67b720ab216a038b9499928 Parents: 2acc15b 70e8b39 Author: Benjamin Lerer Authored: Wed Jan 11 21:08:01 2017 +0100 Committer: Benjamin Lerer Committed: Wed Jan 11 21:09:29 2017 +0100 -- CHANGES.txt | 1 + .../org/apache/cassandra/service/pager/RangeSliceQueryPager.java | 3 ++- test/unit/org/apache/cassandra/service/QueryPagerTest.java| 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b45cb104/CHANGES.txt -- diff --cc CHANGES.txt index a7e89ed,414d6ed..4f769a1 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,33 -1,9 +1,34 @@@ -2.1.17 +2.2.9 + * Remove support for non-JavaScript UDFs (CASSANDRA-12883) + * Fix DynamicEndpointSnitch noop in multi-datacenter situations (CASSANDRA-13074) + * cqlsh copy-from: encode column names to avoid primary key parsing errors (CASSANDRA-12909) + * Temporarily fix bug that creates commit log when running offline tools (CASSANDRA-8616) + * Reduce granuality of OpOrder.Group during index build (CASSANDRA-12796) + * Test bind parameters and unset parameters in InsertUpdateIfConditionTest (CASSANDRA-12980) + * Do not specify local address on outgoing connection when listen_on_broadcast_address is set (CASSANDRA-12673) + * Use saved tokens when setting local tokens on StorageService.joinRing (CASSANDRA-12935) + * cqlsh: fix DESC TYPES errors (CASSANDRA-12914) + * Fix leak on skipped SSTables in sstableupgrade (CASSANDRA-12899) + * Avoid blocking gossip during pending range calculation (CASSANDRA-12281) + * Fix purgeability of tombstones with max timestamp (CASSANDRA-12792) + * Fail repair if participant dies during sync or anticompaction (CASSANDRA-12901) + * cqlsh COPY: unprotected pk values before converting them if not using prepared statements (CASSANDRA-12863) + * Fix Util.spinAssertEquals (CASSANDRA-12283) + * Fix potential NPE for compactionstats (CASSANDRA-12462) + * Prepare legacy authenticate statement if credentials table initialised after node startup (CASSANDRA-12813) + * Change cassandra.wait_for_tracing_events_timeout_secs default to 0 (CASSANDRA-12754) + * Clean up permissions when a UDA is dropped (CASSANDRA-12720) + * Limit colUpdateTimeDelta histogram updates to reasonable deltas (CASSANDRA-7) + * Fix leak errors and execution rejected exceptions when draining (CASSANDRA-12457) + * Fix merkle tree depth calculation (CASSANDRA-12580) + * Make Collections deserialization more robust (CASSANDRA-12618) + * Better handle invalid system roles table (CASSANDRA-12700) + * Split consistent range movement flag correction (CASSANDRA-12786) + * CompactionTasks now correctly drops sstables out of compaction when not enough disk space is available (CASSANDRA-12979) +Merged from 2.1: + * Fix paging for DISTINCT queries on partition keys and static columns (CASSANDRA-13017) * Fix race causing infinite loop if Thrift server is stopped before it starts listening (CASSANDRA-12856) * cqlsh copy-from: sort user type fields in csv (CASSANDRA-12959) - * Fix missed signal when commit log segments are recycled (CASSANDRA-13037) - * Fix RecoveryManagerTruncateTest (CASSANDRA-12802) * Don't skip sstables based on maxLocalDeletionTime (CASSANDRA-12765) http://git-wip-us.apache.org/repos/asf/cassandra/blob/b45cb104/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java -- diff --cc src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java index 8ec9f4c,3ac777e..3b16e0b --- a/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java +++ b/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java @@@ -72,10 -72,10 +72,11 @@@ public class RangeSliceQueryPager exten protected List queryNextPage(int pageSize, ConsistencyLevel consistencyLevel, boolean localQuery) throws RequestExecutionException { -SliceQueryFilter sf = (SliceQueryFilter)columnFilter; +SliceQueryFilter rawFilter = (SliceQueryFilter)columnFilter; +SliceQueryFilter sf = rawFilter.withUpdatedCount(Math.min(rawFilter.count, pageSize)); AbstractBounds keyRange = lastReturnedKey == null ? command.keyRange : makeIncludingKeyBounds(lastReturnedKey); - Composite start = lastReturnedName == null
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/c5fdb32c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c5fdb32c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c5fdb32c Branch: refs/heads/cassandra-3.0 Commit: c5fdb32ceef796514cd0679f425e68c120a3e06e Parents: be6e6ea 83ae5f3 Author: Michael Shuler Authored: Mon Oct 10 17:10:10 2016 -0500 Committer: Michael Shuler Committed: Mon Oct 10 17:10:10 2016 -0500 -- --
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/e06dae81 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e06dae81 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e06dae81 Branch: refs/heads/cassandra-3.0 Commit: e06dae81fb08870ef6a6596b1557b88fc7762302 Parents: 65f8bb6 c857919 Author: Benjamin Lerer Authored: Mon Jul 4 14:20:34 2016 +0200 Committer: Benjamin Lerer Committed: Mon Jul 4 14:22:55 2016 +0200 -- CHANGES.txt | 1 + .../restrictions/MultiColumnRestriction.java| 2 +- .../restrictions/PrimaryKeyRestrictionSet.java | 81 .../restrictions/StatementRestrictions.java | 42 -- .../SelectMultiColumnRelationTest.java | 32 +++- .../cql3/validation/operations/SelectTest.java | 61 +++ 6 files changed, 142 insertions(+), 77 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e06dae81/CHANGES.txt -- diff --cc CHANGES.txt index 13a1c4f,0967ce4..451575c --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,41 -1,9 +1,42 @@@ -2.1.16 +2.2.8 + * MemoryUtil.getShort() should return an unsigned short also for architectures not supporting unaligned memory accesses (CASSANDRA-11973) +Merged from 2.1: + * Fix filtering on clustering columns when 2i is used (CASSANDRA-11907) - * Reduce contention getting instances of CompositeType (CASSANDRA-10433) - -2.1.15 * Account for partition deletions in tombstone histogram (CASSANDRA-12112) + + +2.2.7 + * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755) + * Validate bloom_filter_fp_chance against lowest supported + value when the table is created (CASSANDRA-11920) + * RandomAccessReader: call isEOF() only when rebuffering, not for every read operation (CASSANDRA-12013) + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038) + * StorageService shutdown hook should use a volatile variable (CASSANDRA-11984) + * Persist local metadata earlier in startup sequence (CASSANDRA-11742) + * Run CommitLog tests with different compression settings (CASSANDRA-9039) + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664) + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587) + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743) + * Enable client encryption in sstableloader with cli options (CASSANDRA-11708) + * Possible memory leak in NIODataInputStream (CASSANDRA-11867) + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669) + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753) + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395) + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626) + * Exit JVM if JMX server fails to startup (CASSANDRA-11540) + * Produce a heap dump when exiting on OOM (CASSANDRA-9861) + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427) + * Restore ability to filter on clustering columns when using a 2i (CASSANDRA-11510) + * JSON datetime formatting needs timezone (CASSANDRA-11137) + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502) + * Remove unnescessary file existence check during anticompaction (CASSANDRA-11660) + * Add missing files to debian packages (CASSANDRA-11642) + * Avoid calling Iterables::concat in loops during ModificationStatement::getFunctions (CASSANDRA-11621) + * cqlsh: COPY FROM should use regular inserts for single statement batches and + report errors correctly if workers processes crash on initialization (CASSANDRA-11474) + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553) + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988) +Merged from 2.1: * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043) * Remove finished incoming streaming connections from MessagingService (CASSANDRA-11854) * Don't try to get sstables for non-repairing column families (CASSANDRA-12077) http://git-wip-us.apache.org/repos/asf/cassandra/blob/e06dae81/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java -- diff --cc src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java index 96e6f2b,000..51e2ce4 mode 100644,00..100644 --- a/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java +++ b/src/java/org/apache/cassandra/cql3/restrictions/MultiColumnRestriction.java @@@ -1,515 -1,0 +1,515 @@@ +/* + * Licensed to the Apache Software Fou
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/5a096274 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5a096274 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5a096274 Branch: refs/heads/cassandra-3.0 Commit: 5a096274dc592c35efe0dfaa12bf4bc40b02402b Parents: 68398ad 85f2bbf Author: Benjamin Lerer Authored: Tue Jun 21 16:25:23 2016 +0200 Committer: Benjamin Lerer Committed: Tue Jun 21 16:25:23 2016 +0200 -- CHANGES.txt | 5 + .../cql3/statements/ModificationStatement.java | 5 +- .../apache/cassandra/service/StorageProxy.java | 5 +- .../operations/InsertUpdateIfConditionTest.java | 291 ++- 4 files changed, 302 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a096274/CHANGES.txt -- diff --cc CHANGES.txt index ef993fe,7944967..fe4728d --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,32 -1,5 +1,37 @@@ ++<<< HEAD +2.2.7 + * RandomAccessReader: call isEOF() only when rebuffering, not for every read operation (CASSANDRA-12013) + * Don't send erroneous NEW_NODE notifications on restart (CASSANDRA-11038) + * StorageService shutdown hook should use a volatile variable (CASSANDRA-11984) + * Persist local metadata earlier in startup sequence (CASSANDRA-11742) + * Run CommitLog tests with different compression settings (CASSANDRA-9039) + * cqlsh: fix tab completion for case-sensitive identifiers (CASSANDRA-11664) + * Avoid showing estimated key as -1 in tablestats (CASSANDRA-11587) + * Fix possible race condition in CommitLog.recover (CASSANDRA-11743) + * Enable client encryption in sstableloader with cli options (CASSANDRA-11708) + * Possible memory leak in NIODataInputStream (CASSANDRA-11867) + * Fix commit log replay after out-of-order flush completion (CASSANDRA-9669) + * Add seconds to cqlsh tracing session duration (CASSANDRA-11753) + * Prohibit Reverse Counter type as part of the PK (CASSANDRA-9395) + * cqlsh: correctly handle non-ascii chars in error messages (CASSANDRA-11626) + * Exit JVM if JMX server fails to startup (CASSANDRA-11540) + * Produce a heap dump when exiting on OOM (CASSANDRA-9861) + * Avoid read repairing purgeable tombstones on range slices (CASSANDRA-11427) + * Restore ability to filter on clustering columns when using a 2i (CASSANDRA-11510) + * JSON datetime formatting needs timezone (CASSANDRA-11137) + * Fix is_dense recalculation for Thrift-updated tables (CASSANDRA-11502) + * Remove unnescessary file existence check during anticompaction (CASSANDRA-11660) + * Add missing files to debian packages (CASSANDRA-11642) + * Avoid calling Iterables::concat in loops during ModificationStatement::getFunctions (CASSANDRA-11621) + * cqlsh: COPY FROM should use regular inserts for single statement batches and + report errors correctly if workers processes crash on initialization (CASSANDRA-11474) + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553) + * Fix slice queries on ordered COMPACT tables (CASSANDRA-10988) +Merged from 2.1: ++=== + 2.1.15 + * Remove distinction between non-existing static columns and existing but null in LWTs (CASSANDRA-9842) ++>>> asf/cassandra-2.1 * Support mlockall on IBM POWER arch (CASSANDRA-11576) * Cache local ranges when calculating repair neighbors (CASSANDRA-11933) * Allow LWT operation on static column with only partition keys (CASSANDRA-10532) http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a096274/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a096274/src/java/org/apache/cassandra/service/StorageProxy.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a096274/test/unit/org/apache/cassandra/cql3/validation/operations/InsertUpdateIfConditionTest.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/e865e396 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e865e396 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e865e396 Branch: refs/heads/cassandra-3.0 Commit: e865e396cdd6281f7eaac9cde8b5528547cb8e98 Parents: 60997c2 4389c9c Author: Tyler Hobbs Authored: Wed Apr 20 13:55:28 2016 -0500 Committer: Tyler Hobbs Committed: Wed Apr 20 13:55:28 2016 -0500 -- CHANGES.txt| 3 + pylib/cqlshlib/copyutil.py | 171 +--- 2 files changed, 92 insertions(+), 82 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e865e396/CHANGES.txt -- diff --cc CHANGES.txt index baaf227,4a91a58..cf07e80 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,58 -1,12 +1,61 @@@ -2.1.14 +2.2.7 + * Always close cluster with connection in CqlRecordWriter (CASSANDRA-11553) ++Merged from 2.1: + * (cqlsh) Fix potential COPY deadlock when parent process is terminating child +processes (CASSANDRA-11505) - * Replace sstables on DataTracker before marking them as non-compacting during anti-compaction (CASSANDRA-11548) + + +2.2.6 + * Allow only DISTINCT queries with partition keys restrictions (CASSANDRA-11339) + * CqlConfigHelper no longer requires both a keystore and truststore to work (CASSANDRA-11532) + * Make deprecated repair methods backward-compatible with previous notification service (CASSANDRA-11430) + * IncomingStreamingConnection version check message wrong (CASSANDRA-11462) + * DatabaseDescriptor should log stacktrace in case of Eception during seed provider creation (CASSANDRA-11312) + * Use canonical path for directory in SSTable descriptor (CASSANDRA-10587) + * Add cassandra-stress keystore option (CASSANDRA-9325) + * Fix out-of-space error treatment in memtable flushing (CASSANDRA-11448). + * Dont mark sstables as repairing with sub range repairs (CASSANDRA-11451) + * Fix use of NullUpdater for 2i during compaction (CASSANDRA-11450) + * Notify when sstables change after cancelling compaction (CASSANDRA-11373) + * cqlsh: COPY FROM should check that explicit column names are valid (CASSANDRA-11333) + * Add -Dcassandra.start_gossip startup option (CASSANDRA-10809) + * Fix UTF8Validator.validate() for modified UTF-8 (CASSANDRA-10748) + * Clarify that now() function is calculated on the coordinator node in CQL documentation (CASSANDRA-10900) + * Fix bloom filter sizing with LCS (CASSANDRA-11344) + * (cqlsh) Fix error when result is 0 rows with EXPAND ON (CASSANDRA-11092) + * Fix intra-node serialization issue for multicolumn-restrictions (CASSANDRA-11196) + * Non-obsoleting compaction operations over compressed files can impose rate limit on normal reads (CASSANDRA-11301) + * Add missing newline at end of bin/cqlsh (CASSANDRA-11325) + * Fix AE in nodetool cfstats (backport CASSANDRA-10859) (CASSANDRA-11297) + * Unresolved hostname leads to replace being ignored (CASSANDRA-11210) + * Fix filtering on non-primary key columns for thrift static column families + (CASSANDRA-6377) + * Only log yaml config once, at startup (CASSANDRA-11217) + * Preserve order for preferred SSL cipher suites (CASSANDRA-11164) + * Reference leak with parallel repairs on the same table (CASSANDRA-11215) + * Range.compareTo() violates the contract of Comparable (CASSANDRA-11216) + * Avoid NPE when serializing ErrorMessage with null message (CASSANDRA-11167) + * Replacing an aggregate with a new version doesn't reset INITCOND (CASSANDRA-10840) + * (cqlsh) cqlsh cannot be called through symlink (CASSANDRA-11037) + * fix ohc and java-driver pom dependencies in build.xml (CASSANDRA-10793) + * Protect from keyspace dropped during repair (CASSANDRA-11065) + * Handle adding fields to a UDT in SELECT JSON and toJson() (CASSANDRA-11146) + * Better error message for cleanup (CASSANDRA-10991) + * cqlsh pg-style-strings broken if line ends with ';' (CASSANDRA-11123) + * Use cloned TokenMetadata in size estimates to avoid race against membership check + (CASSANDRA-10736) + * Always persist upsampled index summaries (CASSANDRA-10512) + * (cqlsh) Fix inconsistent auto-complete (CASSANDRA-10733) + * Make SELECT JSON and toJson() threadsafe (CASSANDRA-11048) + * Fix SELECT on tuple relations for mixed ASC/DESC clustering order (CASSANDRA-7281) + * (cqlsh) Support utf-8/cp65001 encoding on Windows (CASSANDRA-11030) + * Fix paging on DISTINCT queries repeats result when first row in partition changes + (CASSANDRA-10010) +Merged from 2.1: * Checking if an unlogged batch is local is inefficient (CASSANDRA-11529) * Fix paging for COMPACT
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/e22faeb8 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e22faeb8 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e22faeb8 Branch: refs/heads/cassandra-3.0 Commit: e22faeb8c5463a34b630aff8e265aefbe950b58d Parents: 96c53e0 2dd244b Author: Benjamin Lerer Authored: Mon Apr 11 09:43:56 2016 +0200 Committer: Benjamin Lerer Committed: Mon Apr 11 09:44:08 2016 +0200 -- src/java/org/apache/cassandra/db/commitlog/CommitLog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e22faeb8/src/java/org/apache/cassandra/db/commitlog/CommitLog.java --
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/2ed85559 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2ed85559 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2ed85559 Branch: refs/heads/cassandra-3.0 Commit: 2ed855592ab77399e061f03f73a943aefbd44eaf Parents: 0ac2072 ea9b42e Author: Benjamin Lerer Authored: Sat Apr 2 17:59:37 2016 +0200 Committer: Benjamin Lerer Committed: Sat Apr 2 17:59:37 2016 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/service/pager/AbstractQueryPager.java| 3 +++ 2 files changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2ed85559/CHANGES.txt -- diff --cc CHANGES.txt index 28903c5,113da17..4c81a98 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,48 -1,8 +1,49 @@@ -2.1.14 +2.2.6 + * DatabaseDescriptor should log stacktrace in case of Eception during seed provider creation (CASSANDRA-11312) + * Use canonical path for directory in SSTable descriptor (CASSANDRA-10587) + * Add cassandra-stress keystore option (CASSANDRA-9325) + * Fix out-of-space error treatment in memtable flushing (CASSANDRA-11448). + * Dont mark sstables as repairing with sub range repairs (CASSANDRA-11451) + * Fix use of NullUpdater for 2i during compaction (CASSANDRA-11450) + * Notify when sstables change after cancelling compaction (CASSANDRA-11373) + * cqlsh: COPY FROM should check that explicit column names are valid (CASSANDRA-11333) + * Add -Dcassandra.start_gossip startup option (CASSANDRA-10809) + * Fix UTF8Validator.validate() for modified UTF-8 (CASSANDRA-10748) + * Clarify that now() function is calculated on the coordinator node in CQL documentation (CASSANDRA-10900) + * Fix bloom filter sizing with LCS (CASSANDRA-11344) + * (cqlsh) Fix error when result is 0 rows with EXPAND ON (CASSANDRA-11092) + * Fix intra-node serialization issue for multicolumn-restrictions (CASSANDRA-11196) + * Non-obsoleting compaction operations over compressed files can impose rate limit on normal reads (CASSANDRA-11301) + * Add missing newline at end of bin/cqlsh (CASSANDRA-11325) + * Fix AE in nodetool cfstats (backport CASSANDRA-10859) (CASSANDRA-11297) + * Unresolved hostname leads to replace being ignored (CASSANDRA-11210) + * Fix filtering on non-primary key columns for thrift static column families + (CASSANDRA-6377) + * Only log yaml config once, at startup (CASSANDRA-11217) + * Preserve order for preferred SSL cipher suites (CASSANDRA-11164) + * Reference leak with parallel repairs on the same table (CASSANDRA-11215) + * Range.compareTo() violates the contract of Comparable (CASSANDRA-11216) + * Avoid NPE when serializing ErrorMessage with null message (CASSANDRA-11167) + * Replacing an aggregate with a new version doesn't reset INITCOND (CASSANDRA-10840) + * (cqlsh) cqlsh cannot be called through symlink (CASSANDRA-11037) + * fix ohc and java-driver pom dependencies in build.xml (CASSANDRA-10793) + * Protect from keyspace dropped during repair (CASSANDRA-11065) + * Handle adding fields to a UDT in SELECT JSON and toJson() (CASSANDRA-11146) + * Better error message for cleanup (CASSANDRA-10991) + * cqlsh pg-style-strings broken if line ends with ';' (CASSANDRA-11123) + * Use cloned TokenMetadata in size estimates to avoid race against membership check + (CASSANDRA-10736) + * Always persist upsampled index summaries (CASSANDRA-10512) + * (cqlsh) Fix inconsistent auto-complete (CASSANDRA-10733) + * Make SELECT JSON and toJson() threadsafe (CASSANDRA-11048) + * Fix SELECT on tuple relations for mixed ASC/DESC clustering order (CASSANDRA-7281) + * (cqlsh) Support utf-8/cp65001 encoding on Windows (CASSANDRA-11030) + * Fix paging on DISTINCT queries repeats result when first row in partition changes + (CASSANDRA-10010) +Merged from 2.1: + * Fix paging for COMPACT tables without clustering columns (CASSANDRA-11467) - * Fix out-of-space error treatment in memtable flushing (CASSANDRA-11448) - * Backport CASSANDRA-10859 (CASSANDRA-11415) - * COPY FROM fails when importing blob (CASSANDRA-11375) + * Add a -j parameter to scrub/cleanup/upgradesstables to state how + many threads to use (CASSANDRA-11179) * Backport CASSANDRA-10679 (CASSANDRA-9598) * Don't do defragmentation if reading from repaired sstables (CASSANDRA-10342) * Fix streaming_socket_timeout_in_ms not enforced (CASSANDRA-11286) http://git-wip-us.apache.org/repos/asf/cassandra/blob/2ed85559/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java --
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/fbf30d21 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fbf30d21 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fbf30d21 Branch: refs/heads/cassandra-3.0 Commit: fbf30d2199582d3c8e24cc7efcdaedc3a2b7b68e Parents: 61ac125 14a2157 Author: Benjamin Lerer Authored: Mon Feb 22 12:13:51 2016 +0100 Committer: Benjamin Lerer Committed: Mon Feb 22 12:19:31 2016 +0100 -- CHANGES.txt | 1 + .../apache/cassandra/db/RowIteratorFactory.java | 20 ++-- .../cassandra/db/filter/ExtendedFilter.java | 10 +- .../cassandra/db/filter/SliceQueryFilter.java | 3 ++- .../filter/TombstoneOverwhelmingException.java | 14 -- 5 files changed, 14 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbf30d21/CHANGES.txt -- diff --cc CHANGES.txt index 9d0046b,ef8c5a7..e3d6f95 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,21 -1,5 +1,22 @@@ -2.1.14 +2.2.6 + * Replacing an aggregate with a new version doesn't reset INITCOND (CASSANDRA-10840) + * (cqlsh) cqlsh cannot be called through symlink (CASSANDRA-11037) + * fix ohc and java-driver pom dependencies in build.xml (CASSANDRA-10793) + * Protect from keyspace dropped during repair (CASSANDRA-11065) + * Handle adding fields to a UDT in SELECT JSON and toJson() (CASSANDRA-11146) + * Better error message for cleanup (CASSANDRA-10991) + * cqlsh pg-style-strings broken if line ends with ';' (CASSANDRA-11123) + * Use cloned TokenMetadata in size estimates to avoid race against membership check + (CASSANDRA-10736) + * Always persist upsampled index summaries (CASSANDRA-10512) + * (cqlsh) Fix inconsistent auto-complete (CASSANDRA-10733) + * Make SELECT JSON and toJson() threadsafe (CASSANDRA-11048) + * Fix SELECT on tuple relations for mixed ASC/DESC clustering order (CASSANDRA-7281) + * (cqlsh) Support utf-8/cp65001 encoding on Windows (CASSANDRA-11030) + * Fix paging on DISTINCT queries repeats result when first row in partition changes + (CASSANDRA-10010) +Merged from 2.1: + * Add partition key to TombstoneOverwhelmingException error message (CASSANDRA-10888) * Use logback setting for 'cassandra -v' command (CASSANDRA-10767) * Fix sstableloader to unthrottle streaming by default (CASSANDRA-9714) * Fix incorrect warning in 'nodetool status' (CASSANDRA-10176) http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbf30d21/src/java/org/apache/cassandra/db/RowIteratorFactory.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbf30d21/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbf30d21/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java -- diff --cc src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java index d2f0bf4,957d1ba..822d838 --- a/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java +++ b/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java @@@ -278,23 -278,37 +278,24 @@@ public class SliceQueryFilter implement if (respectTombstoneThresholds() && columnCounter.tombstones() > DatabaseDescriptor.getTombstoneFailureThreshold()) { -Tracing.trace("Scanned over {} tombstones; query aborted (see tombstone_failure_threshold)", - DatabaseDescriptor.getTombstoneFailureThreshold()); -String msg = String.format("Scanned over %d tombstones in %s.%s for key: %1.512s; query aborted (see tombstone_failure_threshold).", - DatabaseDescriptor.getTombstoneFailureThreshold(), - container.metadata().ksName, - container.metadata().cfName, - container.metadata().getKeyValidator().getString(key.getKey())); -logger.error(msg); -throw new TombstoneOverwhelmingException(); +Tracing.trace("Scanned over {} tombstones; query aborted (see tombstone_failure_threshold); slices={}", + DatabaseDescriptor.getTombstoneFailureThreshold(), getSlicesInfo(container)); + +throw new TombstoneOverwhelmingException(columnCounter.tombstones(), +
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/66229705 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/66229705 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/66229705 Branch: refs/heads/cassandra-3.0 Commit: 66229705d7024b0c37b2660c2c690531ca64fe07 Parents: e4fb1de 26aa19e Author: Tyler Hobbs Authored: Fri Feb 5 16:34:25 2016 -0600 Committer: Tyler Hobbs Committed: Fri Feb 5 16:34:25 2016 -0600 -- conf/cqlshrc.sample | 199 --- 1 file changed, 172 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/66229705/conf/cqlshrc.sample -- diff --cc conf/cqlshrc.sample index 4c66861,5a33a2f..0bcce6a --- a/conf/cqlshrc.sample +++ b/conf/cqlshrc.sample @@@ -18,68 -18,196 +18,213 @@@ ; Sample ~/.cqlshrc file. [authentication] - username = fred - password = !!bang!!$ + ;; If Cassandra has auth enabled, fill out these options + ; username = fred + ; password = !!bang!!$ + ; keyspace = ks1 + + [ui] - color = on - completekey = tab + ;; Whether or not to display query results with colors + ; color = on + + ;; Used for displaying timestamps (and reading them with COPY) + ; datetimeformat = %Y-%m-%d %H:%M:%S%z + + ;; The number of digits displayed after the decimal point + ;; (note that increasing this to large numbers can result in unusual values) + ; float_precision = 5 + + ;; Used for automatic completion and suggestions + ; completekey = tab + + +; To use another than the system default browser for cqlsh HELP to open +; the CQL doc HTML, use the 'browser' preference. +; If the field value is empty or not specified, cqlsh will use the +; default browser (specifying 'browser = default' does not work). +; +; Supported browsers are those supported by the Python webbrowser module. +; (https://docs.python.org/2/library/webbrowser.html). +; +; Hint: to use Google Chome, use +; 'browser = open -a /Applications/Google\ Chrome.app %s' on Mac OS X and +; 'browser = /usr/bin/google-chrome-stable %s' on Linux and +; 'browser = C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s' on Windows. +; +; This setting can be overridden with the --browser command line option. +; +;browser = + [cql] - version = 3.2.1 + ;; A version of CQL to use (this should almost never be set) + ; version = 3.2.1 + + [connection] + + ;; The host to connect to hostname = 127.0.0.1 + + ;; The port to connect to (9042 is the native protocol default) port = 9042 + ;; A timeout in seconds for opening new connections + ; timeout = 10 + + ;; A timeout in seconds for executing queries + ; request_timeout = 10 + + + + [csv] + ;; The size limit for parsed fields + ; field_size_limit = 131072 + + + [tracing] - max_trace_wait = 10.0 + ;; The max number of seconds to wait for a trace to complete + ; max_trace_wait = 10.0 + + ;[ssl] - ;certfile = ~/keys/cassandra.cert - ;; optional - true by default. + ; certfile = ~/keys/cassandra.cert + + ;; Optional - true by default. ;validate = true - ;; to be provided when require_client_auth=true + + ;; To be provided when require_client_auth=true ;userkey = ~/key.pem - ;; to be provided when require_client_auth=true + + ;; To be provided when require_client_auth=true ;usercert = ~/cert.pem - ;; optional section, overrides default certfile in [ssl] section, if present - ;[certfiles] - ;192.168.1.3 = ~/keys/cassandra01.cert - ;192.168.1.4 = ~/keys/cassandra02.cert - ; vim: set ft=dosini : + ;; Optional section, overrides default certfile in [ssl] section, if present + ; [certfiles] + ; 192.168.1.3 = ~/keys/cassandra01.cert + ; 192.168.1.4 = ~/keys/cassandra02.cert + + + + ;; Options that are common to both COPY TO and COPY FROM + ; [copy] + + ;; The string placeholder for null values + ; nullval = null + + ;; For COPY TO, controls whether the first line in the CSV output file will + ;; contain the column names. For COPY FROM, specifies whether the first + ;; line in the CSV file contains column names. + ; header = false + + ;; The character that is used as the decimal point separator + ; decimalsep = . + + ;; The character that is used to separate thousands + ;; (defaults to the empty string) + ; thousandssep = + + ;; The string literal format for boolean values + ; boolstyle = True,False + + ;; The number of child worker processes to create for + ;; COPY tasks. Defaults to a max of 4 for COPY FROM and 16 + ;; for COPY TO. However, at most (num_cores - 1) processes + ;; will be created. + ; numprocesses = + + ;; The maximum number of failed attempts to fetch a range of data (when
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/2e4a8490 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2e4a8490 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2e4a8490 Branch: refs/heads/cassandra-2.2 Commit: 2e4a8490c4517e30b9897aeadb9161263d2f4abe Parents: b5d6d4f d5b6d1b Author: T Jake Luciani Authored: Tue Jan 26 09:13:37 2016 -0500 Committer: T Jake Luciani Committed: Tue Jan 26 09:13:37 2016 -0500 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/e2050c97 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e2050c97 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e2050c97 Branch: refs/heads/cassandra-3.0 Commit: e2050c97147505aa28576d17cba3a012bdef31d3 Parents: ee1c145 abe0c67 Author: T Jake Luciani Authored: Fri Jan 15 09:44:26 2016 -0500 Committer: T Jake Luciani Committed: Fri Jan 15 09:44:26 2016 -0500 -- CHANGES.txt | 1 + .../cassandra/service/StorageService.java | 56 +++- 2 files changed, 31 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2050c97/CHANGES.txt -- diff --cc CHANGES.txt index d04b9d5,4b87ed0..2bfba80 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,26 -1,8 +1,27 @@@ -2.1.13 +2.2.5 + * Avoid NPE when performing sstable tasks (scrub etc.) (CASSANDRA-10980) + * Make sure client gets tombstone overwhelmed warning (CASSANDRA-9465) + * Fix error streaming section more than 2GB (CASSANDRA-10961) + * (cqlsh) Also apply --connect-timeout to control connection + timeout (CASSANDRA-10959) + * Histogram buckets exposed in jmx are sorted incorrectly (CASSANDRA-10975) + * Enable GC logging by default (CASSANDRA-10140) + * Optimize pending range computation (CASSANDRA-9258) + * Skip commit log and saved cache directories in SSTable version startup check (CASSANDRA-10902) + * drop/alter user should be case sensitive (CASSANDRA-10817) + * jemalloc detection fails due to quoting issues in regexv (CASSANDRA-10946) + * Support counter-columns for native aggregates (sum,avg,max,min) (CASSANDRA-9977) + * (cqlsh) show correct column names for empty result sets (CASSANDRA-9813) + * Add new types to Stress (CASSANDRA-9556) + * Add property to allow listening on broadcast interface (CASSANDRA-9748) + * Fix regression in split size on CqlInputFormat (CASSANDRA-10835) + * Better handling of SSL connection errors inter-node (CASSANDRA-10816) + * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) +Merged from 2.1: + * Allow simultaneous bootstrapping with strict consistency when no vnodes are used (CASSANDRA-11005) * Log a message when major compaction does not result in a single file (CASSANDRA-10847) * (cqlsh) fix cqlsh_copy_tests when vnodes are disabled (CASSANDRA-10997) - * (cqlsh) fix formatting bytearray values (CASSANDRA-10839) * (cqlsh) Add request timeout option to cqlsh (CASSANDRA-10686) * Avoid AssertionError while submitting hint with LWT (CASSANDRA-10477) * If CompactionMetadata is not in stats file, use index summary instead (CASSANDRA-10676) http://git-wip-us.apache.org/repos/asf/cassandra/blob/e2050c97/src/java/org/apache/cassandra/service/StorageService.java -- diff --cc src/java/org/apache/cassandra/service/StorageService.java index bace082,606670c..34419e9 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@@ -51,16 -51,17 +51,38 @@@ import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; -- import javax.management.JMX; import javax.management.MBeanServer; -import javax.management.Notification; import javax.management.NotificationBroadcasterSupport; import javax.management.ObjectName; import javax.management.openmbean.TabularData; import javax.management.openmbean.TabularDataSupport; -import org.apache.cassandra.auth.Auth; ++import com.google.common.annotations.VisibleForTesting; ++import com.google.common.base.Predicate; ++import com.google.common.collect.ArrayListMultimap; ++import com.google.common.collect.Collections2; ++import com.google.common.collect.HashMultimap; ++import com.google.common.collect.ImmutableSet; ++import com.google.common.collect.Iterables; ++import com.google.common.collect.Lists; ++import com.google.common.collect.Maps; ++import com.google.common.collect.Multimap; ++import com.google.common.collect.Sets; ++import com.google.common.util.concurrent.FutureCallback; ++import com.google.common.util.concurrent.Futures; ++import com.google.common.util.concurrent.ListenableFuture; ++import com.google.common.util.concurrent.Uninterruptibles; ++import org.apache.commons.lang3.StringUtils; ++import org.slf4j.Logger; ++import org.slf4j.LoggerFactory; ++ ++impor
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/ee1c145a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ee1c145a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ee1c145a Branch: refs/heads/cassandra-3.0 Commit: ee1c145a647f0242e4615ef3751d942371a09998 Parents: e253bfe 03e6f45 Author: Marcus Eriksson Authored: Fri Jan 15 09:31:00 2016 +0100 Committer: Marcus Eriksson Committed: Fri Jan 15 09:31:00 2016 +0100 -- CHANGES.txt| 1 + .../org/apache/cassandra/db/compaction/CompactionManager.java | 6 +- 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/ee1c145a/CHANGES.txt -- diff --cc CHANGES.txt index 9d1cb88,636c15d..d04b9d5 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,25 -1,7 +1,26 @@@ -2.1.13 +2.2.5 + * Avoid NPE when performing sstable tasks (scrub etc.) (CASSANDRA-10980) + * Make sure client gets tombstone overwhelmed warning (CASSANDRA-9465) + * Fix error streaming section more than 2GB (CASSANDRA-10961) + * (cqlsh) Also apply --connect-timeout to control connection + timeout (CASSANDRA-10959) + * Histogram buckets exposed in jmx are sorted incorrectly (CASSANDRA-10975) + * Enable GC logging by default (CASSANDRA-10140) + * Optimize pending range computation (CASSANDRA-9258) + * Skip commit log and saved cache directories in SSTable version startup check (CASSANDRA-10902) + * drop/alter user should be case sensitive (CASSANDRA-10817) + * jemalloc detection fails due to quoting issues in regexv (CASSANDRA-10946) + * Support counter-columns for native aggregates (sum,avg,max,min) (CASSANDRA-9977) + * (cqlsh) show correct column names for empty result sets (CASSANDRA-9813) + * Add new types to Stress (CASSANDRA-9556) + * Add property to allow listening on broadcast interface (CASSANDRA-9748) + * Fix regression in split size on CqlInputFormat (CASSANDRA-10835) + * Better handling of SSL connection errors inter-node (CASSANDRA-10816) + * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) +Merged from 2.1: + * Log a message when major compaction does not result in a single file (CASSANDRA-10847) * (cqlsh) fix cqlsh_copy_tests when vnodes are disabled (CASSANDRA-10997) - * (cqlsh) fix formatting bytearray values (CASSANDRA-10839) * (cqlsh) Add request timeout option to cqlsh (CASSANDRA-10686) * Avoid AssertionError while submitting hint with LWT (CASSANDRA-10477) * If CompactionMetadata is not in stats file, use index summary instead (CASSANDRA-10676) http://git-wip-us.apache.org/repos/asf/cassandra/blob/ee1c145a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java -- diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java index e0caf76,9e71ca0..ae2b6fb --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@@ -556,9 -534,11 +556,11 @@@ public class CompactionManager implemen return Collections.emptyList(); List> futures = new ArrayList<>(); - + int nonEmptyTasks = 0; for (final AbstractCompactionTask task : tasks) { -if (task.sstables.size() > 0) ++if (task.transaction.originals().size() > 0) + nonEmptyTasks++; Runnable runnable = new WrappedRunnable() { protected void runMayThrow() throws IOException
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/450091bf Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/450091bf Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/450091bf Branch: refs/heads/cassandra-3.0 Commit: 450091bfb8ae66cefa26c2738770d435edf3fb5b Parents: af509ec 0d51b65 Author: Marcus Eriksson Authored: Tue Dec 29 13:46:11 2015 +0100 Committer: Marcus Eriksson Committed: Tue Dec 29 13:46:11 2015 +0100 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/af509ec9/bin/cqlsh.py -- diff --cc bin/cqlsh.py index 427fc29,000..8469836 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2481 -1,0 +1,2483 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +import webbrowser +from StringIO import StringIO +from contextlib import contextmanager +from glob import glob +from uuid import UUID + +if sys.version_info[0] != 2 or sys.version_info[1] != 7: +sys.exit("\nCQL Shell supports only Python 2.7\n") + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') +CASSANDRA_CQL_HTML_FALLBACK = 'https://cassandra.apache.org/doc/cql3/CQL-2.2.html' + +if os.path.exists(CASSANDRA_PATH + '/doc/cql3/CQL.html'): +# default location of local CQL.html +CASSANDRA_CQL_HTML = 'file://' + CASSANDRA_PATH + '/doc/cql3/CQL.html' +elif os.path.exists('/usr/share/doc/cassandra/CQL.html'): +# fallback to package file +CASSANDRA_CQL_HTML = 'file:///usr/share/doc/cassandra/CQL.html' +else: +# fallback to online version +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK + +# On Linux, the Python webbrowser module uses the 'xdg-open' executable +# to open a file/URL. But that only works, if the current session has been +# opened from _within_ a desktop environment. I.e. 'xdg-open' will fail, +# if the session's been opened via ssh to a remote box. +# +# Use 'python' to get some information about the detected browsers. +# >>> import webbrowser +# >>> webbrowser._tryorder +# >>> webbrowser._browser +# +if len(webbrowser._tryorder) == 0: +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK +elif webbrowser._tryorder[0] == 'xdg-open' and os.environ.get('XDG_DATA_DIRS', '') == '': +# only on Linux (some OS with xdg-open) +webbrowser._tryorder.remove('xdg-open') +webbrowser._tryorder.append('xdg-open') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/c26b3971 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c26b3971 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c26b3971 Branch: refs/heads/cassandra-3.0 Commit: c26b3971622f55589f4f080516c9e01311b4e7b1 Parents: bcd68b5 3740f81 Author: Aleksey Yeschenko Authored: Fri Dec 18 23:38:40 2015 + Committer: Aleksey Yeschenko Committed: Fri Dec 18 23:38:40 2015 + -- CHANGES.txt | 1 + .../apache/cassandra/db/commitlog/CommitLogArchiver.java| 9 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c26b3971/CHANGES.txt -- diff --cc CHANGES.txt index 88ef42e,581784e..1ff1a5c --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,12 -1,5 +1,13 @@@ -2.1.13 +2.2.5 + * (cqlsh) show correct column names for empty result sets (CASSANDRA-9813) + * Add new types to Stress (CASSANDRA-9556) + * Add property to allow listening on broadcast interface (CASSANDRA-9748) + * Fix regression in split size on CqlInputFormat (CASSANDRA-10835) + * Better handling of SSL connection errors inter-node (CASSANDRA-10816) + * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) +Merged from 2.1: + * Fix bugs in commit log archiving startup behavior (CASSANDRA-10593) * (cqlsh) further optimise COPY FROM (CASSANDRA-9302) * Allow CREATE TABLE WITH ID (CASSANDRA-9179) * Make Stress compiles within eclipse (CASSANDRA-10807) http://git-wip-us.apache.org/repos/asf/cassandra/blob/c26b3971/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/de55c39c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/de55c39c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/de55c39c Branch: refs/heads/cassandra-3.0 Commit: de55c39cd2efeb66a1adace391bbe456213559e8 Parents: 85c7241 994250c Author: T Jake Luciani Authored: Tue Dec 15 14:16:55 2015 -0500 Committer: T Jake Luciani Committed: Tue Dec 15 14:16:55 2015 -0500 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/85c72418 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/85c72418 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/85c72418 Branch: refs/heads/cassandra-3.0 Commit: 85c724183a2caee3a9bb73441d27b3cbce7207c4 Parents: 263763a cee35e4 Author: Marcus Eriksson Authored: Tue Dec 15 10:01:20 2015 +0100 Committer: Marcus Eriksson Committed: Tue Dec 15 10:06:44 2015 +0100 -- CHANGES.txt | 1 + .../org/apache/cassandra/config/CFMetaData.java | 4 +- .../cql3/statements/AlterTableStatement.java| 2 + .../cassandra/cql3/statements/CFPropDefs.java | 24 - .../cql3/statements/CreateTableStatement.java | 9 +- .../operations/DropRecreateAndRestoreTest.java | 105 +++ 6 files changed, 135 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c72418/CHANGES.txt -- diff --cc CHANGES.txt index 592ba0a,7f1d66b..c9074fc --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,10 -1,5 +1,11 @@@ -2.1.13 +2.2.5 + * Add property to allow listening on broadcast interface (CASSANDRA-9748) + * Fix regression in split size on CqlInputFormat (CASSANDRA-10835) + * Better handling of SSL connection errors inter-node (CASSANDRA-10816) + * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) +Merged from 2.1: + * Allow CREATE TABLE WITH ID (CASSANDRA-9179) * Make Stress compiles within eclipse (CASSANDRA-10807) * Cassandra Daemon should print JVM arguments (CASSANDRA-10764) * Allow cancellation of index summary redistribution (CASSANDRA-8805) http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c72418/src/java/org/apache/cassandra/config/CFMetaData.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c72418/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c72418/src/java/org/apache/cassandra/cql3/statements/CFPropDefs.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c72418/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java -- diff --cc src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java index 7810a8a,2c4b23b..1b3665c --- a/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java @@@ -71,13 -72,21 +72,14 @@@ public class CreateTableStatement exten this.properties = properties; this.ifNotExists = ifNotExists; this.staticColumns = staticColumns; + this.id = id; -try -{ -if (!this.properties.hasProperty(CFPropDefs.KW_COMPRESSION) && CFMetaData.DEFAULT_COMPRESSOR != null) -this.properties.addProperty(CFPropDefs.KW_COMPRESSION, -new HashMap() -{{ - put(CompressionParameters.SSTABLE_COMPRESSION, CFMetaData.DEFAULT_COMPRESSOR); -}}); -} -catch (SyntaxException e) -{ -throw new AssertionError(e); -} +if (!this.properties.hasProperty(CFPropDefs.KW_COMPRESSION) && CFMetaData.DEFAULT_COMPRESSOR != null) +this.properties.addProperty(CFPropDefs.KW_COMPRESSION, +new HashMap() +{{ + put(CompressionParameters.SSTABLE_COMPRESSION, CFMetaData.DEFAULT_COMPRESSOR); +}}); } public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c72418/test/unit/org/apache/cassandra/cql3/validation/operations/DropRecreateAndRestoreTest.java -- diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/DropRecreateAndRestoreTest.java index 000,385ed3d..4a3a51d mode 00,100644..100644 --- a/test/unit/org/apache/cassandra/cql3/validation/operations/DropRecreateAndRestore
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/263763ab Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/263763ab Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/263763ab Branch: refs/heads/cassandra-3.0 Commit: 263763ab9bfd9be902951d06f5d44f3a9d3f6f4f Parents: 6ff7c9c 9b30d65 Author: Benjamin Lerer Authored: Mon Dec 14 10:27:21 2015 +0100 Committer: Benjamin Lerer Committed: Mon Dec 14 10:28:05 2015 +0100 -- CHANGES.txt| 1 + .../cassandra/stress/generate/values/Generator.java| 4 ++-- .../apache/cassandra/stress/generate/values/Lists.java | 13 +++-- .../apache/cassandra/stress/generate/values/Sets.java | 10 +- 4 files changed, 15 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/263763ab/CHANGES.txt -- diff --cc CHANGES.txt index d44a47b,091ac52..592ba0a --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,34 -1,12 +1,35 @@@ -2.1.13 +2.2.5 + * Add property to allow listening on broadcast interface (CASSANDRA-9748) + * Fix regression in split size on CqlInputFormat (CASSANDRA-10835) + * Better handling of SSL connection errors inter-node (CASSANDRA-10816) + * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) +Merged from 2.1: + * Make Stress compiles within eclipse (CASSANDRA-10807) * Cassandra Daemon should print JVM arguments (CASSANDRA-10764) * Allow cancellation of index summary redistribution (CASSANDRA-8805) - * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) * Fix Stress profile parsing on Windows (CASSANDRA-10808) - -2.1.12 +2.2.4 + * Show CQL help in cqlsh in web browser (CASSANDRA-7225) + * Serialize on disk the proper SSTable compression ratio (CASSANDRA-10775) + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) + * Fix IllegalArgumentException in DataOutputBuffer.reallocate for large buffers (CASSANDRA-10592) +Merged from 2.1: * Fix incremental repair hang when replica is down (CASSANDRA-10288) * Avoid writing range tombstones after END_OF_ROW marker (CASSANDRA-10791) * Optimize the way we check if a token is repaired in anticompaction (CASSANDRA-10768)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/6ff7c9ce Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6ff7c9ce Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6ff7c9ce Branch: refs/heads/cassandra-3.0 Commit: 6ff7c9ce98eb937c6e2347df9af1d36364eeb184 Parents: 94c361d dff2214 Author: Robert Stupp Authored: Fri Dec 11 16:51:04 2015 -0600 Committer: Robert Stupp Committed: Fri Dec 11 16:51:04 2015 -0600 -- CHANGES.txt| 1 + src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 ++ 2 files changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ff7c9ce/CHANGES.txt -- diff --cc CHANGES.txt index 035e471,96f2f4f..d44a47b --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,33 -1,11 +1,34 @@@ -2.1.13 +2.2.5 + * Add property to allow listening on broadcast interface (CASSANDRA-9748) + * Fix regression in split size on CqlInputFormat (CASSANDRA-10835) + * Better handling of SSL connection errors inter-node (CASSANDRA-10816) + * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) +Merged from 2.1: + * Cassandra Daemon should print JVM arguments (CASSANDRA-10764) * Allow cancellation of index summary redistribution (CASSANDRA-8805) - * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) * Fix Stress profile parsing on Windows (CASSANDRA-10808) - -2.1.12 +2.2.4 + * Show CQL help in cqlsh in web browser (CASSANDRA-7225) + * Serialize on disk the proper SSTable compression ratio (CASSANDRA-10775) + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) + * Fix IllegalArgumentException in DataOutputBuffer.reallocate for large buffers (CASSANDRA-10592) +Merged from 2.1: * Fix incremental repair hang when replica is down (CASSANDRA-10288) * Avoid writing range tombstones after END_OF_ROW marker (CASSANDRA-10791) * Optimize the way we check if a token is repaired in anticompaction (CASSANDRA-10768) http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ff7c9ce/src/java/org/apache/cassandra/service/CassandraDaemon.java -- diff --cc src/java/org/apache/cassandra/service/CassandraDaemon.java index eb05324,a27fa20..6f38545 --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java @@@ -377,29 -467,6 +377,31 @@@ public class CassandraDaemo return setupCompleted; } +private void logSystemInfo() +{ + if (logger.isInfoEnabled()) + { + try + { + logger.info("Hostname: {}", InetAddress.getLocalHost().getHostName()); + } + catch (UnknownHostException e1) + { + logger.info("Could not resolve local host"); + } + + logger.info("JVM vendor/version: {}/{}", System.getProperty("java.vm.name"), System.getProperty("java.version")); + logger.info("Heap size: {}/{}", Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory()); + + for(MemoryPoolMXBean pool: ManagementFactory.getMemoryPoolMXBeans()) + logger.info("{} {}: {}", pool.getName(), pool.getType(), pool.getPeakUsage()); + + logger.info("Classpath: {}", System.getProperty("java.class.path")); ++ ++logger.info("JVM Arguments: {}", ManagementFactory.getRuntimeMXBean().getInputArguments()); + } +} + /** * Initialize the Cassandra Daemon based
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/f1667494 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f1667494 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f1667494 Branch: refs/heads/cassandra-3.0 Commit: f16674949592b518ba9da837b70665df10832e9b Parents: 7dd6b7d fc7075a Author: Marcus Eriksson Authored: Fri Dec 11 17:32:31 2015 +0100 Committer: Marcus Eriksson Committed: Fri Dec 11 17:32:31 2015 +0100 -- CHANGES.txt | 1 + .../cassandra/db/compaction/CompactionInfo.java | 14 +- .../db/compaction/CompactionManager.java| 14 + .../cassandra/db/compaction/OperationType.java | 3 +- .../io/sstable/IndexSummaryManager.java | 279 +-- .../io/sstable/IndexSummaryRedistribution.java | 349 +++ .../io/sstable/IndexSummaryManagerTest.java | 83 - 7 files changed, 459 insertions(+), 284 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1667494/CHANGES.txt -- diff --cc CHANGES.txt index 30a76a9,2ee8b07..5da0d42 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,31 -1,10 +1,32 @@@ -2.1.13 - * Allow cancellation of index summary redistribution (CASSANDRA-8805) +2.2.5 + * Fix regression in split size on CqlInputFormat (CASSANDRA-10835) + * Better handling of SSL connection errors inter-node (CASSANDRA-10816) * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) +Merged from 2.1: ++ * Allow cancellation of index summary redistribution (CASSANDRA-8805) * Fix Stress profile parsing on Windows (CASSANDRA-10808) - -2.1.12 +2.2.4 + * Show CQL help in cqlsh in web browser (CASSANDRA-7225) + * Serialize on disk the proper SSTable compression ratio (CASSANDRA-10775) + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) + * Fix IllegalArgumentException in DataOutputBuffer.reallocate for large buffers (CASSANDRA-10592) +Merged from 2.1: * Fix incremental repair hang when replica is down (CASSANDRA-10288) * Avoid writing range tombstones after END_OF_ROW marker (CASSANDRA-10791) * Optimize the way we check if a token is repaired in anticompaction (CASSANDRA-10768) http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1667494/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1667494/src/java/org/apache/cassandra/db/compaction/CompactionManager.java -- diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java index 65f93c0,9bddaf5..ba9c25e --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@@ -1345,7 -1222,21 +1345,21 @@@ public class CompactionManager implemen return executor.submit(runnable); } + public List runIndexSummaryRedistribution(IndexSummaryRedistribution redistribution) throws IOException + { + metrics.beginCompaction(redistribution); + + try + { + return redistribution.redistributeSummaries(); + } + finally + { + metrics.finishCompaction(redistribution); + } + } + -static int getDefaultGcBefore(ColumnFamilyStore cfs) +public static int getDefaultGcBefore(ColumnFamilyStore cfs) { // 2ndary indexes have ExpiringColumns too, so we need to purge tombstones deleted before now. We do not need to // add any G
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/b4d3ac40 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b4d3ac40 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b4d3ac40 Branch: refs/heads/cassandra-3.0 Commit: b4d3ac40b3a6221c2b34b765d709bf7408cb39c2 Parents: 4f3e47b 9135340 Author: Sylvain Lebresne Authored: Fri Dec 11 10:25:19 2015 +0100 Committer: Sylvain Lebresne Committed: Fri Dec 11 10:25:19 2015 +0100 -- .../cassandra/service/StorageService.java | 40 +++- 1 file changed, 22 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4d3ac40/src/java/org/apache/cassandra/service/StorageService.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/7e3e1191 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7e3e1191 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7e3e1191 Branch: refs/heads/cassandra-3.0 Commit: 7e3e1191b9a02b2a638f8a12e2cc793c0a4735ab Parents: 15f03ab b876424 Author: Benjamin Lerer Authored: Thu Dec 3 21:30:45 2015 +0100 Committer: Benjamin Lerer Committed: Thu Dec 3 21:30:45 2015 +0100 -- CHANGES.txt | 3 ++- .../apache/cassandra/stress/settings/SettingsCommandUser.java | 7 +-- 2 files changed, 3 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/7e3e1191/CHANGES.txt -- diff --cc CHANGES.txt index 12accac,1a2887a..7932f51 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,27 -1,8 +1,28 @@@ -2.1.13 +2.2.5 + * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) - ++Merged from 2.1: + * Fix Stress profile parsing on Windows (CASSANDRA-10808) - -2.1.12 +2.2.4 + * Show CQL help in cqlsh in web browser (CASSANDRA-7225) + * Serialize on disk the proper SSTable compression ratio (CASSANDRA-10775) + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) + * Fix IllegalArgumentException in DataOutputBuffer.reallocate for large buffers (CASSANDRA-10592) +Merged from 2.1: * Fix incremental repair hang when replica is down (CASSANDRA-10288) * Avoid writing range tombstones after END_OF_ROW marker (CASSANDRA-10791) * Optimize the way we check if a token is repaired in anticompaction (CASSANDRA-10768)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/e491f05b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e491f05b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e491f05b Branch: refs/heads/cassandra-3.0 Commit: e491f05b71437b47a2d7ed72c2d680188148332a Parents: 1604535 b85da71 Author: Tyler Hobbs Authored: Wed Dec 2 15:32:16 2015 -0600 Committer: Tyler Hobbs Committed: Wed Dec 2 15:32:16 2015 -0600 -- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e491f05b/build.xml --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/73a1c2c1 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/73a1c2c1 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/73a1c2c1 Branch: refs/heads/cassandra-2.2 Commit: 73a1c2c1fad6682f528124c3e61a626fa2135109 Parents: 9751eb5 a6619e5 Author: T Jake Luciani Authored: Wed Dec 2 10:51:15 2015 -0500 Committer: T Jake Luciani Committed: Wed Dec 2 10:51:15 2015 -0500 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/882df8a2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/882df8a2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/882df8a2 Branch: refs/heads/cassandra-3.0 Commit: 882df8a21711559d18bf6b38cd6026d78b7e4956 Parents: 29ed6fe 0b26ca6 Author: Marcus Eriksson Authored: Wed Dec 2 15:06:43 2015 +0100 Committer: Marcus Eriksson Committed: Wed Dec 2 15:06:43 2015 +0100 -- CHANGES.txt | 1 + .../org/apache/cassandra/db/ColumnIndex.java| 16 ++-- .../org/apache/cassandra/db/RangeTombstone.java | 5 ++ .../cassandra/db/compaction/Scrubber.java | 25 +- .../io/sstable/SSTableIdentityIterator.java | 76 +++ .../io/sstable/format/big/BigTableWriter.java | 1 + .../Keyspace1-Standard3-jb-1-Summary.db | Bin 71 -> 63 bytes .../Keyspace1-StandardInteger1-ka-2-CRC.db | Bin 0 -> 8 bytes .../Keyspace1-StandardInteger1-ka-2-Data.db | Bin 0 -> 12357 bytes .../Keyspace1-StandardInteger1-ka-2-Digest.sha1 | 1 + .../Keyspace1-StandardInteger1-ka-2-Filter.db | Bin 0 -> 176 bytes .../Keyspace1-StandardInteger1-ka-2-Index.db| Bin 0 -> 108 bytes ...eyspace1-StandardInteger1-ka-2-Statistics.db | Bin 0 -> 4470 bytes .../Keyspace1-StandardInteger1-ka-2-Summary.db | Bin 0 -> 112 bytes .../Keyspace1-StandardInteger1-ka-2-TOC.txt | 8 ++ .../apache/cassandra/db/RowIndexEntryTest.java | 1 + .../unit/org/apache/cassandra/db/ScrubTest.java | 60 +++ .../streaming/StreamingTransferTest.java| 46 ++- 18 files changed, 216 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/882df8a2/CHANGES.txt -- diff --cc CHANGES.txt index eaad3a2,e00abfe..bca5fb0 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,23 -1,5 +1,24 @@@ -2.1.12 +2.2.4 + * Show CQL help in cqlsh in web browser (CASSANDRA-7225) + * Serialize on disk the proper SSTable compression ratio (CASSANDRA-10775) + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) + * Fix IllegalArgumentException in DataOutputBuffer.reallocate for large buffers (CASSANDRA-10592) +Merged from 2.1: + * Avoid writing range tombstones after END_OF_ROW marker (CASSANDRA-10791) * Optimize the way we check if a token is repaired in anticompaction (CASSANDRA-10768) * Add proper error handling to stream receiver (CASSANDRA-10774) * Warn or fail when changing cluster topology live (CASSANDRA-10243) http://git-wip-us.apache.org/repos/asf/cassandra/blob/882df8a2/src/java/org/apache/cassandra/db/RangeTombstone.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/882df8a2/src/java/org/apache/cassandra/db/compaction/Scrubber.java -- diff --cc src/java/org/apache/cassandra/db/compaction/Scrubber.java index 670c682,e02f901..9fd8560 --- a/src/java/org/apache/cassandra/db/compaction/Scrubber.java +++ b/src/java/org/apache/cassandra/db/compaction/Scrubber.java @@@ -162,6 -155,22 +162,22 @@@ public class Scrubber implements Closea if (scrubInfo.isStopRequested()) throw new CompactionInterruptedException(scrubInfo.getCompactionInfo()); + updateIndexKey(); + + if (prevKey != null && indexFile != null) + { + long nextRowStart = currentRowPositionFromIndex == -1 ? dataFile.length() : currentRowPositionFromIndex; + if (dataFile.getFilePointer() < nextRowStart) + { +
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/9f19dd4e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9f19dd4e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9f19dd4e Branch: refs/heads/cassandra-3.0 Commit: 9f19dd4e4e4f4adc948b36a3fd38077cbc691617 Parents: a320737 dbfeeac Author: Marcus Eriksson Authored: Wed Dec 2 08:53:33 2015 +0100 Committer: Marcus Eriksson Committed: Wed Dec 2 08:53:33 2015 +0100 -- CHANGES.txt | 1 + .../db/compaction/CompactionManager.java| 3 +- src/java/org/apache/cassandra/dht/Range.java| 44 + .../org/apache/cassandra/dht/RangeTest.java | 66 4 files changed, 113 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9f19dd4e/CHANGES.txt -- diff --cc CHANGES.txt index cf73f57,b0f9588..eaad3a2 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,23 -1,5 +1,24 @@@ -2.1.12 +2.2.4 + * Show CQL help in cqlsh in web browser (CASSANDRA-7225) + * Serialize on disk the proper SSTable compression ratio (CASSANDRA-10775) + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) + * Fix IllegalArgumentException in DataOutputBuffer.reallocate for large buffers (CASSANDRA-10592) +Merged from 2.1: + * Optimize the way we check if a token is repaired in anticompaction (CASSANDRA-10768) * Add proper error handling to stream receiver (CASSANDRA-10774) * Warn or fail when changing cluster topology live (CASSANDRA-10243) * Status command in debian/ubuntu init script doesn't work (CASSANDRA-10213) http://git-wip-us.apache.org/repos/asf/cassandra/blob/9f19dd4e/src/java/org/apache/cassandra/db/compaction/CompactionManager.java -- diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java index f3a69a6,2630ba2..65f93c0 --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@@ -1192,90 -1092,68 +1192,91 @@@ public class CompactionManager implemen if (!new File(sstable.getFilename()).exists()) { logger.info("Skipping anticompaction for {}, required sstable was compacted and is no longer available.", sstable); +i.remove(); continue; } +if (groupMaxDataAge < sstable.maxDataAge) +groupMaxDataAge = sstable.maxDataAge; +} -logger.info("Anticompacting {}", sstable); -Set sstableAsSet = new HashSet<>(); -sstableAsSet.add(sstable); +if (anticompactionGroup.originals().size() == 0) +{ +logger.info("No valid anticompactions for this group, All sstables were compacted and are no longer available"); +return 0; +} -File destination = cfs.directories.getWriteableLocationAsFile(cfs.getExpectedCompactedFileSize(sstableAsSet, OperationType.ANTICOMPACTION)); -SSTableRewriter repairedSSTableWriter = new SSTableRewriter(cfs, sstableAsSet, sstable.maxDataAge, false, false); -SSTableRewriter unRepairedSSTableWriter = new SSTableRewriter(cfs, sstableAsSet, sstable.maxDataAge, false, false); +logger.info("Anticompacting {}", anticompactionGroup); +Set sstableAsSet = anticompactionGroup.originals(); + +File destination = cfs.directories.getWriteableLocationAsFile(cfs.getExpectedCompactedFileSize(sstableAsSet, OperationType.ANTICOMPACTION)); +long repairedKeyCount = 0; +long unrepairedKeyCount =
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/432a8a48 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/432a8a48 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/432a8a48 Branch: refs/heads/cassandra-3.0 Commit: 432a8a484394f6774fc64486229939c07f8af9e2 Parents: e7116f2 7650fc1 Author: Robert Stupp Authored: Fri Nov 27 13:50:52 2015 +0100 Committer: Robert Stupp Committed: Fri Nov 27 13:50:52 2015 +0100 -- CHANGES.txt | 1 + NEWS.txt| 6 + src/java/org/apache/cassandra/gms/Gossiper.java | 28 +- .../locator/GossipingPropertyFileSnitch.java| 107 ++ .../cassandra/locator/PropertyFileSnitch.java | 74 +++- .../cassandra/locator/SnitchProperties.java | 5 + .../cassandra/service/CassandraDaemon.java | 17 +- .../cassandra/service/MigrationManager.java | 4 +- .../apache/cassandra/service/StorageProxy.java | 10 +- .../cassandra/service/StorageService.java | 30 +- .../GossipingPropertyFileSnitchTest.java| 38 +-- .../locator/PropertyFileSnitchTest.java | 334 +++ 12 files changed, 496 insertions(+), 158 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/432a8a48/CHANGES.txt -- diff --cc CHANGES.txt index 7281bd3,a2f7b6e..ce82bd0 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,21 -1,5 +1,22 @@@ -2.1.12 +2.2.4 + * Serialize on disk the proper SSTable compression ratio (CASSANDRA-10775) + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Warn or fail when changing cluster topology live (CASSANDRA-10243) * Status command in debian/ubuntu init script doesn't work (CASSANDRA-10213) * Some DROP ... IF EXISTS incorrectly result in exceptions on non-existing KS (CASSANDRA-10658) * DeletionTime.compareTo wrong in rare cases (CASSANDRA-10749) http://git-wip-us.apache.org/repos/asf/cassandra/blob/432a8a48/NEWS.txt -- diff --cc NEWS.txt index 4cf9c7b,cae8dfb..87e77f4 --- a/NEWS.txt +++ b/NEWS.txt @@@ -39,9 -24,22 +39,15 @@@ New feature - DTCS option max_sstable_age_days is now deprecated and defaults to 1000 days. - Native protocol server now allows both SSL and non-SSL connections on the same port. -- Switching racks is no longer an allowed operation on a node which has - data. Instead, the node will need to be decommissioned and rebootstrapped. - If moving from the SimpleSnitch, make sure the rack containing all current - nodes is named "rack1". To override this behavior when manually wiping - the node and bootstrapping, use -Dcassandra.ignore_rack=true. -- a new validate(key, cf) method is added to PerRowSecondaryIndex. A default - implementation is provided, so no changes are required to custom implementations. + Operations + + - Changing rack or dc of live nodes is no longer possible for PropertyFileSnitch + and YamlFileNetworkTopologySnitch. Reloading the configuration file of + GossipingPropertyFileSnitch has been disabled, CASSANDRA-10243. + -2.1.11 +2.2.3 = Upgrading http://git-wip-us.apache.org/repos/asf/cassandra/blob/432a8a48/src/java/org/apache/cassandra/gms/Gossiper.java -- diff --cc src/java/org/apache/cassandra/gms/Gossiper.java index 3d0d5fa,09851b2..fadaffc --- a/src/java/org/apache/cassandra/gms/Gossiper.java +++ b/src/java/org/apache/cassandra/gms/Gossiper.java @@@ -981,10 -984,11 +970,11 @@@ public class Gossiper implements IFailu
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/d44dbe19 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d44dbe19 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d44dbe19 Branch: refs/heads/cassandra-3.0 Commit: d44dbe1929b3746f6f931ef5c6499073ed3bbaeb Parents: f8fc031 8cd13f1 Author: Robert Stupp Authored: Fri Nov 27 12:58:16 2015 +0100 Committer: Robert Stupp Committed: Fri Nov 27 12:58:16 2015 +0100 -- CHANGES.txt | 1 + debian/init | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d44dbe19/CHANGES.txt -- diff --cc CHANGES.txt index 63305d6,111852c..39ce927 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,20 -1,5 +1,21 @@@ -2.1.12 +2.2.4 + * Reject index queries while the index is building (CASSANDRA-8505) + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Status command in debian/ubuntu init script doesn't work (CASSANDRA-10213) * Some DROP ... IF EXISTS incorrectly result in exceptions on non-existing KS (CASSANDRA-10658) * DeletionTime.compareTo wrong in rare cases (CASSANDRA-10749) * Force encoding when computing statement ids (CASSANDRA-10755)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/db970837 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/db970837 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/db970837 Branch: refs/heads/cassandra-3.0 Commit: db97083764e08755fcce7e74c1c81f081db48e3f Parents: 53e777a b8a8004 Author: Robert Stupp Authored: Fri Nov 27 09:29:06 2015 +0100 Committer: Robert Stupp Committed: Fri Nov 27 09:29:06 2015 +0100 -- CHANGES.txt| 1 + src/java/org/apache/cassandra/db/DeletionTime.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/db970837/CHANGES.txt -- diff --cc CHANGES.txt index 361bbf6,48f4e89..8779275 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,19 -1,5 +1,20 @@@ -2.1.12 +2.2.4 + * CQL.textile syntax incorrectly includes optional keyspace for aggregate SFUNC and FINALFUNC (CASSANDRA-10747) + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * DeletionTime.compareTo wrong in rare cases (CASSANDRA-10749) * Force encoding when computing statement ids (CASSANDRA-10755) * Properly reject counters as map keys (CASSANDRA-10760) * Fix the sstable-needs-cleanup check (CASSANDRA-10740)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/e4f3dbac Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e4f3dbac Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e4f3dbac Branch: refs/heads/cassandra-3.0 Commit: e4f3dbac02471cf69d4e525fc24cc288de32ed73 Parents: 8bfdd65 b5b9f71 Author: Sylvain Lebresne Authored: Thu Nov 26 15:43:55 2015 +0100 Committer: Sylvain Lebresne Committed: Thu Nov 26 15:43:55 2015 +0100 -- CHANGES.txt| 1 + src/java/org/apache/cassandra/utils/MD5Digest.java | 10 +- 2 files changed, 10 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4f3dbac/CHANGES.txt -- diff --cc CHANGES.txt index 237c251,ee0bc61..d31645a --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,18 -1,5 +1,19 @@@ -2.1.12 +2.2.4 + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Force encoding when computing statement ids (CASSANDRA-10755) * Properly reject counters as map keys (CASSANDRA-10760) * Fix the sstable-needs-cleanup check (CASSANDRA-10740) * (cqlsh) Print column names before COPY operation (CASSANDRA-8935)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/8bfdd65c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8bfdd65c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8bfdd65c Branch: refs/heads/cassandra-3.0 Commit: 8bfdd65c0d0c3013b00902a64e591d4aaeaea4dd Parents: 31be903 cdf0485 Author: Sylvain Lebresne Authored: Thu Nov 26 10:40:49 2015 +0100 Committer: Sylvain Lebresne Committed: Thu Nov 26 10:40:49 2015 +0100 -- CHANGES.txt | 1 + src/java/org/apache/cassandra/cql3/CQL3Type.java | 2 ++ 2 files changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/8bfdd65c/CHANGES.txt -- diff --cc CHANGES.txt index 7b32c2b,7978a56..237c251 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,20 -1,8 +1,21 @@@ -2.1.12 +2.2.4 + * Fix JSON update with prepared statements (CASSANDRA-10631) + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Properly reject counters as map keys (CASSANDRA-10760) * Fix the sstable-needs-cleanup check (CASSANDRA-10740) * (cqlsh) Print column names before COPY operation (CASSANDRA-8935) - * Add Native-Transport-Requests back to tpstats (CASSANDRA-10044) * Make paging logic consistent between searcher impls (CASSANDRA-10683) * Fix CompressedInputStream for proper cleanup (CASSANDRA-10012) * (cqlsh) Support counters in COPY commands (CASSANDRA-9043) http://git-wip-us.apache.org/repos/asf/cassandra/blob/8bfdd65c/src/java/org/apache/cassandra/cql3/CQL3Type.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/96b7603d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/96b7603d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/96b7603d Branch: refs/heads/cassandra-3.0 Commit: 96b7603d9edfcbbc5cecd38bfe598056d8c564e1 Parents: cd75ecd 3d99418 Author: Marcus Eriksson Authored: Thu Nov 26 08:31:42 2015 +0100 Committer: Marcus Eriksson Committed: Thu Nov 26 08:31:42 2015 +0100 -- CHANGES.txt | 1 + .../db/compaction/CompactionManager.java| 6 +- .../org/apache/cassandra/db/CleanupTest.java| 75 3 files changed, 80 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/96b7603d/CHANGES.txt -- diff --cc CHANGES.txt index 5ff53b6,3ede9b7..a548c9f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,18 -1,7 +1,19 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Fix the sstable-needs-cleanup check (CASSANDRA-10740) * (cqlsh) Print column names before COPY operation (CASSANDRA-8935) - * Add Native-Transport-Requests back to tpstats (CASSANDRA-10044) * Make paging logic consistent between searcher impls (CASSANDRA-10683) * Fix CompressedInputStream for proper cleanup (CASSANDRA-10012) * (cqlsh) Support counters in COPY commands (CASSANDRA-9043) http://git-wip-us.apache.org/repos/asf/cassandra/blob/96b7603d/src/java/org/apache/cassandra/db/compaction/CompactionManager.java -- diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java index 0c6e24f,b0ad244..f3a69a6 --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@@ -27,7 -35,16 +27,8 @@@ import javax.management.ObjectName import javax.management.openmbean.OpenDataException; import javax.management.openmbean.TabularData; -import com.google.common.base.Predicate; -import com.google.common.base.Throwables; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ConcurrentHashMultiset; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Multimap; -import com.google.common.collect.Multiset; -import com.google.common.collect.Sets; + import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.*; import com.google.common.util.concurrent.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; http://git-wip-us.apache.org/repos/asf/cassandra/blob/96b7603d/test/unit/org/apache/cassandra/db/CleanupTest.java -- diff --cc test/unit/org/apache/cassandra/db/CleanupTest.java index 81f7d41,1d04dfa..0115ad9 --- a/test/unit/org/apache/cassandra/db/CleanupTest.java +++ b/test/unit/org/apache/cassandra/db/CleanupTest.java @@@ -33,17 -34,15 +35,18 @@@ import org.junit.Test import org.apache.cassandra.SchemaLoader; import org.apache.cassandra.Util; +import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.cql3.Operator; +import org.apache.cassandra.db.filter.IDiskAtomFilter; import org.apache.cassandra.db.columniterator.IdentityQueryFilter; import org.apache.cassandra.db.compaction.CompactionManager; -import org.apache.cassandra.db.filter.IDiskAtomFilter; import org.apache.cassandra.db.index.SecondaryIndex; -import org.apache.cassandra.dht.BytesToken; +import org.apache.cassandra.dht.ByteOrderedPartitioner.BytesToken; import org.apache.cassandra.dht.Range; -import org.apache.cassandra.io.sstable.SSTableReader; +import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.io.sstable.format.SSTableReader; +import org.apache.cassandra.locator.SimpleStrategy; +
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/cd75ecd9 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cd75ecd9 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cd75ecd9 Branch: refs/heads/cassandra-3.0 Commit: cd75ecd90fe7c49c09dde8e454edd235b1a2 Parents: a90c3b2 9768e57 Author: Tyler Hobbs Authored: Wed Nov 25 17:52:58 2015 -0600 Committer: Tyler Hobbs Committed: Wed Nov 25 17:52:58 2015 -0600 -- pylib/cqlshlib/formatting.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cd75ecd9/pylib/cqlshlib/formatting.py -- diff --cc pylib/cqlshlib/formatting.py index 8b66bce,b740bf9..62ecd10 --- a/pylib/cqlshlib/formatting.py +++ b/pylib/cqlshlib/formatting.py @@@ -15,15 -15,13 +15,15 @@@ # limitations under the License. import binascii -import sys -import re import calendar import math +import re +import sys +import platform - from collections import defaultdict + import wcwidth + - from . import wcwidth - from .displaying import colorme, get_str, FormattedValue, DEFAULT_VALUE_COLORS, NO_COLOR_MAP + from collections import defaultdict + from displaying import colorme, get_str, FormattedValue, DEFAULT_VALUE_COLORS, NO_COLOR_MAP from cassandra.cqltypes import EMPTY from cassandra.util import datetime_from_timestamp from util import UTC
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/a90c3b2b/bin/cqlsh.py -- diff --cc bin/cqlsh.py index ffcbcbd,000..28054ba mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2699 -1,0 +1,2701 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing as mp +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +if sys.version_info[0] != 2 or sys.version_info[1] != 7: +sys.exit("\nCQL Shell supports only Python 2.7\n") + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory, TraceUnavailable + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, copy +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, Form
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/1142183f/bin/cqlsh.py -- diff --cc bin/cqlsh.py index 41672c0,000..ffcbcbd mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2690 -1,0 +1,2699 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing as mp +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +if sys.version_info[0] != 2 or sys.version_info[1] != 7: +sys.exit("\nCQL Shell supports only Python 2.7\n") + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory, TraceUnavailable + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, copy +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, Form
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/2aa83426 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2aa83426 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2aa83426 Branch: refs/heads/cassandra-3.0 Commit: 2aa834265ba76fe0e161ce9fdb612df045dcd576 Parents: d425fe4 4a94f75 Author: Aleksey Yeschenko Authored: Mon Nov 23 17:14:14 2015 + Committer: Aleksey Yeschenko Committed: Mon Nov 23 17:14:14 2015 + -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0fd5178/bin/cqlsh.py -- diff --cc bin/cqlsh.py index 94c7af3,000..41672c0 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2674 -1,0 +1,2690 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing as mp +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +if sys.version_info[0] != 2 or sys.version_info[1] != 7: +sys.exit("\nCQL Shell supports only Python 2.7\n") + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory, TraceUnavailable + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, copy +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, Form
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/da4b9716 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/da4b9716 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/da4b9716 Branch: refs/heads/cassandra-3.0 Commit: da4b97164a89d57990ef19b553cb4a25937efe4a Parents: 3851670 882adf0 Author: Sylvain Lebresne Authored: Fri Nov 20 14:00:35 2015 +0100 Committer: Sylvain Lebresne Committed: Fri Nov 20 14:00:35 2015 +0100 -- CHANGES.txt | 2 ++ .../hadoop/ColumnFamilyRecordReader.java| 35 +++- 2 files changed, 21 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/da4b9716/CHANGES.txt -- diff --cc CHANGES.txt index 867226f,9e2869e..17c5047 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,6 +1,19 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Try next replica if not possible to connect to primary replica on +ColumnFamilyRecordReader (CASSANDRA-2388) * Limit window size in DTCS (CASSANDRA-10280) * sstableloader does not use MAX_HEAP_SIZE env parameter (CASSANDRA-10188) * (cqlsh) Improve COPY TO performance and error handling (CASSANDRA-9304) http://git-wip-us.apache.org/repos/asf/cassandra/blob/da4b9716/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java -- diff --cc src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java index 97dc497,dc44a43..9d1d10c --- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java +++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java @@@ -152,25 -151,28 +152,28 @@@ public class ColumnFamilyRecordReader e if (batchSize < 2) throw new IllegalArgumentException("Minimum batchSize is 2. Suggested batchSize is 100 or more"); - try - { - if (client != null) - return; - - // create connection using thrift - String location = getLocation(); - - int port = ConfigHelper.getInputRpcPort(conf); - client = ColumnFamilyInputFormat.createAuthenticatedClient(location, port, conf); + String[] locations = getLocations(); + int port = ConfigHelper.getInputRpcPort(conf); - } - catch (Exception e) + Exception lastException = null; + for (String location : locations) { - throw new RuntimeException(e); + try + { + client = ColumnFamilyInputFormat.createAuthenticatedClient(location, port, conf); + break; + } + catch (Exception e) + { + lastException = e; + logger.warn("Failed to create authenticated client to {}:{}", location , port); + } } + if (client == null && lastException != null) + throw new RuntimeException(lastException); iter = widerows ? new WideRowIterator() : new StaticRowIterator(); -logger.debug("created {}", iter); +logger.trace("created {}", iter); } public boolean nextKeyValue() throws IOException @@@ -210,10 -212,10 +213,10 @@@ } } } - return split.getLocations()[0]; + return split.getLocations(); } -private abstract class RowIterator extends AbstractIterator>> +private abstract class RowIterator extends AbstractIterator>> { protected List rows; protected int totalRead = 0;
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/bdd88a2f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/bdd88a2f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/bdd88a2f Branch: refs/heads/cassandra-3.0 Commit: bdd88a2f6a1cd12f23bc084e64ec24ca60f20e04 Parents: 073f062 851aed7 Author: Marcus Eriksson Authored: Fri Nov 20 12:04:04 2015 +0100 Committer: Marcus Eriksson Committed: Fri Nov 20 12:04:04 2015 +0100 -- NEWS.txt | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/bdd88a2f/NEWS.txt -- diff --cc NEWS.txt index b67814a,54a6b79..4cf9c7b --- a/NEWS.txt +++ b/NEWS.txt @@@ -33,11 -18,22 +33,15 @@@ Operation New features + - Time windows in DTCS are now limited to 1 day by default to be able to + handle bootstrap and repair in a better way. To get the old behaviour, + increase max_window_size_seconds. + - DTCS option max_sstable_age_days is now deprecated and defaults to 1000 days. - Native protocol server now allows both SSL and non-SSL connections on the same port. -- Switching racks is no longer an allowed operation on a node which has - data. Instead, the node will need to be decommissioned and rebootstrapped. - If moving from the SimpleSnitch, make sure the rack containing all current - nodes is named "rack1". To override this behavior when manually wiping - the node and bootstrapping, use -Dcassandra.ignore_rack=true. -- a new validate(key, cf) method is added to PerRowSecondaryIndex. A default - implementation is provided, so no changes are required to custom implementations. -2.1.11 +2.2.3 = Upgrading
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/073f0626 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/073f0626 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/073f0626 Branch: refs/heads/cassandra-3.0 Commit: 073f06262a60f661d3db5e308daa9877516cda51 Parents: 95feab6 99617a5 Author: Marcus Eriksson Authored: Fri Nov 20 11:05:01 2015 +0100 Committer: Marcus Eriksson Committed: Fri Nov 20 11:05:01 2015 +0100 -- CHANGES.txt | 1 + pylib/cqlshlib/cql3handling.py | 1 + .../DateTieredCompactionStrategy.java | 34 ++ .../DateTieredCompactionStrategyOptions.java| 30 ++-- .../DateTieredCompactionStrategyTest.java | 37 +--- 5 files changed, 73 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/073f0626/CHANGES.txt -- diff --cc CHANGES.txt index 14e8c3d,66423c7..867226f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,5 +1,18 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Limit window size in DTCS (CASSANDRA-10280) * sstableloader does not use MAX_HEAP_SIZE env parameter (CASSANDRA-10188) * (cqlsh) Improve COPY TO performance and error handling (CASSANDRA-9304) * Don't remove level info when running upgradesstables (CASSANDRA-10692) http://git-wip-us.apache.org/repos/asf/cassandra/blob/073f0626/pylib/cqlshlib/cql3handling.py -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/073f0626/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/073f0626/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java -- diff --cc test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java index 2824d3a,5afd575..2fab014 --- a/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java +++ b/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java @@@ -312,10 -311,11 +322,11 @@@ public class DateTieredCompactionStrate Thread.sleep(2000); AbstractCompactionTask t = dtcs.getNextBackgroundTask((int) (System.currentTimeMillis()/1000)); assertNotNull(t); -assertEquals(1, Iterables.size(t.sstables)); -SSTableReader sstable = t.sstables.iterator().next(); +assertEquals(1, Iterables.size(t.transaction.originals())); +SSTableReader sstable = t.transaction.originals().iterator().next(); assertEquals(sstable, expiredSSTable); -cfs.getDataTracker().unmarkCompacting(cfs.getSSTables()); +t.transaction.abort(); + cfs.truncateBlocking(); } @Test @@@ -355,7 -354,9 +365,8 @@@ DateTieredCompactionStrategy dtcs = new DateTieredCompactionStrategy(cfs, options); for (SSTableReader sstable : cfs.getSSTables()) dtcs.addSSTable(sstable); - assertEquals(20, dtcs.getNextBackgroundTask(0).transaction.originals().size()); + AbstractCompactionTask task = dtcs.getNextBackgroundTask(0); -assertEquals(20, task.sstables.size()); -cfs.getDataTracker().unmarkCompacting(task.sstables); -cfs.truncateBlocking(); ++assertEquals(20, task.transaction.originals().size()); ++task.transaction.abort(); } - }
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/95feab66 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/95feab66 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/95feab66 Branch: refs/heads/cassandra-3.0 Commit: 95feab6631f96315db3587f42c6c190a9745c2a7 Parents: 4e48324 4f2337f Author: Robert Stupp Authored: Thu Nov 19 11:09:11 2015 +0100 Committer: Robert Stupp Committed: Thu Nov 19 11:09:11 2015 +0100 -- CHANGES.txt | 3 ++- bin/sstableloader | 6 +- 2 files changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/95feab66/CHANGES.txt -- diff --cc CHANGES.txt index 4e19b23,94a9ae2..14e8c3d --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,18 -1,6 +1,19 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: - * * (cqlsh) Improve COPY TO performance and error handling (CASSANDRA-9304) + * sstableloader does not use MAX_HEAP_SIZE env parameter (CASSANDRA-10188) + * (cqlsh) Improve COPY TO performance and error handling (CASSANDRA-9304) * Don't remove level info when running upgradesstables (CASSANDRA-10692) * Create compression chunk for sending file only (CASSANDRA-10680) * Make buffered read size configurable (CASSANDRA-10249)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/d09b6c69 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d09b6c69 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d09b6c69 Branch: refs/heads/cassandra-3.0 Commit: d09b6c69e0e0c6adff8e679f2286a335d883f1bd Parents: 077f9bf 246cb88 Author: Marcus Eriksson Authored: Wed Nov 18 13:59:09 2015 +0100 Committer: Marcus Eriksson Committed: Wed Nov 18 13:59:09 2015 +0100 -- CHANGES.txt | 1 + .../compaction/WrappingCompactionStrategy.java | 16 + .../LeveledCompactionStrategyTest.java | 35 3 files changed, 52 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d09b6c69/CHANGES.txt -- diff --cc CHANGES.txt index 572afc2,6ccde28..c3dacc2 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,5 +1,18 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Don't remove level info when running upgradesstables (CASSANDRA-10692) * Create compression chunk for sending file only (CASSANDRA-10680) * Make buffered read size configurable (CASSANDRA-10249) * Forbid compact clustering column type changes in ALTER TABLE (CASSANDRA-8879) http://git-wip-us.apache.org/repos/asf/cassandra/blob/d09b6c69/src/java/org/apache/cassandra/db/compaction/WrappingCompactionStrategy.java -- diff --cc src/java/org/apache/cassandra/db/compaction/WrappingCompactionStrategy.java index 9daa0c5,71a6bc1..8555432 --- a/src/java/org/apache/cassandra/db/compaction/WrappingCompactionStrategy.java +++ b/src/java/org/apache/cassandra/db/compaction/WrappingCompactionStrategy.java @@@ -32,10 -32,10 +32,11 @@@ import org.slf4j.LoggerFactory import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.db.ColumnFamilyStore; ++import org.apache.cassandra.db.lifecycle.LifecycleTransaction; import org.apache.cassandra.dht.Range; import org.apache.cassandra.dht.Token; +import org.apache.cassandra.io.sstable.format.SSTableReader; import org.apache.cassandra.io.sstable.ISSTableScanner; -import org.apache.cassandra.io.sstable.SSTableReader; import org.apache.cassandra.notifications.INotification; import org.apache.cassandra.notifications.INotificationConsumer; import org.apache.cassandra.notifications.SSTableAddedNotification; @@@ -123,6 -123,21 +124,21 @@@ public final class WrappingCompactionSt } @Override -public AbstractCompactionTask getCompactionTask(Collection sstables, final int gcBefore, long maxSSTableBytes) ++public AbstractCompactionTask getCompactionTask(LifecycleTransaction txn, final int gcBefore, long maxSSTableBytes) + { -assert sstables.size() > 0; -boolean repairedSSTables = sstables.iterator().next().isRepaired(); -for (SSTableReader sstable : sstables) ++assert txn.originals().size() > 0; ++boolean repairedSSTables = txn.originals().iterator().next().isRepaired(); ++for (SSTableReader sstable : txn.originals()) + if (repairedSSTables != sstable.isRepaired()) + throw new RuntimeException("Can't mix repaired and unrepaired sstables in a compaction"); + + if (repairedSSTables) -return repaired.getCompactionTask(sstables, gcBefore, maxSSTableBytes); ++return repaired.getCompactionTask(txn, gcBefore, maxSSTableBytes); + else -return unrepaired.getCompactionTask(sstables, gcBefore, maxSSTableBytes); ++return unrepaired.getCompactionTask(txn, gcBefore, maxSSTableBytes); + } + + @Override public synchronized AbstractCompactionTask getUserDefinedTask(Collection sstables, int gcBefore) { assert !sstables.isEmpty(); http://git-wip-us.apache.org/repos/asf/cassandra/blob/d09b6c69/test/unit/
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/077f9bf5 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/077f9bf5 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/077f9bf5 Branch: refs/heads/cassandra-3.0 Commit: 077f9bf5f55fe7dca0b10b3357314c208c2f35ed Parents: ae64cc0 5a665b8 Author: Aleksey Yeschenko Authored: Wed Nov 18 12:52:36 2015 + Committer: Aleksey Yeschenko Committed: Wed Nov 18 12:52:36 2015 + -- .../org/apache/cassandra/io/sstable/CorruptSSTableException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/afe3fe3d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/afe3fe3d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/afe3fe3d Branch: refs/heads/cassandra-3.0 Commit: afe3fe3df98f3439bca05cbe132a0e97b66945e4 Parents: a68f8bd 9b97766 Author: Aleksey Yeschenko Authored: Tue Nov 17 18:56:02 2015 + Committer: Aleksey Yeschenko Committed: Tue Nov 17 18:56:02 2015 + -- CHANGES.txt | 1 + src/java/org/apache/cassandra/io/util/RandomAccessReader.java | 7 --- 2 files changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/afe3fe3d/CHANGES.txt -- diff --cc CHANGES.txt index fb8f89a,08db386..4cb9275 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,5 +1,18 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Make buffered read size configurable (CASSANDRA-10249) * Forbid compact clustering column type changes in ALTER TABLE (CASSANDRA-8879) * Reject incremental repair with subrange repair (CASSANDRA-10422) * Add a nodetool command to refresh size_estimates (CASSANDRA-9579) http://git-wip-us.apache.org/repos/asf/cassandra/blob/afe3fe3d/src/java/org/apache/cassandra/io/util/RandomAccessReader.java -- diff --cc src/java/org/apache/cassandra/io/util/RandomAccessReader.java index 278f55c,d15fe46..751269b --- a/src/java/org/apache/cassandra/io/util/RandomAccessReader.java +++ b/src/java/org/apache/cassandra/io/util/RandomAccessReader.java @@@ -23,22 -24,31 +23,23 @@@ import java.nio.ByteBuffer import com.google.common.annotations.VisibleForTesting; import org.apache.cassandra.io.FSReadError; +import org.apache.cassandra.io.compress.BufferType; +import org.apache.cassandra.utils.ByteBufferUtil; -public class RandomAccessReader extends RandomAccessFile implements FileDataInput +public class RandomAccessReader extends AbstractDataInput implements FileDataInput { -public static final long CACHE_FLUSH_INTERVAL_IN_BYTES = (long) Math.pow(2, 27); // 128mb - // default buffer size, 64Kb public static final int DEFAULT_BUFFER_SIZE = 65536; + public static final int BUFFER_SIZE = Integer.getInteger("cassandra.rar_buffer_size", DEFAULT_BUFFER_SIZE); -// absolute filesystem path to the file -private final String filePath; - // buffer which will cache file blocks -protected byte[] buffer; +protected ByteBuffer buffer; -// `current` as current position in file // `bufferOffset` is the offset of the beginning of the buffer // `markedPointer` folds the offset of the last file mark -protected long bufferOffset, current = 0, markedPointer; -// `validBufferBytes` is the number of bytes in the buffer that are actually valid; -// this will be LESS than buffer capacity if buffer is not full! -protected int validBufferBytes = 0; +protected long bufferOffset, markedPointer; -// channel liked with the file, used to retrieve data and force updates. -protected final FileChannel channel; +protected final ChannelProxy channel; // this can be overridden at construction to a value shorter than the true length of the file; // if so, it acts as an imposed limit on reads, rather than a convenience property @@@ -55,40 -73,39 +56,40 @@@ if (bufferSize <= 0) throw new IllegalArgumentException("bufferSize must be positive"); -buffer = new byte[bufferSize]; - // we can cache file length in read-only mode -long fileLength = overrideLength; -if (fileLength <= 0) -{ -try -{ -fileLength = channel.size(); -} -catch (IOException e) -
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/a68f8bd7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a68f8bd7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a68f8bd7 Branch: refs/heads/cassandra-3.0 Commit: a68f8bd700666e87877993107ad1b20ed957c8a8 Parents: 99b82db 5414950 Author: Aleksey Yeschenko Authored: Tue Nov 17 16:47:41 2015 + Committer: Aleksey Yeschenko Committed: Tue Nov 17 16:47:41 2015 + -- CHANGES.txt | 1 + .../cassandra/cql3/statements/AlterTableStatement.java | 3 +++ .../cassandra/cql3/validation/operations/AlterTest.java | 8 3 files changed, 12 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a68f8bd7/CHANGES.txt -- diff --cc CHANGES.txt index f5d3416,eea14c8..fb8f89a --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,5 +1,18 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Forbid compact clustering column type changes in ALTER TABLE (CASSANDRA-8879) * Reject incremental repair with subrange repair (CASSANDRA-10422) * Add a nodetool command to refresh size_estimates (CASSANDRA-9579) * Shutdown compaction in drain to prevent leak (CASSANDRA-10079) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a68f8bd7/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a68f8bd7/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java -- diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java index 566c0ea,a6aad87..2cc8a18 --- a/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java +++ b/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java @@@ -201,20 -200,10 +202,27 @@@ public class AlterTest extends CQLTeste } } +/** + * tests CASSANDRA-10027 + */ +@Test +public void testAlterColumnTypeToDate() throws Throwable +{ +createTable("CREATE TABLE %s (key int PRIMARY KEY, c1 int);"); +execute("INSERT INTO %s (key, c1) VALUES (1,1);"); +execute("ALTER TABLE %s ALTER c1 TYPE date;"); +assertRows(execute("SELECT * FROM %s"), row(1, 1)); + +createTable("CREATE TABLE %s (key int PRIMARY KEY, c1 varint);"); +execute("INSERT INTO %s (key, c1) VALUES (1,1);"); +assertInvalidMessage("Cannot change c1 from type varint to type date: types are incompatible.", + "ALTER TABLE %s ALTER c1 TYPE date;"); +} ++ + @Test // tests CASSANDRA-8879 + public void testAlterClusteringColumnTypeInCompactTable() throws Throwable + { + createTable("CREATE TABLE %s (key blob, column1 blob, value blob, PRIMARY KEY ((key), column1)) WITH COMPACT STORAGE"); + assertInvalidThrow(InvalidRequestException.class, "ALTER TABLE %s ALTER column1 TYPE ascii"); + } }
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/d434a33a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d434a33a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d434a33a Branch: refs/heads/cassandra-2.2 Commit: d434a33ace2dfe6715f4857f9537ee884f4ef410 Parents: 73a730f a8e8a67 Author: Marcus Eriksson Authored: Tue Nov 17 10:07:04 2015 +0100 Committer: Marcus Eriksson Committed: Tue Nov 17 10:07:04 2015 +0100 -- CHANGES.txt| 1 + .../apache/cassandra/repair/messages/RepairOption.java | 3 +++ .../org/apache/cassandra/service/StorageService.java | 4 .../cassandra/repair/messages/RepairOptionTest.java| 13 +++-- 4 files changed, 19 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d434a33a/CHANGES.txt -- diff --cc CHANGES.txt index 5705453,b6b394a..489a76d --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,16 -1,5 +1,17 @@@ -2.1.12 +2.2.4 + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Reject incremental repair with subrange repair (CASSANDRA-10422) * Add a nodetool command to refresh size_estimates (CASSANDRA-9579) * Shutdown compaction in drain to prevent leak (CASSANDRA-10079) * Invalidate cache after stream receive task is completed (CASSANDRA-10341) http://git-wip-us.apache.org/repos/asf/cassandra/blob/d434a33a/src/java/org/apache/cassandra/repair/messages/RepairOption.java -- diff --cc src/java/org/apache/cassandra/repair/messages/RepairOption.java index f3e452c,000..1780b6b mode 100644,00..100644 --- a/src/java/org/apache/cassandra/repair/messages/RepairOption.java +++ b/src/java/org/apache/cassandra/repair/messages/RepairOption.java @@@ -1,308 -1,0 +1,311 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.repair.messages; + +import java.util.*; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.cassandra.config.Config; +import org.apache.cassandra.config.DatabaseDescriptor; +import org.apache.cassandra.dht.IPartitioner; +import org.apache.cassandra.dht.Range; +import org.apache.cassandra.dht.Token; +import org.apache.cassandra.repair.RepairParallelism; +import org.apache.cassandra.tools.nodetool.Repair; +import org.apache.cassandra.utils.FBUtilities; + +/** + * Repair options. + */ +public class RepairOption +{ +public static final String PARALLELISM_KEY = "parallelism"; +public static final String PRIMARY_RANGE_KEY = "primaryRange"; +public static final String INCREMENTAL_KEY = "incremental"; +public static final String JOB_THREADS_KEY = "jobThreads"; +public static final String RANGES_KEY = "ranges"; +public static final String COLUMNFAMILIES_KEY = "columnFamilies"; +public static final String DATACENTERS_KEY = "dataCenters"; +public static final String HOSTS_KEY = "hosts"; +public static final String TRACE_KEY = "trace"; + +// we don't want to push nodes too much for repair +public static final int MAX_JOB_THREADS = 4; + +private static final Logger logger = LoggerFa
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/84d44885 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/84d44885 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/84d44885 Branch: refs/heads/cassandra-3.0 Commit: 84d4488537605a86373325f86bbc4cd358921223 Parents: d84b42b ecd66de Author: Aleksey Yeschenko Authored: Thu Nov 12 17:58:38 2015 + Committer: Aleksey Yeschenko Committed: Thu Nov 12 17:58:38 2015 + -- CHANGES.txt | 1 + .../cassandra/service/StorageService.java | 6 .../cassandra/service/StorageServiceMBean.java | 5 +++ .../org/apache/cassandra/tools/NodeProbe.java | 12 +++ .../org/apache/cassandra/tools/NodeTool.java| 3 +- .../tools/nodetool/RefreshSizeEstimates.java| 33 6 files changed, 59 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/84d44885/CHANGES.txt -- diff --cc CHANGES.txt index 2cfcb55,2eeda94..9c834f3 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,15 -1,5 +1,16 @@@ -2.1.12 +2.2.4 + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Add a nodetool command to refresh size_estimates (CASSANDRA-9579) * Shutdown compaction in drain to prevent leak (CASSANDRA-10079) * Invalidate cache after stream receive task is completed (CASSANDRA-10341) * Reject counter writes in CQLSSTableWriter (CASSANDRA-10258) http://git-wip-us.apache.org/repos/asf/cassandra/blob/84d44885/src/java/org/apache/cassandra/service/StorageService.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/84d44885/src/java/org/apache/cassandra/service/StorageServiceMBean.java -- diff --cc src/java/org/apache/cassandra/service/StorageServiceMBean.java index 2c92d43,1351fea..00060ae --- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java +++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java @@@ -239,9 -248,14 +239,14 @@@ public interface StorageServiceMBean ex public long trueSnapshotsSize(); /** + * Forces refresh of values stored in system.size_estimates of all column families. + */ + public void refreshSizeEstimates() throws ExecutionException; + + /** * Forces major compaction of a single keyspace */ -public void forceKeyspaceCompaction(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException; +public void forceKeyspaceCompaction(boolean splitOutput, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException; /** * Trigger a cleanup of keys on a single keyspace http://git-wip-us.apache.org/repos/asf/cassandra/blob/84d44885/src/java/org/apache/cassandra/tools/NodeProbe.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/84d44885/src/java/org/apache/cassandra/tools/NodeTool.java -- diff --cc src/java/org/apache/cassandra/tools/NodeTool.java index 175b325,1d4a420..fcb6ed0 --- a/src/java/org/apache/cassandra/tools/NodeTool.java +++ b/src/java/org/apache/cassandra/tools/NodeTool.java @@@ -129,23 -187,14 +129,24 @@@ public class NodeToo TpStats.class, TopPartitions.class, SetLoggingLevel.class, -GetLoggingLevels.class +GetLoggingLevels.class, - FailureDetectorInfo.class ++FailureDetectorInfo.class, ++RefreshSizeEstimates.class ); -Cli parser = Cli.builder("nodetool") -.withDescription("Manage your Cassandra cluster") +Cli.CliBuilder builder = Cli.builder("nodetool"); + +builder.withDescription("Manage your Cassandra cluster") + .
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/b0def95b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b0def95b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b0def95b Branch: refs/heads/cassandra-3.0 Commit: b0def95b596448564890ab8f88ef8da9739f823c Parents: b5b1252 852a8ba Author: Aleksey Yeschenko Authored: Mon Nov 9 15:40:42 2015 + Committer: Aleksey Yeschenko Committed: Mon Nov 9 15:40:42 2015 + -- CHANGES.txt | 1 + src/java/org/apache/cassandra/net/MessagingService.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0def95b/CHANGES.txt -- diff --cc CHANGES.txt index 814a924,123c1f3..fa868fe --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,13 -1,5 +1,14 @@@ -2.1.12 +2.2.4 + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Remove superfluous COUNTER_MUTATION stage mapping (CASSANDRA-10605) * Improve json2sstable error reporting on nonexistent columns (CASSANDRA-10401) * (cqlsh) fix COPY using wrong variable name for time_format (CASSANDRA-10633) * Do not run SizeEstimatesRecorder if a node is not a member of the ring (CASSANDRA-9912) http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0def95b/src/java/org/apache/cassandra/net/MessagingService.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/59a32211 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/59a32211 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/59a32211 Branch: refs/heads/cassandra-3.0 Commit: 59a32211a01c6eb2ae694da0161006332a143947 Parents: f8783b7 ff9b6bb Author: Aleksey Yeschenko Authored: Fri Nov 6 19:21:28 2015 + Committer: Aleksey Yeschenko Committed: Fri Nov 6 19:21:28 2015 + -- CHANGES.txt | 1 + .../org/apache/cassandra/tools/SSTableImport.java | 5 + .../org/apache/cassandra/tools/SSTableImportTest.java | 14 +++--- 3 files changed, 17 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a32211/CHANGES.txt -- diff --cc CHANGES.txt index f47e1dd,8ff726e..814a924 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,13 -1,5 +1,14 @@@ -2.1.12 +2.2.4 + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Improve json2sstable error reporting on nonexistent columns (CASSANDRA-10401) * (cqlsh) fix COPY using wrong variable name for time_format (CASSANDRA-10633) * Do not run SizeEstimatesRecorder if a node is not a member of the ring (CASSANDRA-9912) * Improve handling of dead nodes in gossip (CASSANDRA-10298) http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a32211/src/java/org/apache/cassandra/tools/SSTableImport.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a32211/test/unit/org/apache/cassandra/tools/SSTableImportTest.java -- diff --cc test/unit/org/apache/cassandra/tools/SSTableImportTest.java index 814662c,77036e8..5eaf154 --- a/test/unit/org/apache/cassandra/tools/SSTableImportTest.java +++ b/test/unit/org/apache/cassandra/tools/SSTableImportTest.java @@@ -57,32 -46,20 +57,40 @@@ import org.apache.cassandra.db.columnit import org.apache.cassandra.db.filter.QueryFilter; import org.apache.cassandra.db.marshal.AsciiType; import org.apache.cassandra.db.marshal.BytesType; +import org.apache.cassandra.db.marshal.CounterColumnType; +import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.io.sstable.Descriptor; -import org.apache.cassandra.io.sstable.SSTableReader; +import org.apache.cassandra.locator.SimpleStrategy; - import org.apache.thrift.TException; -public class SSTableImportTest extends SchemaLoader +public class SSTableImportTest { +public static final String KEYSPACE1 = "SSTableImportTest"; +public static final String CF_STANDARD = "Standard1"; +public static final String CF_COUNTER = "Counter1"; +public static final String CQL_TABLE = "table1"; + +@BeforeClass +public static void defineSchema() throws ConfigurationException +{ +SchemaLoader.prepareServer(); +SchemaLoader.createKeyspace(KEYSPACE1, +SimpleStrategy.class, +KSMetaData.optsWithRF(1), +SchemaLoader.standardCFMD(KEYSPACE1, CF_STANDARD), +SchemaLoader.standardCFMD(KEYSPACE1, CF_COUNTER).defaultValidator(CounterColumnType.instance), +SchemaLoader.standardCFMD(KEYSPACE1, "AsciiKeys").keyValidator(AsciiType.instance), +CFMetaData.compile("CREATE TABLE table1 (k int PRIMARY KEY, v1 text, v2 int)", KEYSPACE1)); +} + + @Test(expected = IllegalArgumentException.class) + public void testImportUnknownCf() throws IOException, URISyntaxException + { + // Import JSON to temp SSTable file + String jsonUrl = resourcePath("SimpleCF.json"); + File tempSS = tempSSTableFile("Keyspace1", "Standard1"); + new SSTableImport(true).importJson(jsonUrl, "UnknownKeyspace", "UnknownCF", tempSS.getPath()); + } + @Test public void testImportSimpleCf() throws IOException, URISyntaxException { @@@ -250,8 -229,8 +258,8 @@@ public void shouldReject
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/edca4dce/bin/cqlsh.py -- diff --cc bin/cqlsh.py index 17bddd3,000..a6070ef mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2737 -1,0 +1,2737 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +if sys.version_info[0] != 2 or sys.version_info[1] != 7: +sys.exit("\nCQL Shell supports only Python 2.7\n") + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory, TraceUnavailable + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, FormattedValue,
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/801c50e6 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/801c50e6 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/801c50e6 Branch: refs/heads/cassandra-3.0 Commit: 801c50e69f13bef3dc7b29a303dc11aad7d83d19 Parents: 0ff13d2 2ca7599 Author: Aleksey Yeschenko Authored: Fri Nov 6 00:10:09 2015 + Committer: Aleksey Yeschenko Committed: Fri Nov 6 00:10:09 2015 + -- CHANGES.txt | 1 + .../apache/cassandra/db/SizeEstimatesRecorder.java | 5 +++-- .../org/apache/cassandra/db/SystemKeyspace.java | 16 .../apache/cassandra/service/StorageService.java| 5 + 4 files changed, 5 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/801c50e6/CHANGES.txt -- diff --cc CHANGES.txt index fedede2,a994ca1..538d5e4 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,11 -1,5 +1,12 @@@ -2.1.12 +2.2.4 + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Do not run SizeEstimatesRecorder if a node is not a member of the ring (CASSANDRA-9912) * Improve handling of dead nodes in gossip (CASSANDRA-10298) * Fix logback-tools.xml incorrectly configured for outputing to System.err (CASSANDRA-9937) http://git-wip-us.apache.org/repos/asf/cassandra/blob/801c50e6/src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/801c50e6/src/java/org/apache/cassandra/db/SystemKeyspace.java -- diff --cc src/java/org/apache/cassandra/db/SystemKeyspace.java index 62bf59e,c600652..1807101 --- a/src/java/org/apache/cassandra/db/SystemKeyspace.java +++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java @@@ -584,26 -458,10 +584,10 @@@ public final class SystemKeyspac { assert !tokens.isEmpty() : "removeEndpoint should be used instead"; String req = "INSERT INTO system.%s (key, tokens) VALUES ('%s', ?)"; -executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), tokensAsSet(tokens)); -forceBlockingFlush(LOCAL_CF); +executeInternal(String.format(req, LOCAL, LOCAL), tokensAsSet(tokens)); +forceBlockingFlush(LOCAL); } - /** - * Convenience method to update the list of tokens in the local system keyspace. - * - * @param addTokens tokens to add - * @param rmTokens tokens to remove - * @return the collection of persisted tokens - */ - public static synchronized Collection updateLocalTokens(Collection addTokens, Collection rmTokens) - { - Collection tokens = getSavedTokens(); - tokens.removeAll(rmTokens); - tokens.addAll(addTokens); - updateTokens(tokens); - return tokens; - } - public static void forceBlockingFlush(String cfname) { if (!Boolean.getBoolean("cassandra.unsafesystem")) http://git-wip-us.apache.org/repos/asf/cassandra/blob/801c50e6/src/java/org/apache/cassandra/service/StorageService.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/5a2d5298 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5a2d5298 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5a2d5298 Branch: refs/heads/cassandra-3.0 Commit: 5a2d5298423dc4501fad0d53183e7ac93d83e76c Parents: b4b2684 b6015fa Author: Aleksey Yeschenko Authored: Wed Nov 4 13:59:17 2015 + Committer: Aleksey Yeschenko Committed: Wed Nov 4 13:59:17 2015 + -- CHANGES.txt | 1 + .../apache/cassandra/db/HintedHandOffManager.java| 4 .../org/apache/cassandra/service/StorageService.java | 15 --- 3 files changed, 17 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a2d5298/CHANGES.txt -- diff --cc CHANGES.txt index f25ac7e,5ceabb4..60bf565 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,11 -1,5 +1,12 @@@ -2.1.12 +2.2.4 + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Improve handling of dead nodes in gossip (CASSANDRA-10298) * Fix logback-tools.xml incorrectly configured for outputing to System.err (CASSANDRA-9937) * Fix streaming to catch exception so retry not fail (CASSANDRA-10557) http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a2d5298/src/java/org/apache/cassandra/db/HintedHandOffManager.java -- diff --cc src/java/org/apache/cassandra/db/HintedHandOffManager.java index 179c611,4fbdd27..4ec5d62 --- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java +++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java @@@ -213,10 -213,14 +213,14 @@@ public class HintedHandOffManager imple { if (!StorageService.instance.getTokenMetadata().isMember(endpoint)) return; + UUID hostId = StorageService.instance.getTokenMetadata().getHostId(endpoint); + if (hostId == null) + return; + ByteBuffer hostIdBytes = ByteBuffer.wrap(UUIDGen.decompose(hostId)); -final Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, hostIdBytes); -mutation.delete(SystemKeyspace.HINTS_CF, System.currentTimeMillis()); +final Mutation mutation = new Mutation(SystemKeyspace.NAME, hostIdBytes); +mutation.delete(SystemKeyspace.HINTS, System.currentTimeMillis()); // execute asynchronously to avoid blocking caller (which may be processing gossip) Runnable runnable = new Runnable() http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a2d5298/src/java/org/apache/cassandra/service/StorageService.java -- diff --cc src/java/org/apache/cassandra/service/StorageService.java index f162f7c,d02a572..45ed493 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@@ -2139,9 -1956,14 +2147,10 @@@ public class StorageService extends Not HintedHandOffManager.instance.deleteHintsForEndpoint(endpoint); removeEndpoint(endpoint); tokenMetadata.removeEndpoint(endpoint); - tokenMetadata.removeBootstrapTokens(tokens); + if (tokens != null) + tokenMetadata.removeBootstrapTokens(tokens); -if (!isClientMode) -{ -for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers) -subscriber.onLeaveCluster(endpoint); -} +notifyLeft(endpoint); PendingRangeCalculatorService.instance.update(); }
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/b4b26840 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b4b26840 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b4b26840 Branch: refs/heads/cassandra-3.0 Commit: b4b268407f6bf1d1137099c1b34ca3fb91733bd1 Parents: a549bd0 dc73c0b Author: Aleksey Yeschenko Authored: Wed Nov 4 12:58:21 2015 + Committer: Aleksey Yeschenko Committed: Wed Nov 4 12:58:21 2015 + -- CHANGES.txt| 2 ++ conf/logback-tools.xml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4b26840/CHANGES.txt -- diff --cc CHANGES.txt index 5c23acf,fd6c8a1..f25ac7e --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,11 -1,6 +1,13 @@@ -2.1.12 +2.2.4 + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Fix logback-tools.xml incorrectly configured for outputing to System.err +(CASSANDRA-9937) * Fix streaming to catch exception so retry not fail (CASSANDRA-10557) * Add validation method to PerRowSecondaryIndex (CASSANDRA-10092) * Support encrypted and plain traffic on the same port (CASSANDRA-10559)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/6e929628 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6e929628 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6e929628 Branch: refs/heads/cassandra-3.0 Commit: 6e929628f65e47ca3d83bafa2593e56af41e2129 Parents: ca8e9a9 83fb3cc Author: Sylvain Lebresne Authored: Fri Oct 30 09:49:01 2015 +0100 Committer: Sylvain Lebresne Committed: Fri Oct 30 09:49:01 2015 +0100 -- doc/native_protocol_v3.spec | 11 --- doc/native_protocol_v4.spec | 6 +- 2 files changed, 13 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6e929628/doc/native_protocol_v4.spec -- diff --cc doc/native_protocol_v4.spec index f040323,000..7aca858 mode 100644,00..100644 --- a/doc/native_protocol_v4.spec +++ b/doc/native_protocol_v4.spec @@@ -1,1162 -1,0 +1,1166 @@@ + + CQL BINARY PROTOCOL v4 + + +Table of Contents + + 1. Overview + 2. Frame header +2.1. version +2.2. flags +2.3. stream +2.4. opcode +2.5. length + 3. Notations + 4. Messages +4.1. Requests + 4.1.1. STARTUP + 4.1.2. AUTH_RESPONSE + 4.1.3. OPTIONS + 4.1.4. QUERY + 4.1.5. PREPARE + 4.1.6. EXECUTE + 4.1.7. BATCH + 4.1.8. REGISTER +4.2. Responses + 4.2.1. ERROR + 4.2.2. READY + 4.2.3. AUTHENTICATE + 4.2.4. SUPPORTED + 4.2.5. RESULT +4.2.5.1. Void +4.2.5.2. Rows +4.2.5.3. Set_keyspace +4.2.5.4. Prepared +4.2.5.5. Schema_change + 4.2.6. EVENT + 4.2.7. AUTH_CHALLENGE + 4.2.8. AUTH_SUCCESS + 5. Compression + 6. Data Type Serialization Formats + 7. User Defined Type Serialization + 8. Result paging + 9. Error codes + 10. Changes from v3 + + +1. Overview + + The CQL binary protocol is a frame based protocol. Frames are defined as: + + 0 8162432 40 + +-+-+-+-+-+ + | version | flags | stream | opcode | + +-+-+-+-+-+ + |length | + +-+-+-+-+ + | | + .... body ... . + . . + . . + + + + The protocol is big-endian (network byte order). + + Each frame contains a fixed size header (9 bytes) followed by a variable size + body. The header is described in Section 2. The content of the body depends + on the header opcode value (the body can in particular be empty for some + opcode values). The list of allowed opcode is defined Section 2.3 and the + details of each corresponding message is described Section 4. + + The protocol distinguishes 2 types of frames: requests and responses. Requests + are those frame sent by the clients to the server, response are the ones sent + by the server. Note however that the protocol supports server pushes (events) + so responses does not necessarily come right after a client request. + + Note to client implementors: clients library should always assume that the + body of a given frame may contain more data than what is described in this + document. It will however always be safe to ignore the remaining of the frame + body in such cases. The reason is that this may allow to sometimes extend the + protocol with optional features without needing to change the protocol + version. + + + +2. Frame header + +2.1. version + + The version is a single byte that indicate both the direction of the message + (request or response) and the version of the protocol in use. The up-most bit + of version is used to define the direction of the message: 0 indicates a + request, 1 indicates a responses. This can be useful for protocol analyzers to + distinguish the nature of the packet from the direction which it is moving. + The rest of that byte is the protocol version (4 for the protocol defined in + this document). In other words, for this version of the protocol, version will + have one of: +0x04Request frame for this protocol version +0x84Response frame for this protocol version + + Please note that the while every message ship with the version, only one version + of messages is accepted on a given connection. In other words, the first message + exchanged (STARTUP
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/734a3bfa Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/734a3bfa Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/734a3bfa Branch: refs/heads/cassandra-3.0 Commit: 734a3bfa782bb0489878cd14c2f589d662c22f11 Parents: 5a356a7 32a6f20 Author: Robert Stupp Authored: Wed Oct 28 14:18:25 2015 +0100 Committer: Robert Stupp Committed: Wed Oct 28 14:18:25 2015 +0100 -- CHANGES.txt | 1 + NEWS.txt| 5 ++ conf/cassandra.yaml | 2 + .../cassandra/config/EncryptionOptions.java | 1 + .../org/apache/cassandra/transport/Server.java | 77 ++-- 5 files changed, 78 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/734a3bfa/CHANGES.txt -- diff --cc CHANGES.txt index 9021e9d,998dd22..c4f606f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,10 -1,5 +1,11 @@@ -2.1.12 +2.2.4 + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Support encrypted and plain traffic on the same port (CASSANDRA-10559) * Do STCS in DTCS windows (CASSANDRA-10276) * Don't try to get ancestors from half-renamed sstables (CASSANDRA-10501) * Avoid repetition of JVM_OPTS in debian package (CASSANDRA-10251) http://git-wip-us.apache.org/repos/asf/cassandra/blob/734a3bfa/NEWS.txt -- diff --cc NEWS.txt index 028d26d,c6ea6c0..94567d6 --- a/NEWS.txt +++ b/NEWS.txt @@@ -13,23 -13,21 +13,28 @@@ restore snapshots created with the prev 'sstableloader' tool. You can upgrade the file format of your snapshots using the provided 'sstableupgrade' tool. -2.1.12 -== +2.2.4 += + +Deprecation +--- +- Pig support has been deprecated, and will be removed in 3.0. + Please see CASSANDRA-10542 for more details. + +Operations +-- +- Switching racks is no longer an allowed operation on a node which has + data. Instead, the node will need to be decommissioned and rebootstrapped. + If moving from the SimpleSnitch, make sure the rack containing all current + nodes is named "rack1". + New features + + - Native protocol server now allows both SSL and non-SSL connections on + the same port. -- Switching racks is no longer an allowed operation on a node which has - data. Instead, the node will need to be decommissioned and rebootstrapped. - If moving from the SimpleSnitch, make sure the rack containing all current - nodes is named "rack1". To override this behavior when manually wiping - the node and bootstrapping, use -Dcassandra.ignore_rack=true. + -2.1.11 +2.2.3 = Upgrading http://git-wip-us.apache.org/repos/asf/cassandra/blob/734a3bfa/conf/cassandra.yaml -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/734a3bfa/src/java/org/apache/cassandra/transport/Server.java -- diff --cc src/java/org/apache/cassandra/transport/Server.java index d610bff,02f17b0..c56564c --- a/src/java/org/apache/cassandra/transport/Server.java +++ b/src/java/org/apache/cassandra/transport/Server.java @@@ -30,20 -30,17 +30,22 @@@ import java.util.concurrent.atomic.Atom import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.netty.bootstrap.ServerBootstrap; + import io.netty.buffer.ByteBuf; +import io.netty.channel.*; import io.netty.channel.epoll.Epoll; import io.netty.channel.epoll.EpollEventLoopGroup; import io.netty.channel.epoll.EpollServerSocketChannel; -import io.netty.handler.codec.ByteToMessageDecoder; -import io.netty.util.Version; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - +import io.netty.channel.group.ChannelGroup; +import io.netty.channel.group.DefaultChannelGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; ++import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.handler.ssl.SslHandler; +import io.netty.util.Version; import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.GlobalEventExecutor; import
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/5a356a70 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5a356a70 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5a356a70 Branch: refs/heads/cassandra-3.0 Commit: 5a356a70631d50cbab0f01dbfea868f26af66582 Parents: 40cef77 cedcf07 Author: Marcus Eriksson Authored: Wed Oct 28 08:43:10 2015 +0100 Committer: Marcus Eriksson Committed: Wed Oct 28 08:50:44 2015 +0100 -- CHANGES.txt | 1 + .../DateTieredCompactionStrategy.java | 46 ++-- .../DateTieredCompactionStrategyTest.java | 57 ++-- 3 files changed, 72 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a356a70/CHANGES.txt -- diff --cc CHANGES.txt index 24862b0,5b46eac..9021e9d --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,10 -1,5 +1,11 @@@ -2.1.12 +2.2.4 + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Do STCS in DTCS windows (CASSANDRA-10276) * Don't try to get ancestors from half-renamed sstables (CASSANDRA-10501) * Avoid repetition of JVM_OPTS in debian package (CASSANDRA-10251) * Fix potential NPE from handling result of SIM.highestSelectivityIndex (CASSANDRA-10550) http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a356a70/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java -- diff --cc src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java index da2d35d,ece596f..fe8f135 --- a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java +++ b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java @@@ -50,11 -49,12 +50,12 @@@ public class DateTieredCompactionStrate if (!options.containsKey(AbstractCompactionStrategy.TOMBSTONE_COMPACTION_INTERVAL_OPTION) && !options.containsKey(AbstractCompactionStrategy.TOMBSTONE_THRESHOLD_OPTION)) { disableTombstoneCompactions = true; -logger.debug("Disabling tombstone compactions for DTCS"); +logger.trace("Disabling tombstone compactions for DTCS"); } else -logger.debug("Enabling tombstone compactions for DTCS"); +logger.trace("Enabling tombstone compactions for DTCS"); + this.stcsOptions = new SizeTieredCompactionStrategyOptions(options); } @Override @@@ -372,14 -379,13 +382,14 @@@ } @Override -public synchronized Collection getMaximalTask(int gcBefore) +@SuppressWarnings("resource") +public synchronized Collection getMaximalTask(int gcBefore, boolean splitOutput) { -Iterable sstables = cfs.markAllCompacting(); -if (sstables == null) +LifecycleTransaction modifier = cfs.markAllCompacting(OperationType.COMPACTION); +if (modifier == null) return null; - return Arrays.asList(new CompactionTask(cfs, modifier, gcBefore, false)); -return Collections.singleton(new CompactionTask(cfs, sstables, gcBefore, false)); ++return Collections.singleton(new CompactionTask(cfs, modifier, gcBefore, false)); } @Override http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a356a70/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java -- diff --cc test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java index 0159c83,368101d..2824d3a --- a/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java +++ b/test/unit/org/apache/cassandra/db/compaction/DateTieredCompactionStrategyTest.java @@@ -325,10 -301,50 +312,50 @@@ public class DateTieredCompactionStrate Thread.sleep(2000); AbstractCompactionTask t = dtcs.getNextBackgroundTask((int) (System.currentTimeMillis()/1000)); assertNotNull(t); -assertEquals(1, Iterables.size(t.sstables)); -SSTableReader sstable = t.sstables.iterator().next(); +assertEquals(1, Iterables.size(t.transaction.originals())); +SSTableReader sstable = t.transaction.originals().iterator().next(); assertEquals(sstable, expiredSSTable); -cfs.getDataTracker().unmarkCompacting(cfs.getSST
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/40cef770/bin/cqlsh.py -- diff --cc bin/cqlsh.py index 7f2d39b,000..09da020 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2743 -1,0 +1,2744 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +if sys.version_info[0] != 2 or sys.version_info[1] != 7: +sys.exit("\nCQL Shell supports only Python 2.7\n") + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster, PagedResult +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, FormattedValue, colorm
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/b06c637f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b06c637f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b06c637f Branch: refs/heads/cassandra-3.0 Commit: b06c637f11b0ef8e0063b806199c6c59f55358b6 Parents: 32f22a4 87f43ac Author: Marcus Eriksson Authored: Tue Oct 27 12:09:10 2015 +0100 Committer: Marcus Eriksson Committed: Tue Oct 27 12:09:10 2015 +0100 -- CHANGES.txt | 1 + src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 5 + 2 files changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b06c637f/CHANGES.txt -- diff --cc CHANGES.txt index ed28f2e,2ca3b43..24862b0 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,15 -1,12 +1,16 @@@ -2.1.12 +2.2.4 + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Don't try to get ancestors from half-renamed sstables (CASSANDRA-10501) * Avoid repetition of JVM_OPTS in debian package (CASSANDRA-10251) * Fix potential NPE from handling result of SIM.highestSelectivityIndex (CASSANDRA-10550) - * Fix paging issues with partitions containing only static columns data - (CASSANDRA-10381) + * Fix paging issues with partitions containing only static columns data (CASSANDRA-10381) * Fix conditions on static columns (CASSANDRA-10264) * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377) - * Merge range tombstones during compaction (CASSANDRA-7953) * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242) http://git-wip-us.apache.org/repos/asf/cassandra/blob/b06c637f/src/java/org/apache/cassandra/db/ColumnFamilyStore.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/12e38f7f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/12e38f7f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/12e38f7f Branch: refs/heads/cassandra-3.0 Commit: 12e38f7f8e9eacf80cd060baeb6b0ca750b1c861 Parents: 20d5508 29ff1f2 Author: Aleksey Yeschenko Authored: Wed Oct 21 21:09:46 2015 +0100 Committer: Aleksey Yeschenko Committed: Wed Oct 21 21:09:46 2015 +0100 -- NEWS.txt | 4 ++-- conf/cassandra.yaml| 2 +- src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/12e38f7f/NEWS.txt -- diff --cc NEWS.txt index 4fa61c0,67a545b..028d26d --- a/NEWS.txt +++ b/NEWS.txt @@@ -13,23 -13,19 +13,23 @@@ restore snapshots created with the prev 'sstableloader' tool. You can upgrade the file format of your snapshots using the provided 'sstableupgrade' tool. -2.1.12 -== +2.2.4 += -New features - +Deprecation +--- +- Pig support has been deprecated, and will be removed in 3.0. + Please see CASSANDRA-10542 for more details. + +Operations +-- - Switching racks is no longer an allowed operation on a node which has - data. Instead, the node will need to be wiped and bootstrapped. If - moving from the SimpleSnitch, make sure the rack containing all current + data. Instead, the node will need to be decommissioned and rebootstrapped. + If moving from the SimpleSnitch, make sure the rack containing all current - nodes is named "rack1". To override this behavior when manually wiping - the node and bootstrapping, use -Dcassandra.ignore_rack=true. + nodes is named "rack1". -2.1.11 +2.2.3 = Upgrading http://git-wip-us.apache.org/repos/asf/cassandra/blob/12e38f7f/conf/cassandra.yaml -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/12e38f7f/src/java/org/apache/cassandra/service/CassandraDaemon.java -- diff --cc src/java/org/apache/cassandra/service/CassandraDaemon.java index 9e38e06,17553f3..45e1812 --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java @@@ -231,19 -319,6 +231,19 @@@ public class CassandraDaemo } Keyspace.setInitialized(); + +String storedRack = SystemKeyspace.getRack(); +if (storedRack != null) +{ +String currentRack = DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress()); +if (!storedRack.equals(currentRack)) +{ +logger.error("Cannot start node if snitch's rack differs from previous rack. " + - "Please fix the snitch or wipe and rebootstrap this node."); ++ "Please fix the snitch or decommission and rebootstrap this node."); +System.exit(100); +} +} + // initialize keyspaces for (String keyspaceName : Schema.instance.getKeyspaces()) {
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/20d55086 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/20d55086 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/20d55086 Branch: refs/heads/cassandra-3.0 Commit: 20d5508618e65091f9e4c277a97dab2282199f24 Parents: d3085b1 a2c4d4e Author: Sylvain Lebresne Authored: Wed Oct 21 14:32:56 2015 +0200 Committer: Sylvain Lebresne Committed: Wed Oct 21 14:32:56 2015 +0200 -- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/20d55086/CHANGES.txt -- diff --cc CHANGES.txt index 120be92,d06345e..ed28f2e --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,15 -1,11 +1,15 @@@ -2.1.12 +2.2.4 + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: - * Avoid repetition of JVM_OPTS in debian package (CASSANDRA-8821) + * Avoid repetition of JVM_OPTS in debian package (CASSANDRA-10251) * Fix potential NPE from handling result of SIM.highestSelectivityIndex (CASSANDRA-10550) - * Fix paging issues with partitions containing only static columns data - (CASSANDRA-10381) + * Fix paging issues with partitions containing only static columns data (CASSANDRA-10381) * Fix conditions on static columns (CASSANDRA-10264) * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377) - * Merge range tombstones during compaction (CASSANDRA-7953) * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d3085b1b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d3085b1b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d3085b1b Branch: refs/heads/cassandra-3.0 Commit: d3085b1baa33e9dc546aa80123e0cb1c17659073 Parents: f10d2ed 9d8436f Author: Sylvain Lebresne Authored: Wed Oct 21 14:27:46 2015 +0200 Committer: Sylvain Lebresne Committed: Wed Oct 21 14:27:46 2015 +0200 -- CHANGES.txt | 1 + debian/init | 10 -- 2 files changed, 1 insertion(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d3085b1b/CHANGES.txt -- diff --cc CHANGES.txt index 560472a,31ae1c0..120be92 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,14 -1,11 +1,15 @@@ -2.1.12 +2.2.4 + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Avoid repetition of JVM_OPTS in debian package (CASSANDRA-8821) * Fix potential NPE from handling result of SIM.highestSelectivityIndex (CASSANDRA-10550) - * Fix paging issues with partitions containing only static columns data - (CASSANDRA-10381) + * Fix paging issues with partitions containing only static columns data (CASSANDRA-10381) * Fix conditions on static columns (CASSANDRA-10264) * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377) - * Merge range tombstones during compaction (CASSANDRA-7953) * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242)
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/ccb738f8 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ccb738f8 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ccb738f8 Branch: refs/heads/cassandra-3.0 Commit: ccb738f8d333965d1b80d2b41606421d37d5f4e3 Parents: 98be5de 86583af Author: blerer Authored: Wed Oct 21 10:12:13 2015 +0200 Committer: blerer Committed: Wed Oct 21 10:12:43 2015 +0200 -- CHANGES.txt | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/ccb738f8/CHANGES.txt -- diff --cc CHANGES.txt index 458d0d5,6734f75..4f5e8a7 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -12,15 -8,10 +12,16 @@@ Merged from 2.1 * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242) * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Fix sorting for queries with an IN condition on partition key columns (CASSANDRA-10363) -2.1.11 +2.2.3 + * Avoid NoClassDefFoundError during DataDescriptor initialization on windows (CASSANDRA-10412) + * Preserve case of quoted Role & User names (CASSANDRA-10394) + * cqlsh pg-style-strings broken (CASSANDRA-10484) + * Make Hadoop CF splits more polite to custom orderered partitioners (CASSANDRA-10400) + * Fix the regression when using LIMIT with aggregates (CASSANDRA-10487) +Merged from 2.1: * Fix mmap file segment seeking to EOF (CASSANDRA-10478) * Allow LOCAL_JMX to be easily overridden (CASSANDRA-10275) * Mark nodes as dead even if they've already left (CASSANDRA-10205)
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
Merge branch cassandra-2.1 into cassandra-2.2 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/98be5de7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/98be5de7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/98be5de7 Branch: refs/heads/cassandra-3.0 Commit: 98be5de7035509fe7160917350e6c401df67d3b0 Parents: a337907 328916d Author: blerer Authored: Tue Oct 20 14:37:10 2015 +0200 Committer: blerer Committed: Tue Oct 20 14:37:10 2015 +0200 -- CHANGES.txt | 1 + .../apache/cassandra/service/pager/AbstractQueryPager.java | 6 +- .../cassandra/service/pager/RangeSliceQueryPager.java | 8 ++-- .../org/apache/cassandra/service/pager/SliceQueryPager.java | 9 +++-- 4 files changed, 19 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/98be5de7/CHANGES.txt -- diff --cc CHANGES.txt index 261a53a,dbb3480..458d0d5 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,12 -1,9 +1,13 @@@ -2.1.12 - * Fix paging issues with partitions containing only static columns data - (CASSANDRA-10381) +2.2.4 + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: ++ * Fix paging issues with partitions containing only static columns data (CASSANDRA-10381) * Fix conditions on static columns (CASSANDRA-10264) * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377) - * Merge range tombstones during compaction (CASSANDRA-7953) * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242) http://git-wip-us.apache.org/repos/asf/cassandra/blob/98be5de7/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java --
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
Merge branch cassandra-2.1 into cassandra-2.2 Conflicts: CHANGES.txt 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/a3379073 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a3379073 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a3379073 Branch: refs/heads/cassandra-3.0 Commit: a33790730a9ef0fd2ef3a6c18f00dfee013a68e3 Parents: 728f94e 9b3b1cb Author: blerer Authored: Tue Oct 20 14:06:45 2015 +0200 Committer: blerer Committed: Tue Oct 20 14:06:45 2015 +0200 -- CHANGES.txt | 1 + pylib/cqlshlib/cql3handling.py | 2 +- .../cql3/statements/ModificationStatement.java | 23 +++- .../operations/InsertUpdateIfConditionTest.java | 12 +- 4 files changed, 35 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3379073/CHANGES.txt -- diff --cc CHANGES.txt index 3eff22c,b17929c..261a53a --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,11 -1,7 +1,12 @@@ -2.1.12 +2.2.4 + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Fix conditions on static columns (CASSANDRA-10264) * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377) - * Merge range tombstones during compaction (CASSANDRA-7953) * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3379073/pylib/cqlshlib/cql3handling.py -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3379073/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3379073/test/unit/org/apache/cassandra/cql3/validation/operations/InsertUpdateIfConditionTest.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/0bfa26d6 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0bfa26d6 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0bfa26d6 Branch: refs/heads/cassandra-3.0 Commit: 0bfa26d6011b6e1c79c164a1acc29884d8157ade Parents: 289b7b7 b84ed11 Author: Robert Stupp Authored: Mon Oct 19 14:56:41 2015 +0200 Committer: Robert Stupp Committed: Mon Oct 19 14:56:41 2015 +0200 -- .../apache/cassandra/net/MessagingService.java | 24 +++- 1 file changed, 18 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/0bfa26d6/src/java/org/apache/cassandra/net/MessagingService.java -- diff --cc src/java/org/apache/cassandra/net/MessagingService.java index 2a63553,724518c..4aafdd1 --- a/src/java/org/apache/cassandra/net/MessagingService.java +++ b/src/java/org/apache/cassandra/net/MessagingService.java @@@ -1024,14 -1028,10 +1032,10 @@@ public final class MessagingService imp } catch (IOException e) { - // dirty hack for clean shutdown on OSX w/ Java >= 1.8.0_20 // see https://issues.apache.org/jira/browse/CASSANDRA-8220 - // see https://bugs.openjdk.java.net/browse/JDK-8050499 - if (!"Unknown error: 316".equals(e.getMessage()) || !"Mac OS X".equals(System.getProperty("os.name"))) - throw e; + handleIOException(e); } - -for (Closeable connection : connections) +for (Closeable connection : connections) { connection.close(); } @@@ -1043,11 -1043,19 +1047,19 @@@ } } + private static void handleIOException(IOException e) throws IOException + { + // dirty hack for clean shutdown on OSX w/ Java >= 1.8.0_20 + // see https://bugs.openjdk.java.net/browse/JDK-8050499 + if (!"Unknown error: 316".equals(e.getMessage()) || !"Mac OS X".equals(System.getProperty("os.name"))) + throw e; + } + -public Map getCommandPendingTasks() +public Map getLargeMessagePendingTasks() { -Map pendingTasks = new HashMap(); +Map pendingTasks = new HashMap(connectionManagers.size()); for (Map.Entry entry : connectionManagers.entrySet()) -pendingTasks.put(entry.getKey().getHostAddress(), entry.getValue().cmdCon.getPendingMessages()); +pendingTasks.put(entry.getKey().getHostAddress(), entry.getValue().largeMessages.getPendingMessages()); return pendingTasks; }
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/20ce2cf3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/20ce2cf3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/20ce2cf3 Branch: refs/heads/cassandra-3.0 Commit: 20ce2cf3564a113b6bcd9c4bc761dfeac37349a6 Parents: f497c13 27c8011 Author: Robert Stupp Authored: Sat Oct 17 11:38:27 2015 +0200 Committer: Robert Stupp Committed: Sat Oct 17 11:38:27 2015 +0200 -- CHANGES.txt | 1 + .../cassandra/db/commitlog/CommitLogSegmentManager.java | 12 +--- 2 files changed, 10 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/20ce2cf3/CHANGES.txt -- diff --cc CHANGES.txt index 632e262,7358689..889438f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,7 -1,6 +1,8 @@@ -2.1.12 +2.2.4 + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377) - * Merge range tombstones during compaction (CASSANDRA-7953) * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242) http://git-wip-us.apache.org/repos/asf/cassandra/blob/20ce2cf3/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java -- diff --cc src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java index f71bb1b,9310d67..2ca2fea --- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java @@@ -339,10 -346,32 +339,16 @@@ public class CommitLogSegmentManage */ void recycleSegment(final CommitLogSegment segment) { -boolean archiveSuccess = CommitLog.instance.archiver.maybeWaitForArchiving(segment.getName()); -if (!activeSegments.remove(segment)) -{ -logger.warn("segment {} not found in activeSegments queue", segment); -return; -} -if (!archiveSuccess) +boolean archiveSuccess = commitLog.archiver.maybeWaitForArchiving(segment.getName()); - activeSegments.remove(segment); - // if archiving (command) was not successful then leave the file alone. don't delete or recycle. - discardSegment(segment, archiveSuccess); ++if (activeSegments.remove(segment)) + { + // if archiving (command) was not successful then leave the file alone. don't delete or recycle. -discardSegment(segment, false); -return; ++discardSegment(segment, archiveSuccess); + } -if (isCapExceeded() || !DatabaseDescriptor.getCommitLogSegmentRecyclingEnabled()) ++else + { -discardSegment(segment, true); -return; ++logger.warn("segment {} not found in activeSegments queue", segment); + } - -logger.debug("Recycling {}", segment); -segmentManagementTasks.add(new Callable() -{ -public CommitLogSegment call() -{ -return segment.recycle(); -} -}); } /**
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/f497c13e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f497c13e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f497c13e Branch: refs/heads/cassandra-3.0 Commit: f497c13ee33cc76b7c7bd4c6d4d12caf475ca79d Parents: def5803 f587397 Author: blerer Authored: Fri Oct 16 14:44:29 2015 +0200 Committer: blerer Committed: Fri Oct 16 14:45:08 2015 +0200 -- .../org/apache/cassandra/cql3/ResultSet.java| 5 ++ .../apache/cassandra/cql3/UntypedResultSet.java | 6 +-- .../cassandra/cql3/selection/Selection.java | 57 +--- .../cassandra/cql3/selection/Selector.java | 12 + .../cql3/selection/SelectorFactories.java | 20 +++ .../cql3/selection/SimpleSelector.java | 6 +++ .../cql3/statements/SelectStatement.java| 2 +- .../operations/SelectOrderByTest.java | 52 ++ 8 files changed, 138 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f497c13e/src/java/org/apache/cassandra/cql3/ResultSet.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f497c13e/src/java/org/apache/cassandra/cql3/UntypedResultSet.java -- diff --cc src/java/org/apache/cassandra/cql3/UntypedResultSet.java index 49e0d86,a0b6ae7..e8d610d --- a/src/java/org/apache/cassandra/cql3/UntypedResultSet.java +++ b/src/java/org/apache/cassandra/cql3/UntypedResultSet.java @@@ -73,9 -74,9 +73,9 @@@ public abstract class UntypedResultSet public Row one() { -if (cqlRows.rows.size() != 1) -throw new IllegalStateException("One row required, " + cqlRows.rows.size() + " found"); +if (cqlRows.size() != 1) +throw new IllegalStateException("One row required, " + cqlRows.size() + " found"); - return new Row(cqlRows.metadata.names, cqlRows.rows.get(0)); + return new Row(cqlRows.metadata.requestNames(), cqlRows.rows.get(0)); } public Iterator iterator() http://git-wip-us.apache.org/repos/asf/cassandra/blob/f497c13e/src/java/org/apache/cassandra/cql3/selection/Selection.java -- diff --cc src/java/org/apache/cassandra/cql3/selection/Selection.java index 13e030f,000..f6925b2 mode 100644,00..100644 --- a/src/java/org/apache/cassandra/cql3/selection/Selection.java +++ b/src/java/org/apache/cassandra/cql3/selection/Selection.java @@@ -1,545 -1,0 +1,566 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.cql3.selection; + +import java.nio.ByteBuffer; +import java.util.*; + +import com.google.common.base.Objects; +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; +import com.google.common.collect.Iterators; + +import org.apache.cassandra.config.CFMetaData; +import org.apache.cassandra.config.ColumnDefinition; +import org.apache.cassandra.cql3.*; +import org.apache.cassandra.cql3.functions.Function; +import org.apache.cassandra.db.Cell; +import org.apache.cassandra.db.CounterCell; +import org.apache.cassandra.db.ExpiringCell; +import org.apache.cassandra.db.context.CounterContext; +import org.apache.cassandra.db.marshal.UTF8Type; +import org.apache.cassandra.exceptions.InvalidRequestException; +import org.apache.cassandra.utils.ByteBufferUtil; + +public abstract class Selection +{ +/** + * A predicate that returns true for static columns. + */ +private static final Predicate STATIC_COLUMN_FILTER = new Predicate() +{ +public boolean apply(ColumnDefinition def) +{ +return def.isStatic(); +} +}; + +private final CFMetaData cfm; +private
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/94a7d068 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/94a7d068 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/94a7d068 Branch: refs/heads/cassandra-3.0 Commit: 94a7d0682e037c8fb4226a1c5f1f47918912f2e2 Parents: 3b7ccdf 806378c Author: blerer Authored: Fri Oct 16 11:52:51 2015 +0200 Committer: blerer Committed: Fri Oct 16 11:53:52 2015 +0200 -- pylib/cqlshlib/cql3handling.py | 8 +- pylib/cqlshlib/cqlhandling.py| 10 + pylib/cqlshlib/test/run_cqlsh.py | 2 +- pylib/cqlshlib/test/test_cql_parsing.py | 240 +++--- pylib/cqlshlib/test/test_cqlsh_completion.py | 10 +- pylib/cqlshlib/test/test_cqlsh_output.py | 9 +- 6 files changed, 145 insertions(+), 134 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/94a7d068/pylib/cqlshlib/cql3handling.py -- diff --cc pylib/cqlshlib/cql3handling.py index 40b7d6b,5f93003..0ee0a38 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@@ -166,10 -162,10 +166,14 @@@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n | | | -- | ++ | | "NULL" ; ++ ::= ( ( "." )?) ++ | "TOKEN" ++ ; ++ ::= "(" ( ( "," )* )? ")" ; @@@ -1391,21 -1227,6 +1395,21 @@@ def username_name_completer(ctxt, cass) session = cass.session return [maybe_quote(row.values()[0].replace("'", "''")) for row in session.execute("LIST USERS")] + +@completer_for('rolename', 'role') +def rolename_completer(ctxt, cass): +def maybe_quote(name): +if CqlRuleSet.is_valid_cql3_name(name): +return name +return "'%s'" % name + +# disable completion for CREATE ROLE. - if ctxt.matched[0][0] == 'K_CREATE': ++if ctxt.matched[0][1].upper() == 'CREATE': +return [Hint('')] + +session = cass.session +return [maybe_quote(row[0].replace("'", "''")) for row in session.execute("LIST ROLES")] + syntax_rules += r''' ::= "CREATE" "TRIGGER" ( "IF" "NOT" "EXISTS" )? "ON" cf= "USING" class= http://git-wip-us.apache.org/repos/asf/cassandra/blob/94a7d068/pylib/cqlshlib/cqlhandling.py -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/94a7d068/pylib/cqlshlib/test/run_cqlsh.py -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/94a7d068/pylib/cqlshlib/test/test_cql_parsing.py -- diff --cc pylib/cqlshlib/test/test_cql_parsing.py index c011d94,f88b839..ad60c9b --- a/pylib/cqlshlib/test/test_cql_parsing.py +++ b/pylib/cqlshlib/test/test_cql_parsing.py @@@ -17,558 -17,60 +17,558 @@@ # to configure behavior, define $CQL_TEST_HOST to the destination address # for Thrift connections, and $CQL_TEST_PORT to the associated port. -from .basecase import BaseTestCase, cqlsh -from .cassconnect import get_test_keyspace, testrun_cqlsh, testcall_cqlsh +from unittest import TestCase +from operator import itemgetter -class TestCqlParsing(BaseTestCase): -def setUp(self): -self.cqlsh_runner = testrun_cqlsh(cqlver=cqlsh.DEFAULT_CQLVER, env={'COLUMNS': '10'}) -self.cqlsh = self.cqlsh_runner.__enter__() +from ..cql3handling import CqlRuleSet -def tearDown(self): -pass +class TestCqlParsing(TestCase): def test_parse_string_literals(self): -pass +for n in ["'eggs'", "'Sausage 1'", "'spam\nspam\n\tsausage'", "''"]: +self.assertSequenceEqual(tokens_with_types(CqlRuleSet.lex(n)), + [(n, 'quotedStringLiteral')]) +self.assertSequenceEqual(tokens_with_types(CqlRuleSet.lex("'eggs'")), + [("'eggs'", 'quotedStringLiteral')]) + +tokens = CqlRuleSet.lex("'spam\nspam\n\tsausage'") +tokens = CqlRuleSet.cql_massage_tokens(tokens) +self.assertEqual(tokens[0][0], "quotedStringLiteral") + +tokens = CqlRuleSet.lex("'spam\nspam\n") +tokens = CqlRuleSet.cql_massage_tokens(tokens) +self.assertEqual(tokens[0][0], "unclosedString") + +tokens = CqlRuleSet.lex("'foo bar' 'spam\nspam\n") +tokens = CqlRuleSet.cql_massage_tokens(tokens) +self.assertEqual(tokens[1][0], "unclosedString") + +def test_parse_pgstring_literals(self): +for n in [
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3b7ccdfb Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3b7ccdfb Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3b7ccdfb Branch: refs/heads/cassandra-3.0 Commit: 3b7ccdfb15b43880804d61a5e7d62c82b3b664eb Parents: bee48eb a61fc01 Author: Marcus Eriksson Authored: Thu Oct 15 15:33:29 2015 +0200 Committer: Marcus Eriksson Committed: Thu Oct 15 15:33:29 2015 +0200 -- .../org/apache/cassandra/db/ColumnIndex.java| 32 +++-- .../org/apache/cassandra/db/RangeTombstone.java | 135 ++- .../cassandra/cql3/RangeTombstoneMergeTest.java | 125 + 3 files changed, 217 insertions(+), 75 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3b7ccdfb/src/java/org/apache/cassandra/db/RangeTombstone.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3b7ccdfb/test/unit/org/apache/cassandra/cql3/RangeTombstoneMergeTest.java -- diff --cc test/unit/org/apache/cassandra/cql3/RangeTombstoneMergeTest.java index 000,0460a16..71634e9 mode 00,100644..100644 --- a/test/unit/org/apache/cassandra/cql3/RangeTombstoneMergeTest.java +++ b/test/unit/org/apache/cassandra/cql3/RangeTombstoneMergeTest.java @@@ -1,0 -1,125 +1,125 @@@ + /* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package org.apache.cassandra.cql3; + + import static org.junit.Assert.assertEquals; + import static org.junit.Assert.assertTrue; + + import com.google.common.collect.Iterables; + + import org.junit.Before; + import org.junit.Test; + + import org.apache.cassandra.Util; + import org.apache.cassandra.db.*; + import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; + import org.apache.cassandra.db.composites.*; ++import org.apache.cassandra.io.sstable.format.SSTableReader; + import org.apache.cassandra.io.sstable.ISSTableScanner; -import org.apache.cassandra.io.sstable.SSTableReader; + + public class RangeTombstoneMergeTest extends CQLTester + { + @Before + public void before() throws Throwable + { + createTable("CREATE TABLE %s(" + + " key text," + + " column text," + + " data text," + + " extra text," + + " PRIMARY KEY(key, column)" + + ");"); + + // If the sstable only contains tombstones during compaction it seems that the sstable either gets removed or isn't created (but that could probably be a separate JIRA issue). + execute("INSERT INTO %s (key, column, data) VALUES (?, ?, ?)", "1", "1", "1"); + } + + @Test + public void testEqualMerge() throws Throwable + { + addRemoveAndFlush(); + + for (int i=0; i<3; ++i) + { + addRemoveAndFlush(); + compact(); + } + + assertOneTombstone(); + } + + @Test + public void testRangeMerge() throws Throwable + { + addRemoveAndFlush(); + + execute("INSERT INTO %s (key, column, data, extra) VALUES (?, ?, ?, ?)", "1", "2", "2", "2"); + execute("DELETE extra FROM %s WHERE key=? AND column=?", "1", "2"); + + flush(); + compact(); + + execute("DELETE FROM %s WHERE key=? AND column=?", "1", "2"); + + flush(); + compact(); + + assertOneTombstone(); + } + + void assertOneTombstone() throws Throwable + { + assertRows(execute("SELECT column FROM %s"), +row("1")); + assertAllRows(row("1", "1", "1", null)); + + ColumnFamilyStore cfs = Keyspace.open(KEYSPACE).getColumnFamilyStore(currentTable()); + ColumnFamily cf = cfs.getColumnFamily(Util.dk("1"), Composites.EMPTY, Composites.EMPTY, false, 100, Syst
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/25366f7d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/25366f7d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/25366f7d Branch: refs/heads/cassandra-3.0 Commit: 25366f7d441358b8e25604e1831056470876b3b3 Parents: 8a94432 02f88e3 Author: Tyler Hobbs Authored: Wed Oct 14 11:19:35 2015 -0500 Committer: Tyler Hobbs Committed: Wed Oct 14 11:19:35 2015 -0500 -- CHANGES.txt | 1 + pylib/cqlshlib/formatting.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/25366f7d/CHANGES.txt -- diff --cc CHANGES.txt index 4da4aab,b16acb5..c02e2fa --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,5 -1,5 +1,6 @@@ -2.1.12 +2.2.4 +Merged from 2.1: + * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242) * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) http://git-wip-us.apache.org/repos/asf/cassandra/blob/25366f7d/pylib/cqlshlib/formatting.py -- diff --cc pylib/cqlshlib/formatting.py index c26e20c,79e661b..e95df9f --- a/pylib/cqlshlib/formatting.py +++ b/pylib/cqlshlib/formatting.py @@@ -175,9 -156,9 +175,9 @@@ def format_floating_point_type(val, col if math.isnan(val): bval = 'NaN' elif math.isinf(val): - bval = 'Infinity' + bval = 'Infinity' if val > 0 else '-Infinity' else: -exponent = int(math.log10(abs(val))) if abs(val) > sys.float_info.epsilon else -sys.maxint - 1 +exponent = int(math.log10(abs(val))) if abs(val) > sys.float_info.epsilon else -sys.maxsize - 1 if -4 <= exponent < float_precision: # when this is true %g will not use scientific notation, # increasing precision should not change this decision
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/8a94432d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8a94432d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8a94432d Branch: refs/heads/cassandra-3.0 Commit: 8a94432d5ec2fcac45026952d17b0780376e2a2e Parents: 50da872 bc1058f Author: Aleksey Yeschenko Authored: Wed Oct 14 16:56:34 2015 +0100 Committer: Aleksey Yeschenko Committed: Wed Oct 14 16:56:34 2015 +0100 -- src/java/org/apache/cassandra/service/StorageProxy.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a94432d/src/java/org/apache/cassandra/service/StorageProxy.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/50da872f/bin/cqlsh.py -- diff --cc bin/cqlsh.py index 6f3f816,000..a15fb02 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2735 -1,0 +1,2740 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster, PagedResult +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, FormattedValue, colorme) +from cqlshlib.formatting import (DEFAULT_DATE_FORMAT, DEFAULT_NANOTIME_FORMAT, +
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/7cab3272 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7cab3272 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7cab3272 Branch: refs/heads/cassandra-3.0 Commit: 7cab3272455bdd16b639c510416ae339a8613414 Parents: 751e4f9 711870e Author: Aleksey Yeschenko Authored: Wed Oct 14 15:54:25 2015 +0100 Committer: Aleksey Yeschenko Committed: Wed Oct 14 15:54:25 2015 +0100 -- CHANGES.txt | 1 + NEWS.txt | 12 conf/cassandra-rackdc.properties | 4 ++-- conf/cassandra.yaml | 3 +++ src/java/org/apache/cassandra/db/SystemKeyspace.java | 15 +++ .../apache/cassandra/service/CassandraDaemon.java| 13 + 6 files changed, 46 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/7cab3272/CHANGES.txt -- diff --cc CHANGES.txt index 6aa16bc,9a82780..57c6ff9 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,5 -1,5 +1,6 @@@ -2.1.12 +2.2.4 +Merged from 2.1: + * Don't allow startup if the node's rack has changed (CASSANDRA-10242) * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) http://git-wip-us.apache.org/repos/asf/cassandra/blob/7cab3272/NEWS.txt -- diff --cc NEWS.txt index f9fbe43,fadd541..a235a1d --- a/NEWS.txt +++ b/NEWS.txt @@@ -13,160 -13,27 +13,172 @@@ restore snapshots created with the prev 'sstableloader' tool. You can upgrade the file format of your snapshots using the provided 'sstableupgrade' tool. -2.1.12 -== ++2.2.4 ++= + -New features - ++Operations ++-- + - Switching racks is no longer an allowed operation on a node which has + data. Instead, the node will need to be wiped and bootstrapped. If + moving from the SimpleSnitch, make sure the rack containing all current - nodes is named "rack1". To override this behavior when manually wiping - the node and bootstrapping, use -Dcassandra.ignore_rack=true. ++ nodes is named "rack1". + + -2.1.11 +2.2.3 = Upgrading - -- Nothing specific to this release, but please see 2.1 if you are upgrading +- Nothing specific to this release, but please see 2.2 if you are upgrading from a previous version. + +2.2.2 += + +Upgrading +- +- Version 1 and 2 of the native protocol are now deprecated and support + will be removed in Cassandra 3.0. You are encouraged to upgrade to a + client driver using version 3 of the native protocol. + +Changed Defaults + + - commitlog_total_space_in_mb will use the smaller of 8192, and 1/4 + of the total space of the commitlog volume. (Before: always used + 8192) + - Incremental repair is on by default since 2.2.0, run full repairs by + providing the '-full' parameter to nodetool repair. + - Parallel repairs are the default since 2.2.0, run sequential repairs + by providing the '-seq' parameter to nodetool repair. + - The following INFO logs were reduced to DEBUG level and will now show + on debug.log instead of system.log: + - Memtable flushing actions + - Commit log replayed files + - Compacted sstables + - SStable opening (SSTableReader) + +New features + + - Custom QueryHandlers can retrieve the column specifications for the bound + variables from QueryOptions by using the hasColumnSpecifications() + and getColumnSpecifications() methods. + - A new default assynchronous log appender debug.log was created in addition + to the system.log appender in order to provide more detailed log debugging. + In order to disable debug logging, you must comment-out the ASYNCDEBUGLOG + appender on conf/logback.xml. See CASSANDRA-10241 for more information. + + +2.2.1 += + +Upgrading +- +- Nothing specific to this release, but please see 2.2 if you are upgrading + from a previous version. + +New features + + - COUNT(*) and COUNT(1) can be selected with other columns or functions + + +2.2 +=== + +New features + + - The LIMIT clause applies now only to the number of rows returned to the user, + not to the number of row queried. By consequence, queries using aggregates will not + be impacted by the LIMIT clause anymore. + - Very large batches will now be rejected (defaults to 50kb). Thi
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/751e4f9e/bin/cqlsh.py -- diff --cc bin/cqlsh.py index 55f7ee9,000..6f3f816 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2732 -1,0 +1,2735 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster, PagedResult +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, FormattedValue, colorme) +from cqlshlib.formatting import (DEFAULT_DATE_FORMAT, DEFAULT_NANOTIME_FORMAT, +
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/89596682/bin/cqlsh.py -- diff --cc bin/cqlsh.py index e2691cc,000..55f7ee9 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2735 -1,0 +1,2732 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement + +import cmd +import codecs +import ConfigParser +import csv +import getpass +import locale +import multiprocessing +import optparse +import os +import platform +import sys +import time +import traceback +import warnings +from contextlib import contextmanager +from functools import partial +from glob import glob +from StringIO import StringIO +from uuid import UUID + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.auth import PlainTextAuthProvider +from cassandra.cluster import Cluster, PagedResult +from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata, +TableMetadata, protect_name, protect_names, +protect_value) +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.query import SimpleStatement, ordered_dict_factory + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling +from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, + RED, FormattedValue, colorme) +from cqlshlib.formatting import (DEFAULT_DATE_FORMAT, DEFAULT_NANOTIME_FORMAT, +
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/45ade6e3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/45ade6e3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/45ade6e3 Branch: refs/heads/cassandra-2.2 Commit: 45ade6e36be865bdd0ef07fce9552432376c4f25 Parents: 83b9740 df6b27e Author: T Jake Luciani Authored: Mon Oct 12 09:47:54 2015 -0400 Committer: T Jake Luciani Committed: Mon Oct 12 09:47:54 2015 -0400 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/757dac9c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/757dac9c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/757dac9c Branch: refs/heads/cassandra-2.2 Commit: 757dac9c0ed441024f281d6510c36932210bf962 Parents: 82dabe0 94b6471 Author: Sylvain Lebresne Authored: Fri Oct 9 14:01:54 2015 +0200 Committer: Sylvain Lebresne Committed: Fri Oct 9 14:01:54 2015 +0200 -- .../org/apache/cassandra/db/KeyCacheTest.java | 55 1 file changed, 55 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/757dac9c/test/unit/org/apache/cassandra/db/KeyCacheTest.java -- diff --cc test/unit/org/apache/cassandra/db/KeyCacheTest.java index 4188d97,d3328f1..9a98bde --- a/test/unit/org/apache/cassandra/db/KeyCacheTest.java +++ b/test/unit/org/apache/cassandra/db/KeyCacheTest.java @@@ -17,24 -17,23 +17,27 @@@ */ package org.apache.cassandra.db; + import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; + import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.Uninterruptibles; import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import org.apache.cassandra.SchemaLoader; import org.apache.cassandra.Util; import org.apache.cassandra.cache.KeyCacheKey; +import org.apache.cassandra.config.DatabaseDescriptor; +import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.concurrent.ScheduledExecutors; + import org.apache.cassandra.db.compaction.OperationType; import org.apache.cassandra.db.composites.*; import org.apache.cassandra.db.compaction.CompactionManager; import org.apache.cassandra.db.filter.QueryFilter; @@@ -47,23 -44,14 +50,25 @@@ import org.apache.cassandra.utils.ByteB import org.apache.cassandra.utils.concurrent.Refs; import static org.junit.Assert.assertEquals; -public class KeyCacheTest extends SchemaLoader +public class KeyCacheTest { -private static final String KEYSPACE1 = "KeyCacheSpace"; +private static final String KEYSPACE1 = "KeyCacheTest1"; private static final String COLUMN_FAMILY1 = "Standard1"; private static final String COLUMN_FAMILY2 = "Standard2"; + private static final String COLUMN_FAMILY3 = "Standard3"; + +@BeforeClass +public static void defineSchema() throws ConfigurationException +{ +SchemaLoader.prepareServer(); +SchemaLoader.createKeyspace(KEYSPACE1, +SimpleStrategy.class, +KSMetaData.optsWithRF(1), +SchemaLoader.standardCFMD(KEYSPACE1, COLUMN_FAMILY1), +SchemaLoader.standardCFMD(KEYSPACE1, COLUMN_FAMILY2)); +} + @AfterClass public static void cleanup() {
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/82dabe0c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/82dabe0c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/82dabe0c Branch: refs/heads/cassandra-3.0 Commit: 82dabe0cf59ea3b9917ded46fe1c6caf6314d782 Parents: 87fa9be ad93f3b Author: Robert Stupp Authored: Fri Oct 9 13:10:01 2015 +0200 Committer: Robert Stupp Committed: Fri Oct 9 13:10:01 2015 +0200 -- CHANGES.txt | 3 ++- conf/cassandra-env.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/82dabe0c/CHANGES.txt -- diff --cc CHANGES.txt index 4e64134,7aa5eac..d57cc07 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,23 -1,9 +1,24 @@@ -2.1.11 +2.2.3 + * cqlsh pg-style-strings broken (CASSANDRA-10484) + * Make Hadoop CF splits more polite to custom orderered partitioners (CASSANDRA-10400) +Merged from 2.1: + * Allow LOCAL_JMX to be easily overridden (CASSANDRA-10275) + * Mark nodes as dead even if they've already left (CASSANDRA-10205) * Update internal python driver used by cqlsh (CASSANDRA-10161) -2.1.10 +2.2.2 + * cqlsh prompt includes name of keyspace after failed `use` statement (CASSANDRA-10369) + * Configurable page size in cqlsh (CASSANDRA-9855) + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: - * Mark nodes as dead even if they've already left (CASSANDRA-10205) * Bulk Loader API could not tolerate even node failure (CASSANDRA-10347) * Avoid misleading pushed notifications when multiple nodes share an rpc_address (CASSANDRA-10052) http://git-wip-us.apache.org/repos/asf/cassandra/blob/82dabe0c/conf/cassandra-env.sh --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/be89dae3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/be89dae3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/be89dae3 Branch: refs/heads/cassandra-3.0 Commit: be89dae3ecfd98b2170732c45d7f95807d5c19af Parents: 1c073e7 1b08cbd Author: T Jake Luciani Authored: Wed Oct 7 10:13:40 2015 -0400 Committer: T Jake Luciani Committed: Wed Oct 7 10:13:40 2015 -0400 -- CHANGES.txt | 3 ++- ...assandra-driver-internal-only-2.6.0c2.post.zip | Bin 198346 -> 0 bytes lib/cassandra-driver-internal-only-2.7.2.zip | Bin 0 -> 229600 bytes 3 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/be89dae3/CHANGES.txt -- diff --cc CHANGES.txt index 47fa4c2,d678efe..82ee94d --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,20 -1,7 +1,21 @@@ -2.1.11 +2.2.3 + * Make Hadoop CF splits more polite to custom orderered partitioners (CASSANDRA-10400) - ++Merged from 2.1: + * Update internal python driver used by cqlsh (CASSANDRA-10161) -2.1.10 +2.2.2 + * cqlsh prompt includes name of keyspace after failed `use` statement (CASSANDRA-10369) + * Configurable page size in cqlsh (CASSANDRA-9855) + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: * Bulk Loader API could not tolerate even node failure (CASSANDRA-10347) * Avoid misleading pushed notifications when multiple nodes share an rpc_address (CASSANDRA-10052)
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/05183725 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/05183725 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/05183725 Branch: refs/heads/cassandra-2.2 Commit: 051837253624926104932b4fd9f14218e8851ed7 Parents: 74bc1cc 78f2e7a Author: T Jake Luciani Authored: Thu Oct 1 09:37:06 2015 -0400 Committer: T Jake Luciani Committed: Thu Oct 1 09:37:06 2015 -0400 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/74bc1cc7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/74bc1cc7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/74bc1cc7 Branch: refs/heads/cassandra-3.0 Commit: 74bc1cc7dd1213d4176cd914274f706342287141 Parents: 8123b3b 92c5787 Author: T Jake Luciani Authored: Thu Oct 1 09:10:37 2015 -0400 Committer: T Jake Luciani Committed: Thu Oct 1 09:10:37 2015 -0400 -- src/java/org/apache/cassandra/service/StorageService.java | 5 + src/java/org/apache/cassandra/service/StorageServiceMBean.java | 4 2 files changed, 9 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/74bc1cc7/src/java/org/apache/cassandra/service/StorageService.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/74bc1cc7/src/java/org/apache/cassandra/service/StorageServiceMBean.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/8123b3b0 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8123b3b0 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8123b3b0 Branch: refs/heads/cassandra-3.0 Commit: 8123b3b07dbeee3628d98447651724c731e1170b Parents: 25de92e 31fc6d2 Author: Robert Stupp Authored: Thu Oct 1 14:16:40 2015 +0200 Committer: Robert Stupp Committed: Thu Oct 1 14:16:40 2015 +0200 -- CHANGES.txt | 1 + .../hadoop/cql3/CqlBulkOutputFormat.java| 32 .../hadoop/cql3/CqlBulkRecordWriter.java| 13 +++- 3 files changed, 45 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/8123b3b0/CHANGES.txt -- diff --cc CHANGES.txt index 45070b2,eec8161..9c70c74 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,16 -1,5 +1,17 @@@ -2.1.10 +2.2.2 + * cqlsh prompt includes name of keyspace after failed `use` statement (CASSANDRA-10369) + * Configurable page size in cqlsh (CASSANDRA-9855) + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: + * Bulk Loader API could not tolerate even node failure (CASSANDRA-10347) * Avoid misleading pushed notifications when multiple nodes share an rpc_address (CASSANDRA-10052) * Fix dropping undroppable when message queue is full (CASSANDRA-10113) http://git-wip-us.apache.org/repos/asf/cassandra/blob/8123b3b0/src/java/org/apache/cassandra/hadoop/cql3/CqlBulkOutputFormat.java -- diff --cc src/java/org/apache/cassandra/hadoop/cql3/CqlBulkOutputFormat.java index 3899f8c,7fedb41..051447c --- a/src/java/org/apache/cassandra/hadoop/cql3/CqlBulkOutputFormat.java +++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlBulkOutputFormat.java @@@ -20,10 -20,11 +20,11 @@@ package org.apache.cassandra.hadoop.cql import java.io.IOException; import java.nio.ByteBuffer; ++import java.util.Collection; import java.util.List; -import org.apache.cassandra.config.EncryptionOptions; -import org.apache.cassandra.hadoop.AbstractBulkOutputFormat; import org.apache.cassandra.hadoop.ConfigHelper; +import org.apache.cassandra.hadoop.HadoopCompat; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.mapred.JobConf; @@@ -79,99 -85,124 +80,130 @@@ public class CqlBulkOutputFormat extend { return new CqlBulkRecordWriter(context); } - -public static void setColumnFamilySchema(Configuration conf, String columnFamily, String schema) -{ -conf.set(OUTPUT_CQL_SCHEMA_PREFIX + columnFamily, schema); -} -public static void setColumnFamilyInsertStatement(Configuration conf, String columnFamily, String insertStatement) +@Override +public void checkOutputSpecs(JobContext context) { -conf.set(OUTPUT_CQL_INSERT_PREFIX + columnFamily, insertStatement); +checkOutputSpecs(HadoopCompat.getConfiguration(context)); } -public static void setStoragePort(Configuration conf, int port) +private void checkOutputSpecs(Configuration conf) { -conf.set(OUTPUT_CQL_STORAGE_PORT, "" + port); +if (ConfigHelper.getOutputKeyspace(conf) == null) +{ +throw new UnsupportedOperationException("you must set the keyspace with setTable()"); +} } -public static void setSSLStoragePort(Configuration conf, int port) +/** Fills the deprecated OutputFormat interface for streaming. */ +@Deprecated +public void checkOutputSpecs(org.apache.hadoop.fs.FileSystem filesystem, org.apache.hadoop.mapred.JobConf job) throws IOException { -conf.set(OUTPUT_CQL_SSL_STORAGE_PORT, "" + port); +checkOutputSpecs(job); } -public static void setInternodeEncryption(Configuration conf, String encrypt) +@Override +public OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException, InterruptedException { -conf.set(INTERNODE_ENCR
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/7452b205 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7452b205 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7452b205 Branch: refs/heads/cassandra-3.0 Commit: 7452b20503c376c9ea15fdfac8da0c78381b3f73 Parents: fc67545 f6cab37 Author: Tyler Hobbs Authored: Wed Sep 30 10:49:42 2015 -0500 Committer: Tyler Hobbs Committed: Wed Sep 30 10:49:42 2015 -0500 -- CHANGES.txt | 2 + .../org/apache/cassandra/transport/Event.java | 29 +--- .../org/apache/cassandra/transport/Server.java | 71 +--- 3 files changed, 70 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/7452b205/CHANGES.txt -- diff --cc CHANGES.txt index c36c6f5,0ad2b36..45070b2 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,16 -1,6 +1,18 @@@ -2.1.10 +2.2.2 + * cqlsh prompt includes name of keyspace after failed `use` statement (CASSANDRA-10369) + * Configurable page size in cqlsh (CASSANDRA-9855) + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: + * Avoid misleading pushed notifications when multiple nodes +share an rpc_address (CASSANDRA-10052) * Fix dropping undroppable when message queue is full (CASSANDRA-10113) * Fix potential ClassCastException during paging (CASSANDRA-10352) * Prevent ALTER TYPE from creating circular references (CASSANDRA-10339) http://git-wip-us.apache.org/repos/asf/cassandra/blob/7452b205/src/java/org/apache/cassandra/transport/Event.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/7452b205/src/java/org/apache/cassandra/transport/Server.java -- diff --cc src/java/org/apache/cassandra/transport/Server.java index 72a1b60,c21a669..d610bff --- a/src/java/org/apache/cassandra/transport/Server.java +++ b/src/java/org/apache/cassandra/transport/Server.java @@@ -55,6 -50,12 +55,7 @@@ import org.apache.cassandra.metrics.Cli import org.apache.cassandra.security.SSLFactory; import org.apache.cassandra.service.*; import org.apache.cassandra.transport.messages.EventMessage; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.*; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.group.DefaultChannelGroup; -import io.netty.handler.ssl.SslHandler; + import org.apache.cassandra.utils.FBUtilities; public class Server implements CassandraDaemon.Server { @@@ -409,9 -382,28 +410,31 @@@ } } + private void send(InetAddress endpoint, Event.NodeEvent event) + { ++if (logger.isTraceEnabled()) ++logger.trace("Sending event for endpoint {}, rpc address {}", endpoint, event.nodeAddress()); ++ + // If the endpoint is not the local node, extract the node address + // and if it is the same as our own RPC broadcast address (which defaults to the rcp address) + // then don't send the notification. This covers the case of rpc_address set to "localhost", + // which is not useful to any driver and in fact may cauase serious problems to some drivers, + // see CASSANDRA-10052 + if (!endpoint.equals(FBUtilities.getBroadcastAddress()) && + event.nodeAddress().equals(DatabaseDescriptor.getBroadcastRpcAddress())) + return; + + send(event); + } + + private void send(Event event) + { + server.connectionTracker.send(event); + } + public void onJoinCluster(InetAddress endpoint) { -send(endpoint, Event.TopologyChange.newNode(getRpcAddress(endpoint), server.socket.getPort())); +onTopologyChange(endpoint, Event.TopologyChange.newNode(getRpcAddress(endpoint), server.socket.getPort())); } public void onLeaveCluster(InetAddress endpoint) @@@ -431,35 -425,9 +454,35 @@@ public void onDown(Ine
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/1de63e95 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1de63e95 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1de63e95 Branch: refs/heads/cassandra-3.0 Commit: 1de63e9516a672780192588f7cc6dc228c5b9b79 Parents: 93745c0 98c4a7c Author: Robert Stupp Authored: Fri Sep 18 09:48:53 2015 +0200 Committer: Robert Stupp Committed: Fri Sep 18 09:48:53 2015 +0200 -- CHANGES.txt | 1 + .../cql3/statements/AlterTypeStatement.java | 6 ++- .../cassandra/db/marshal/AbstractType.java | 8 .../cassandra/db/marshal/CompositeType.java | 11 + .../apache/cassandra/db/marshal/ListType.java | 6 +++ .../apache/cassandra/db/marshal/MapType.java| 6 +++ .../cassandra/db/marshal/ReversedType.java | 5 ++ .../apache/cassandra/db/marshal/SetType.java| 6 +++ .../apache/cassandra/db/marshal/TupleType.java | 11 + .../cql3/validation/entities/UserTypesTest.java | 49 10 files changed, 108 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/CHANGES.txt -- diff --cc CHANGES.txt index 59a50a5,166106d..97858c5 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,14 -1,5 +1,15 @@@ -2.1.10 +2.2.2 + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: + * Prevent ALTER TYPE from creating circular references (CASSANDRA-10339) * Fix cache handling of 2i and base tables (CASSANDRA-10155, 10359) * Fix NPE in nodetool compactionhistory (CASSANDRA-9758) * (Pig) support BulkOutputFormat as a URL parameter (CASSANDRA-7410) http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/src/java/org/apache/cassandra/db/marshal/AbstractType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/src/java/org/apache/cassandra/db/marshal/CompositeType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/src/java/org/apache/cassandra/db/marshal/ListType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/src/java/org/apache/cassandra/db/marshal/MapType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/src/java/org/apache/cassandra/db/marshal/ReversedType.java -- diff --cc src/java/org/apache/cassandra/db/marshal/ReversedType.java index 2aea3cd,0389a32..68a7e02 --- a/src/java/org/apache/cassandra/db/marshal/ReversedType.java +++ b/src/java/org/apache/cassandra/db/marshal/ReversedType.java @@@ -128,13 -109,12 +128,18 @@@ public class ReversedType extends Ab return baseType.getSerializer(); } + public boolean references(AbstractType check) + { + return super.references(check) || baseType.references(check); + } + @Override +public boolean isReversed() +{ +return true; +} + +@Override public String toString() { return getClass().getName() + "(" + baseType + ")"; http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/src/java/org/apache/cassandra/db/marshal/SetType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/src/java/org/apache/cassandra/db/marshal/TupleType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1de63e95/test/unit/org/apache/cassandra/cql3/validation/entities/UserTypesTest.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/93745c05 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/93745c05 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/93745c05 Branch: refs/heads/cassandra-3.0 Commit: 93745c05c7dd7ad841d6f5dc79f2140891ca75a0 Parents: eecfb07 0b8b67b Author: Robert Stupp Authored: Thu Sep 17 23:23:35 2015 +0200 Committer: Robert Stupp Committed: Thu Sep 17 23:23:35 2015 +0200 -- CHANGES.txt | 2 +- .../apache/cassandra/cache/AutoSavingCache.java | 50 ++-- .../apache/cassandra/cql3/KeyCacheCqlTest.java | 1 + 3 files changed, 37 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/93745c05/CHANGES.txt -- diff --cc CHANGES.txt index f9314f6,e2dd83a..59a50a5 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,15 -1,5 +1,15 @@@ -2.1.10 +2.2.2 + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: - * Fix cache handling of 2i and base tables (CASSANDRA-10155) + * Fix cache handling of 2i and base tables (CASSANDRA-10155, 10359) * Fix NPE in nodetool compactionhistory (CASSANDRA-9758) * (Pig) support BulkOutputFormat as a URL parameter (CASSANDRA-7410) * BATCH statement is broken in cqlsh (CASSANDRA-10272) http://git-wip-us.apache.org/repos/asf/cassandra/blob/93745c05/src/java/org/apache/cassandra/cache/AutoSavingCache.java -- diff --cc src/java/org/apache/cassandra/cache/AutoSavingCache.java index 3ec9d4e,1174c44..48d60b7 --- a/src/java/org/apache/cassandra/cache/AutoSavingCache.java +++ b/src/java/org/apache/cassandra/cache/AutoSavingCache.java @@@ -184,9 -176,19 +184,18 @@@ public class AutoSavingCache>> futures = new ArrayDeque>>(); - while (in.available() > 0) { //ksname and cfname are serialized by the serializers in CacheService @@@ -335,27 -322,34 +344,38 @@@ throw new RuntimeException(e); } - while (keyIterator.hasNext()) + try { - K key = keyIterator.next(); - - ColumnFamilyStore cfs = Schema.instance.getColumnFamilyStoreIncludingIndexes(key.ksAndCFName); - if (cfs == null) - continue; // the table or 2i has been dropped. - - try + //Need to be able to check schema version because CF names are ambiguous + UUID schemaVersion = Schema.instance.getVersion(); + if (schemaVersion == null) { - cacheLoader.serialize(key, writer, cfs); + Schema.instance.updateVersion(); + schemaVersion = Schema.instance.getVersion(); } - catch (IOException e) + writer.writeLong(schemaVersion.getMostSignificantBits()); + writer.writeLong(schemaVersion.getLeastSignificantBits()); + -for (K key : keys) ++while (keyIterator.hasNext()) { - throw new FSWriteError(e, cacheFilePaths.left); - } ++K key = keyIterator.next(); - keysWritten++; - if (keysWritten >= keysEstimate) - break; + ColumnFamilyStore cfs = Schema.instance.getColumnFamilyStoreIncludingIndexes(key.ksAndCFName); + if (cfs == null) + continue; // the table or 2i has been dropped. + + cacheLoader.serialize(key, writer, cfs); + + keysWritten++; ++if (keysWritten >= keysEstimate) ++break; + } } + catch (IOException e) + { -throw n
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/cd4a1e6a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cd4a1e6a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cd4a1e6a Branch: refs/heads/cassandra-3.0 Commit: cd4a1e6acc51b0f708127a50d37dd7832bbe8dfa Parents: 9791796 c7b4073 Author: Aleksey Yeschenko Authored: Tue Sep 15 16:12:45 2015 +0100 Committer: Aleksey Yeschenko Committed: Tue Sep 15 16:12:45 2015 +0100 -- CHANGES.txt | 1 + .../hadoop/AbstractColumnFamilyInputFormat.java | 2 + .../hadoop/cql3/CqlBulkRecordWriter.java| 13 +- .../cassandra/hadoop/pig/CqlNativeStorage.java | 171 --- test/conf/cassandra_pig.yaml| 41 + .../org/apache/cassandra/pig/CqlTableTest.java | 35 .../org/apache/cassandra/pig/PigTestBase.java | 3 +- 7 files changed, 205 insertions(+), 61 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cd4a1e6a/CHANGES.txt -- diff --cc CHANGES.txt index bd24781,5f11049..b0ade42 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,8 +1,18 @@@ -2.1.10 +2.2.2 + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: + * (Pig) support BulkOutputFormat as a URL parameter (CASSANDRA-7410) * BATCH statement is broken in cqlsh (CASSANDRA-10272) * Added configurable warning threshold for GC duration (CASSANDRA-8907) - * (cqlsh) Make cqlsh PEP8 compliant (CASSANDRA-10066) + * (cqlsh) Make cqlsh PEP8 Compliant (CASSANDRA-10066) * (cqlsh) Fix error when starting cqlsh with --debug (CASSANDRA-10282) * Scrub, Cleanup and Upgrade do not unmark compacting until all operations have completed, regardless of the occurence of exceptions (CASSANDRA-10274) http://git-wip-us.apache.org/repos/asf/cassandra/blob/cd4a1e6a/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java -- diff --cc src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java index 4dd53ff,e8de0f2..9c45bfe --- a/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java +++ b/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java @@@ -24,23 -32,31 +24,24 @@@ import java.util.concurrent.* import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.cassandra.auth.IAuthenticator; +import com.datastax.driver.core.Host; +import com.datastax.driver.core.Metadata; +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.core.Session; +import com.datastax.driver.core.TokenRange; ++ +import org.apache.cassandra.db.SystemKeyspace; +import org.apache.cassandra.dht.ByteOrderedPartitioner; import org.apache.cassandra.dht.IPartitioner; +import org.apache.cassandra.dht.OrderPreservingPartitioner; import org.apache.cassandra.dht.Range; import org.apache.cassandra.dht.Token; -import org.apache.cassandra.thrift.AuthenticationRequest; -import org.apache.cassandra.thrift.Cassandra; -import org.apache.cassandra.thrift.CfSplit; -import org.apache.cassandra.thrift.InvalidRequestException; +import org.apache.cassandra.hadoop.cql3.*; import org.apache.cassandra.thrift.KeyRange; -import org.apache.cassandra.thrift.TokenRange; -import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapred.JobConf; -import org.apache.hadoop.mapreduce.InputFormat; -import org.apache.hadoop.mapreduce.InputSplit; -import org.apache.hadoop.mapreduce.JobContext; -import org.apache.hadoop.mapreduce.TaskAttemptContext; -import org.apache.hadoop.mapreduce.TaskAttemptID; -import org.apache.thrift.TApplicationException; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportException; - +import org.apache.hadoop.mapreduce.*; public abstract class AbstractColumnFamilyInp
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt conf/cassandra.yaml src/java/org/apache/cassandra/config/DatabaseDescriptor.java src/java/org/apache/cassandra/service/GCInspector.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/53d04491 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/53d04491 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/53d04491 Branch: refs/heads/cassandra-3.0 Commit: 53d04491707a2bd6cde48524a381361e67c054df Parents: 0d5908b 488db6f Author: Joshua McKenzie Authored: Fri Sep 11 13:00:40 2015 -0400 Committer: Joshua McKenzie Committed: Fri Sep 11 13:00:40 2015 -0400 -- CHANGES.txt | 1 + conf/cassandra.yaml | 5 + src/java/org/apache/cassandra/config/Config.java| 2 ++ .../apache/cassandra/config/DatabaseDescriptor.java | 11 +++ .../org/apache/cassandra/service/GCInspector.java | 16 +++- 5 files changed, 30 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/CHANGES.txt -- diff --cc CHANGES.txt index cd29592,4e0df42..ffae4d9 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,15 -1,6 +1,16 @@@ -2.1.10 +2.2.2 + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: + * Added configurable warning threshold for GC duration (CASSANDRA-8907) - * (cqlsh) Make cqlsh PEP8 compliant (CASSANDRA-10066) + * (cqlsh) Make cqlsh PEP8 Compliant (CASSANDRA-10066) * (cqlsh) Fix error when starting cqlsh with --debug (CASSANDRA-10282) * Scrub, Cleanup and Upgrade do not unmark compacting until all operations have completed, regardless of the occurence of exceptions (CASSANDRA-10274) http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/conf/cassandra.yaml -- diff --cc conf/cassandra.yaml index 4ff7afb,7e266d1..ab8e8d1 --- a/conf/cassandra.yaml +++ b/conf/cassandra.yaml @@@ -849,20 -803,7 +849,25 @@@ internode_compression: al # latency if you block for cross-datacenter responses. inter_dc_tcp_nodelay: false +# TTL for different trace types used during logging of the repair process. +tracetype_query_ttl: 86400 +tracetype_repair_ttl: 604800 + + # GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level + # Adjust the threshold based on your application throughput requirement + # By default, Cassandra logs GC Pauses greater than 200 ms at INFO level + # gc_warn_threshold_in_ms: 1000 ++ +# UDFs (user defined functions) are disabled by default. +# As of Cassandra 2.2, there is no security manager or anything else in place that +# prevents execution of evil code. CASSANDRA-9402 will fix this issue for Cassandra 3.0. +# This will inherently be backwards-incompatible with any 2.2 UDF that perform insecure +# operations such as opening a socket or writing to the filesystem. +enable_user_defined_functions: false + +# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation. +# Lowering this value on Windows can provide much tighter latency and better throughput, however +# some virtualized environments may see a negative performance impact from changing this setting +# below their system default. The sysinternals 'clockres' tool can confirm your system's default +# setting. +windows_timer_interval: 1 http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/config/Config.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/config/DatabaseDescriptor.java -- diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java index 423185b,3a6a8fd..545ad05 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@@ -358,9 -389,14 +358,14 @@@ public class DatabaseDescripto }
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: src/java/org/apache/cassandra/cql3/QueryProcessor.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0d5908bc Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0d5908bc Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0d5908bc Branch: refs/heads/cassandra-3.0 Commit: 0d5908bcc031f93b439fe9a2d717b8e2f9a98740 Parents: 72f2cc4 e9f3604 Author: Sylvain Lebresne Authored: Fri Sep 11 18:40:23 2015 +0200 Committer: Sylvain Lebresne Committed: Fri Sep 11 18:40:23 2015 +0200 -- src/java/org/apache/cassandra/cql3/QueryProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/0d5908bc/src/java/org/apache/cassandra/cql3/QueryProcessor.java -- diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java index b1b4cb4,d59d84f..e9ff1b1 --- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java +++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java @@@ -597,30 -612,13 +597,30 @@@ public class QueryProcessor implements return ksName.equals(statementKsName) && (cfName == null || cfName.equals(statementCfName)); } +public void onCreateFunction(String ksName, String functionName, List> argTypes) { +if (Functions.getOverloadCount(new FunctionName(ksName, functionName)) > 1) +{ +// in case there are other overloads, we have to remove all overloads since argument type +// matching may change (due to type casting) + removeInvalidPreparedStatementsForFunction(preparedStatements.values().iterator(), ksName, functionName); + removeInvalidPreparedStatementsForFunction(thriftPreparedStatements.values().iterator(), ksName, functionName); +} +} +public void onCreateAggregate(String ksName, String aggregateName, List> argTypes) { +if (Functions.getOverloadCount(new FunctionName(ksName, aggregateName)) > 1) +{ +// in case there are other overloads, we have to remove all overloads since argument type +// matching may change (due to type casting) + removeInvalidPreparedStatementsForFunction(preparedStatements.values().iterator(), ksName, aggregateName); + removeInvalidPreparedStatementsForFunction(thriftPreparedStatements.values().iterator(), ksName, aggregateName); +} +} + public void onUpdateColumnFamily(String ksName, String cfName, boolean columnsDidChange) { - logger.info("Column definitions for {}.{} changed, invalidating related prepared statements", ksName, cfName); ++logger.debug("Column definitions for {}.{} changed, invalidating related prepared statements", ksName, cfName); if (columnsDidChange) -{ -logger.debug("Column definitions for {}.{} changed, invalidating related prepared statements", ksName, cfName); removeInvalidPreparedStatements(ksName, cfName); -} } public void onDropKeyspace(String ksName) @@@ -631,41 -629,8 +631,41 @@@ public void onDropColumnFamily(String ksName, String cfName) { - logger.info("Table {}.{} was dropped, invalidating related prepared statements", ksName, cfName); + logger.debug("Table {}.{} was dropped, invalidating related prepared statements", ksName, cfName); removeInvalidPreparedStatements(ksName, cfName); } - } + +public void onDropFunction(String ksName, String functionName, List> argTypes) +{ + removeInvalidPreparedStatementsForFunction(preparedStatements.values().iterator(), ksName, functionName); + removeInvalidPreparedStatementsForFunction(thriftPreparedStatements.values().iterator(), ksName, functionName); +} + +public void onDropAggregate(String ksName, String aggregateName, List> argTypes) +{ + removeInvalidPreparedStatementsForFunction(preparedStatements.values().iterator(), ksName, aggregateName); + removeInvalidPreparedStatementsForFunction(thriftPreparedStatements.values().iterator(), ksName, aggregateName); +} + +private static void removeInvalidPreparedStatementsForFunction(Iterator statements, + final String ksName, + final String functionName) +
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/67ebf665 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/67ebf665 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/67ebf665 Branch: refs/heads/cassandra-2.2 Commit: 67ebf665f8179e890da265f80d7bcbbdc1948714 Parents: 362da9b 7d8663d Author: blerer Authored: Thu Sep 10 21:51:24 2015 +0200 Committer: blerer Committed: Thu Sep 10 21:51:34 2015 +0200 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: src/java/org/apache/cassandra/db/compaction/CompactionManager.java test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/362da9bb Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/362da9bb Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/362da9bb Branch: refs/heads/cassandra-3.0 Commit: 362da9bbc1cf64be0c6ec373e6602822b1138173 Parents: b22ad42 9dd8471 Author: Marcus Eriksson Authored: Thu Sep 10 14:35:37 2015 +0200 Committer: Marcus Eriksson Committed: Thu Sep 10 14:35:37 2015 +0200 -- .../db/compaction/CompactionManager.java| 28 +--- .../db/compaction/AntiCompactionTest.java | 4 +-- 2 files changed, 20 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/362da9bb/src/java/org/apache/cassandra/db/compaction/CompactionManager.java -- diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java index 495c5ab,e60675a..7def98d --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@@ -471,9 -445,13 +473,13 @@@ public class CompactionManager implemen while (sstableIterator.hasNext()) { SSTableReader sstable = sstableIterator.next(); - for (Range r : Range.normalize(ranges)) + -Range sstableRange = new Range<>(sstable.first.getToken(), sstable.last.getToken(), sstable.partitioner); ++Range sstableRange = new Range<>(sstable.first.getToken(), sstable.last.getToken()); + + boolean shouldAnticompact = false; + + for (Range r : normalizedRanges) { - Range sstableRange = new Range<>(sstable.first.getToken(), sstable.last.getToken()); if (r.contains(sstableRange)) { logger.info("SSTable {} fully contained in range {}, mutating repairedAt instead of anticompacting", sstable, r); @@@ -481,28 -459,28 +487,30 @@@ sstable.reloadSSTableMetadata(); mutatedRepairStatuses.add(sstable); sstableIterator.remove(); + shouldAnticompact = true; break; } - else if (!sstableRange.intersects(r)) - { - logger.info("SSTable {} ({}) does not intersect repaired range {}, not touching repairedAt.", sstable, sstableRange, r); - nonAnticompacting.add(sstable); - sstableIterator.remove(); - break; - } - else + else if (sstableRange.intersects(r)) { logger.info("SSTable {} ({}) will be anticompacted on range {}", sstable, sstableRange, r); + shouldAnticompact = true; } } + + if (!shouldAnticompact) + { + logger.info("SSTable {} ({}) does not intersect repaired ranges {}, not touching repairedAt.", sstable, sstableRange, normalizedRanges); + nonAnticompacting.add(sstable); + sstableIterator.remove(); + } } - cfs.getDataTracker().notifySSTableRepairedStatusChanged(mutatedRepairStatuses); - cfs.getDataTracker().unmarkCompacting(Sets.union(nonAnticompacting, mutatedRepairStatuses)); + cfs.getTracker().notifySSTableRepairedStatusChanged(mutatedRepairStatuses); +txn.cancel(Sets.union(nonAnticompacting, mutatedRepairStatuses)); validatedForRepair.release(Sets.union(nonAnticompacting, mutatedRepairStatuses)); +assert txn.originals().equals(sstables); if (!sstables.isEmpty()) -doAntiCompaction(cfs, ranges, sstables, repairedAt); +doAntiCompaction(cfs, ranges, txn, repairedAt); +txn.finish(); } finally { http://git-wip-us.apache.org/repos/asf/cassandra/blob/362da9bb/test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java -- diff --cc test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java index 235462b,56af801..7c3fbc2 --- a/test/unit/org/apache/cassandra/db/compacti
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2b75601/bin/cqlsh.py -- diff --cc bin/cqlsh.py index c991cc7,000..4fce833 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2697 -1,0 +1,2697 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement +from uuid import UUID + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +from StringIO import StringIO +from contextlib import contextmanager +from glob import glob + +import cmd +import sys +import os +import time +import optparse +import ConfigParser +import codecs +import locale +import platform +import warnings +import csv +import getpass +from functools import partial +import traceback + + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.cluster import Cluster, PagedResult +from cassandra.query import SimpleStatement, ordered_dict_factory +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.metadata import protect_name, protect_names, protect_value, KeyspaceMetadata, TableMetadata, ColumnMetadata +from cassandra.auth import PlainTextAuthProvider + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cqlhandling, cql3handling, pylexotron, sslhandling +from cqlshlib.displaying import (RED, BLUE, CYAN, ANSI_RESET, COLUMN_NAME_COLORS, + FormattedValue, colorme) +from cqlshlib.formatting import format_by_type, formatter_for, format_value_utype +from cqlshlib.util import trim_if_present, get_file_encoding_bomsize +from cqlshlib.formatting import DateTimeForma
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/464ca14a/bin/cqlsh.py -- diff --cc bin/cqlsh.py index bfb3a24,000..c991cc7 mode 100644,00..100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@@ -1,2695 -1,0 +1,2697 @@@ +#!/bin/sh +# -*- mode: Python -*- + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""":" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x0300))' 2>/dev/null \ +&& exec python "$0" "$@" +for pyver in 2.6 2.7 2.5; do +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 +":""" + +from __future__ import with_statement +from uuid import UUID + +description = "CQL Shell for Apache Cassandra" +version = "5.0.1" + +from StringIO import StringIO +from contextlib import contextmanager +from glob import glob + +import cmd +import sys +import os +import time +import optparse +import ConfigParser +import codecs +import locale +import platform +import warnings +import csv +import getpass +from functools import partial +import traceback + + +readline = None +try: +# check if tty first, cause readline doesn't check, and only cares +# about $TERM. we don't want the funky escape code stuff to be +# output if not a tty. +if sys.stdin.isatty(): +import readline +except ImportError: +pass + +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-' + +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') + +# use bundled libs for python-cql and thrift, if available. if there +# is a ../lib dir, use bundled libs there preferentially. +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')] +myplatform = platform.system() +if myplatform == 'Linux': +ZIPLIB_DIRS.append('/usr/share/cassandra/lib') + +if os.environ.get('CQLSH_NO_BUNDLED', ''): +ZIPLIB_DIRS = () + + +def find_zip(libprefix): +for ziplibdir in ZIPLIB_DIRS: +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip')) +if zips: +return max(zips) # probably the highest version, if multiple + +cql_zip = find_zip(CQL_LIB_PREFIX) +if cql_zip: +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):] +sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver)) + +third_parties = ('futures-', 'six-') + +for lib in third_parties: +lib_zip = find_zip(lib) +if lib_zip: +sys.path.insert(0, lib_zip) + +warnings.filterwarnings("ignore", r".*blist.*") +try: +import cassandra +except ImportError, e: +sys.exit("\nPython Cassandra driver not installed, or not on PYTHONPATH.\n" + 'You might try "pip install cassandra-driver".\n\n' + 'Python: %s\n' + 'Module load path: %r\n\n' + 'Error: %s\n' % (sys.executable, sys.path, e)) + +from cassandra.cluster import Cluster, PagedResult +from cassandra.query import SimpleStatement, ordered_dict_factory +from cassandra.policies import WhiteListRoundRobinPolicy +from cassandra.protocol import QueryMessage, ResultMessage +from cassandra.metadata import protect_name, protect_names, protect_value, KeyspaceMetadata, TableMetadata, ColumnMetadata +from cassandra.auth import PlainTextAuthProvider + +# cqlsh should run correctly when run out of a Cassandra source tree, +# out of an unpacked Cassandra tarball, and after a proper package install. +cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') +if os.path.isdir(cqlshlibdir): +sys.path.insert(0, cqlshlibdir) + +from cqlshlib import cqlhandling, cql3handling, pylexotron, sslhandling +from cqlshlib.displaying import (RED, BLUE, CYAN, ANSI_RESET, COLUMN_NAME_COLORS, + FormattedValue, colorme) +from cqlshlib.formatting import format_by_type, formatter_for, format_value_utype +from cqlshlib.util import trim_if_present, get_file_encoding_bomsize +from cqlshlib.formatting import DateTimeForma
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: src/java/org/apache/cassandra/net/MessageDeliveryTask.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/45dd5d17 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/45dd5d17 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/45dd5d17 Branch: refs/heads/cassandra-3.0 Commit: 45dd5d178f0c817c2ef1908c8b8c1563a2bf3cf1 Parents: 02e5478 c457dce Author: Jason Brown Authored: Tue Sep 1 22:23:04 2015 -0700 Committer: Jason Brown Committed: Tue Sep 1 22:23:04 2015 -0700 -- src/java/org/apache/cassandra/net/MessageDeliveryTask.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/45dd5d17/src/java/org/apache/cassandra/net/MessageDeliveryTask.java -- diff --cc src/java/org/apache/cassandra/net/MessageDeliveryTask.java index 7f30797,a16f53f..0ff0319 --- a/src/java/org/apache/cassandra/net/MessageDeliveryTask.java +++ b/src/java/org/apache/cassandra/net/MessageDeliveryTask.java @@@ -85,17 -78,7 +85,17 @@@ public class MessageDeliveryTask implem Gossiper.instance.setLastProcessedMessageAt(constructionTime); } +private void handleFailure(Throwable t) +{ +if (message.doCallbackOnFailure()) +{ +MessageOut response = new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE) + .withParameter(MessagingService.FAILURE_RESPONSE_PARAM, MessagingService.ONE_BYTE); +MessagingService.instance().sendReply(response, id, message.from); +} +} + - EnumSet GOSSIP_VERBS = EnumSet.of(MessagingService.Verb.GOSSIP_DIGEST_ACK, - MessagingService.Verb.GOSSIP_DIGEST_ACK2, - MessagingService.Verb.GOSSIP_DIGEST_SYN); + private static final EnumSet GOSSIP_VERBS = EnumSet.of(MessagingService.Verb.GOSSIP_DIGEST_ACK, - MessagingService.Verb.GOSSIP_DIGEST_ACK2, - MessagingService.Verb.GOSSIP_DIGEST_SYN); ++ MessagingService.Verb.GOSSIP_DIGEST_ACK2, ++ MessagingService.Verb.GOSSIP_DIGEST_SYN); }
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
http://git-wip-us.apache.org/repos/asf/cassandra/blob/c870adc2/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java -- diff --cc src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java index 0c4b797,000..d843d4d mode 100644,00..100644 --- a/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java +++ b/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java @@@ -1,2287 -1,0 +1,2287 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.io.sstable.format; + +import java.io.*; +import java.nio.ByteBuffer; +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; +import com.google.common.collect.Iterators; +import com.google.common.collect.Ordering; +import com.google.common.primitives.Longs; +import com.google.common.util.concurrent.RateLimiter; + +import com.clearspring.analytics.stream.cardinality.CardinalityMergeException; +import com.clearspring.analytics.stream.cardinality.HyperLogLogPlus; +import com.clearspring.analytics.stream.cardinality.ICardinality; +import com.codahale.metrics.Counter; +import org.apache.cassandra.cache.CachingOptions; +import org.apache.cassandra.cache.InstrumentingCache; +import org.apache.cassandra.cache.KeyCacheKey; +import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; +import org.apache.cassandra.concurrent.ScheduledExecutors; +import org.apache.cassandra.config.*; +import org.apache.cassandra.db.*; +import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; +import org.apache.cassandra.db.commitlog.ReplayPosition; +import org.apache.cassandra.db.composites.CellName; +import org.apache.cassandra.db.filter.ColumnSlice; +import org.apache.cassandra.db.index.SecondaryIndex; +import org.apache.cassandra.db.lifecycle.Tracker; +import org.apache.cassandra.dht.*; +import org.apache.cassandra.io.FSError; +import org.apache.cassandra.io.compress.CompressionMetadata; +import org.apache.cassandra.io.sstable.*; +import org.apache.cassandra.io.sstable.metadata.*; +import org.apache.cassandra.io.util.*; +import org.apache.cassandra.metrics.RestorableMeter; +import org.apache.cassandra.metrics.StorageMetrics; +import org.apache.cassandra.service.ActiveRepairService; +import org.apache.cassandra.service.CacheService; +import org.apache.cassandra.service.StorageService; +import org.apache.cassandra.utils.*; +import org.apache.cassandra.utils.concurrent.OpOrder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.cassandra.utils.concurrent.Ref; +import org.apache.cassandra.utils.concurrent.SelfRefCounted; + +import static org.apache.cassandra.db.Directories.SECONDARY_INDEX_NAME_SEPARATOR; + +/** + * An SSTableReader can be constructed in a number of places, but typically is either + * read from disk at startup, or constructed from a flushed memtable, or after compaction + * to replace some existing sstables. However once created, an sstablereader may also be modified. + * + * A reader's OpenReason describes its current stage in its lifecycle, as follows: + * + * + * {@code + * NORMAL + * From: None=> Reader has been read from disk, either at startup or from a flushed memtable + * EARLY => Reader is the final result of a compaction + * MOVED_START => Reader WAS being compacted, but this failed and it has been restored to NORMAL status + * + * EARLY + * From: None=> Reader is a compaction replacement that is either incomplete and has been opened + *to represent its partial result status, or has been finished but the compaction + *it is a part of has not yet completed fully + * EARLY => Same as from None, only it is not the first time it has been + * + * MOVED_START + * F
[2/3] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
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/2ac45aed Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2ac45aed Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2ac45aed Branch: refs/heads/cassandra-3.0 Commit: 2ac45aed90067c68113b9edd7b79a777f6b80e76 Parents: 1dc19a6 7e1ea4c Author: blerer Authored: Wed Aug 26 15:20:41 2015 +0200 Committer: blerer Committed: Wed Aug 26 15:22:04 2015 +0200 -- CHANGES.txt | 1 + conf/cassandra.yaml | 4 ++-- src/java/org/apache/cassandra/config/Config.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2ac45aed/CHANGES.txt -- diff --cc CHANGES.txt index 97d8b8b,26dc34b..f9d9ae1 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,18 -1,9 +1,19 @@@ -2.1.10 +2.2.1 + * (cqlsh) add CLEAR command (CASSANDRA-10086) + * Support string literals as Role names for compatibility (CASSANDRA-10135) + * Allow count(*) and count(1) to be use as normal aggregation (CASSANDRA-10114) + * An NPE is thrown if the column name is unknown for an IN relation (CASSANDRA-10043) + * Apply commit_failure_policy to more errors on startup (CASSANDRA-9749) + * Fix histogram overflow exception (CASSANDRA-9973) + * Route gossip messages over dedicated socket (CASSANDRA-9237) + * Add checksum to saved cache files (CASSANDRA-9265) + * Log warning when using an aggregate without partition key (CASSANDRA-9737) + * Avoid grouping sstables for anticompaction with DTCS (CASSANDRA-9900) + * UDF / UDA execution time in trace (CASSANDRA-9723) + * Fix broken internode SSL (CASSANDRA-9884) +Merged from 2.1: + * Change streaming_socket_timeout_in_ms default to 1 hour (CASSANDRA-8611) * (cqlsh) update list of CQL keywords (CASSANDRA-9232) - - -2.1.9 * Avoid race condition during read repair (CASSANDRA-9460) * (cqlsh) default load-from-file encoding to utf-8 (CASSANDRA-9898) * Avoid returning Permission.NONE when failing to query users table (CASSANDRA-10168) http://git-wip-us.apache.org/repos/asf/cassandra/blob/2ac45aed/conf/cassandra.yaml -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2ac45aed/src/java/org/apache/cassandra/config/Config.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1dc19a66 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1dc19a66 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1dc19a66 Branch: refs/heads/cassandra-3.0 Commit: 1dc19a666d1da7efd4f017e70bc275ca2897a711 Parents: 3238906 15293a7 Author: Tyler Hobbs Authored: Tue Aug 25 12:47:32 2015 -0500 Committer: Tyler Hobbs Committed: Tue Aug 25 12:47:32 2015 -0500 -- --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a69558b0 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a69558b0 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a69558b0 Branch: refs/heads/cassandra-3.0 Commit: a69558b00067e00d1c4de5806c80fc8314e3538c Parents: d1d10fa 147fe6d Author: T Jake Luciani Authored: Tue Aug 25 09:24:17 2015 -0400 Committer: T Jake Luciani Committed: Tue Aug 25 09:24:17 2015 -0400 -- CHANGES.txt | 1 + .../org/apache/cassandra/db/ReadCommand.java| 4 ++-- .../cassandra/db/SliceFromReadCommand.java | 6 +++--- .../cassandra/db/filter/SliceQueryFilter.java | 20 .../apache/cassandra/service/StorageProxy.java | 4 ++-- 5 files changed, 20 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a69558b0/CHANGES.txt -- diff --cc CHANGES.txt index 34615db,dcae493..3065d0b --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,5 +1,18 @@@ -2.1.9 +2.2.1 + * add CLEAR cqlsh command (CASSANDRA-10086) + * Support string literals as Role names for compatibility (CASSANDRA-10135) + * Allow count(*) and count(1) to be use as normal aggregation (CASSANDRA-10114) + * An NPE is thrown if the column name is unknown for an IN relation (CASSANDRA-10043) + * Apply commit_failure_policy to more errors on startup (CASSANDRA-9749) + * Fix histogram overflow exception (CASSANDRA-9973) + * Route gossip messages over dedicated socket (CASSANDRA-9237) + * Add checksum to saved cache files (CASSANDRA-9265) + * Log warning when using an aggregate without partition key (CASSANDRA-9737) + * Avoid grouping sstables for anticompaction with DTCS (CASSANDRA-9900) + * UDF / UDA execution time in trace (CASSANDRA-9723) + * Fix broken internode SSL (CASSANDRA-9884) +Merged from 2.1: + * Avoid race condition during read repair (CASSANDRA-9460) * (cqlsh) default load-from-file encoding to utf-8 (CASSANDRA-9898) * Avoid returning Permission.NONE when failing to query users table (CASSANDRA-10168) * (cqlsh) Allow encoding to be set through command line (CASSANDRA-10004) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a69558b0/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a69558b0/src/java/org/apache/cassandra/service/StorageProxy.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/d1d10fae Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d1d10fae Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d1d10fae Branch: refs/heads/cassandra-3.0 Commit: d1d10fae008545b415bd72e68f63c983d44a8db7 Parents: 1992598 978660d Author: Aleksey Yeschenko Authored: Tue Aug 25 12:45:51 2015 +0300 Committer: Aleksey Yeschenko Committed: Tue Aug 25 12:45:51 2015 +0300 -- CHANGES.txt | 3 +-- src/java/org/apache/cassandra/auth/CassandraAuthorizer.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1d10fae/CHANGES.txt -- diff --cc CHANGES.txt index 664a23e,d6a0af9..34615db --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,20 -1,6 +1,19 @@@ -2.1.9 +2.2.1 + * add CLEAR cqlsh command (CASSANDRA-10086) + * Support string literals as Role names for compatibility (CASSANDRA-10135) + * Allow count(*) and count(1) to be use as normal aggregation (CASSANDRA-10114) + * An NPE is thrown if the column name is unknown for an IN relation (CASSANDRA-10043) + * Apply commit_failure_policy to more errors on startup (CASSANDRA-9749) + * Fix histogram overflow exception (CASSANDRA-9973) + * Route gossip messages over dedicated socket (CASSANDRA-9237) + * Add checksum to saved cache files (CASSANDRA-9265) + * Log warning when using an aggregate without partition key (CASSANDRA-9737) + * Avoid grouping sstables for anticompaction with DTCS (CASSANDRA-9900) + * UDF / UDA execution time in trace (CASSANDRA-9723) + * Fix broken internode SSL (CASSANDRA-9884) +Merged from 2.1: * (cqlsh) default load-from-file encoding to utf-8 (CASSANDRA-9898) - * Avoid returning Permission.None when system_auth.permissions table does not -exist (CASSANDRA-10168) + * Avoid returning Permission.NONE when failing to query users table (CASSANDRA-10168) * (cqlsh) Allow encoding to be set through command line (CASSANDRA-10004) * Add new JMX methods to change local compaction strategy (CASSANDRA-9965) * Write hints for paxos commits (CASSANDRA-7342) http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1d10fae/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java -- diff --cc src/java/org/apache/cassandra/auth/CassandraAuthorizer.java index 7911acc,49eefb1..5cdea3f --- a/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java +++ b/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java @@@ -89,9 -83,15 +89,9 @@@ public class CassandraAuthorizer implem catch (RequestExecutionException e) { logger.warn("CassandraAuthorizer failed to authorize {} for {}", user, resource); - return Permission.NONE; + throw new RuntimeException(e); } -if (result.isEmpty() || !result.one().has(PERMISSIONS)) -return Permission.NONE; - -Set permissions = EnumSet.noneOf(Permission.class); -for (String perm : result.one().getSet(PERMISSIONS, UTF8Type.instance)) -permissions.add(Permission.valueOf(perm)); return permissions; }
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
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/2dd8101a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2dd8101a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2dd8101a Branch: refs/heads/cassandra-3.0 Commit: 2dd8101ae0b6c51600f00929c2f15beea94463b7 Parents: 9c3b967 76e8eb8 Author: Marcus Eriksson Authored: Mon Aug 10 09:27:22 2015 +0200 Committer: Marcus Eriksson Committed: Mon Aug 10 09:27:22 2015 +0200 -- NEWS.txt| 2 +- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 12 ++-- .../org/apache/cassandra/db/ColumnFamilyStoreMBean.java | 12 ++-- .../cassandra/db/compaction/CompactionsCQLTest.java | 10 +- 4 files changed, 18 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2dd8101a/NEWS.txt -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2dd8101a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2dd8101a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java --
[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt src/java/org/apache/cassandra/config/CFMetaData.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9c3b967e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9c3b967e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9c3b967e Branch: refs/heads/cassandra-3.0 Commit: 9c3b967e7186c1c3b6f1c25c627e770187020344 Parents: 6d0cf7d 5aca7d7 Author: Marcus Eriksson Authored: Mon Aug 10 09:08:39 2015 +0200 Committer: Marcus Eriksson Committed: Mon Aug 10 09:08:39 2015 +0200 -- CHANGES.txt | 1 + NEWS.txt| 3 +- .../org/apache/cassandra/config/CFMetaData.java | 10 ++- .../apache/cassandra/db/ColumnFamilyStore.java | 35 + .../cassandra/db/ColumnFamilyStoreMBean.java| 21 + .../compaction/AbstractCompactionStrategy.java | 2 +- .../compaction/WrappingCompactionStrategy.java | 51 +--- .../db/compaction/CompactionsCQLTest.java | 82 +++- 8 files changed, 190 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c3b967e/CHANGES.txt -- diff --cc CHANGES.txt index a913fe7,462de44..772455c --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,10 -1,5 +1,11 @@@ -2.1.9 +2.2.1 + * Add checksum to saved cache files (CASSANDRA-9265) + * Log warning when using an aggregate without partition key (CASSANDRA-9737) + * Avoid grouping sstables for anticompaction with DTCS (CASSANDRA-9900) + * UDF / UDA execution time in trace (CASSANDRA-9723) + * Fix broken internode SSL (CASSANDRA-9884) +Merged from 2.1: + * Add new JMX methods to change local compaction strategy (CASSANDRA-9965) * Write hints for paxos commits (CASSANDRA-7342) * (cqlsh) Fix timestamps before 1970 on Windows, always use UTC for timestamp display (CASSANDRA-1) http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c3b967e/NEWS.txt -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c3b967e/src/java/org/apache/cassandra/config/CFMetaData.java -- diff --cc src/java/org/apache/cassandra/config/CFMetaData.java index d8eeaf2,2c6a30c..6468973 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@@ -876,6 -1299,57 +878,12 @@@ public final class CFMetaDat } } + @Deprecated + public AbstractCompactionStrategy createCompactionStrategyInstance(ColumnFamilyStore cfs) + { + return createCompactionStrategyInstance(compactionStrategyClass, cfs, compactionStrategyOptions); + } + -// converts CFM to thrift CfDef -public org.apache.cassandra.thrift.CfDef toThrift() -{ -org.apache.cassandra.thrift.CfDef def = new org.apache.cassandra.thrift.CfDef(ksName, cfName); -def.setColumn_type(cfType.name()); - -if (isSuper()) -{ -def.setComparator_type(comparator.subtype(0).toString()); -def.setSubcomparator_type(comparator.subtype(1).toString()); -} -else -{ -def.setComparator_type(comparator.toString()); -} - -def.setComment(Strings.nullToEmpty(comment)); -def.setRead_repair_chance(readRepairChance); -def.setDclocal_read_repair_chance(dcLocalReadRepairChance); -def.setGc_grace_seconds(gcGraceSeconds); -def.setDefault_validation_class(defaultValidator == null ? null : defaultValidator.toString()); -def.setKey_validation_class(keyValidator.toString()); -def.setMin_compaction_threshold(minCompactionThreshold); -def.setMax_compaction_threshold(maxCompactionThreshold); -// We only return the alias if only one is set since thrift don't know about multiple key aliases -if (partitionKeyColumns.size() == 1) -def.setKey_alias(partitionKeyColumns.get(0).name.bytes); -def.setColumn_metadata(ColumnDefinition.toThrift(columnMetadata)); -def.setCompaction_strategy(compactionStrategyClass.getName()); -def.setCompaction_strategy_options(new HashMap<>(compactionStrategyOptions)); -def.setCompression_options(compressionParameters.asThriftOptions()); -if (bloomFilterFpChance != null) -def.setBloom_filter_fp_chance(bloomFilterFpChance); -def.setMin_index_interval(minIndexInterval); -def.setMax_index_interval(maxIndexInterval); -def.setMemtable_flush_period_in_ms(memtableFlushPeriod);