cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk
Date Tue, 21 Apr 2015 16:09:06 GMT
Merge branch 'cassandra-2.1' into trunk

Conflicts:
	CHANGES.txt
	test/unit/org/apache/cassandra/cql3/UserTypesTest.java


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

Branch: refs/heads/trunk
Commit: 5f663f540c74287777087c903e5fd3974aaddd3d
Parents: 727c5c8 bdef072
Author: Tyler Hobbs <tylerlhobbs@gmail.com>
Authored: Tue Apr 21 11:08:38 2015 -0500
Committer: Tyler Hobbs <tylerlhobbs@gmail.com>
Committed: Tue Apr 21 11:08:38 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |   3 +
 .../cql3/statements/AlterTypeStatement.java     |   9 +-
 .../cassandra/db/composites/CellNames.java      |   1 +
 .../org/apache/cassandra/cql3/CQLTester.java    |   5 +
 .../apache/cassandra/cql3/UserTypesTest.java    | 111 +++++++++++++++++++
 5 files changed, 128 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5f663f54/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index a69789a,ff25db6..41ed08f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,102 -1,7 +1,105 @@@
 +3.0
 + * Distinguish between null and unset in protocol v4 (CASSANDRA-7304)
 + * Add user/role permissions for user-defined functions (CASSANDRA-7557)
 + * Allow cassandra config to be updated to restart daemon without unloading classes (CASSANDRA-9046)
 + * Don't initialize compaction writer before checking if iter is empty (CASSANDRA-9117)
 + * Remove line number generation from default logback.xml
 + * Don't execute any functions at prepare-time (CASSANDRA-9037)
 + * Share file handles between all instances of a SegmentedFile (CASSANDRA-8893)
 + * Make it possible to major compact LCS (CASSANDRA-7272)
 + * Make FunctionExecutionException extend RequestExecutionException
 +   (CASSANDRA-9055)
 + * Add support for SELECT JSON, INSERT JSON syntax and new toJson(), fromJson()
 +   functions (CASSANDRA-7970)
 + * Optimise max purgeable timestamp calculation in compaction (CASSANDRA-8920)
 + * Constrain internode message buffer sizes, and improve IO class hierarchy (CASSANDRA-8670)

 + * New tool added to validate all sstables in a node (CASSANDRA-5791)
 + * Push notification when tracing completes for an operation (CASSANDRA-7807)
 + * Delay "node up" and "node added" notifications until native protocol server is started
(CASSANDRA-8236)
 + * Compressed Commit Log (CASSANDRA-6809)
 + * Optimise IntervalTree (CASSANDRA-8988)
 + * Add a key-value payload for third party usage (CASSANDRA-8553)
 + * Bump metrics-reporter-config dependency for metrics 3.0 (CASSANDRA-8149)
 + * Partition intra-cluster message streams by size, not type (CASSANDRA-8789)
 + * Add WriteFailureException to native protocol, notify coordinator of
 +   write failures (CASSANDRA-8592)
 + * Convert SequentialWriter to nio (CASSANDRA-8709)
 + * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760, 8849, 8761, 8850)
 + * Record client ip address in tracing sessions (CASSANDRA-8162)
 + * Indicate partition key columns in response metadata for prepared
 +   statements (CASSANDRA-7660)
 + * Merge UUIDType and TimeUUIDType parse logic (CASSANDRA-8759)
 + * Avoid memory allocation when searching index summary (CASSANDRA-8793)
 + * Optimise (Time)?UUIDType Comparisons (CASSANDRA-8730)
 + * Make CRC32Ex into a separate maven dependency (CASSANDRA-8836)
 + * Use preloaded jemalloc w/ Unsafe (CASSANDRA-8714)
 + * Avoid accessing partitioner through StorageProxy (CASSANDRA-8244, 8268)
 + * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657)
 + * Serializing Row cache alternative, fully off heap (CASSANDRA-7438)
 + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707)
 + * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560)
 + * Support direct buffer decompression for reads (CASSANDRA-8464)
 + * DirectByteBuffer compatible LZ4 methods (CASSANDRA-7039)
 + * Group sstables for anticompaction correctly (CASSANDRA-8578)
 + * Add ReadFailureException to native protocol, respond
 +   immediately when replicas encounter errors while handling
 +   a read request (CASSANDRA-7886)
 + * Switch CommitLogSegment from RandomAccessFile to nio (CASSANDRA-8308)
 + * Allow mixing token and partition key restrictions (CASSANDRA-7016)
 + * Support index key/value entries on map collections (CASSANDRA-8473)
 + * Modernize schema tables (CASSANDRA-8261)
 + * Support for user-defined aggregation functions (CASSANDRA-8053)
 + * Fix NPE in SelectStatement with empty IN values (CASSANDRA-8419)
 + * Refactor SelectStatement, return IN results in natural order instead
 +   of IN value list order and ignore duplicate values in partition key IN restrictions (CASSANDRA-7981)
 + * Support UDTs, tuples, and collections in user-defined
 +   functions (CASSANDRA-7563)
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsing (CASSANDRA-8229)
 + * Mark sstables as repaired after full repair (CASSANDRA-7586)
 + * Extend Descriptor to include a format value and refactor reader/writer
 +   APIs (CASSANDRA-7443)
 + * Integrate JMH for microbenchmarks (CASSANDRA-8151)
 + * Keep sstable levels when bootstrapping (CASSANDRA-7460)
 + * Add Sigar library and perform basic OS settings check on startup (CASSANDRA-7838)
 + * Support for aggregation functions (CASSANDRA-4914)
 + * Remove cassandra-cli (CASSANDRA-7920)
 + * Accept dollar quoted strings in CQL (CASSANDRA-7769)
 + * Make assassinate a first class command (CASSANDRA-7935)
 + * Support IN clause on any partition key column (CASSANDRA-7855)
 + * Support IN clause on any clustering column (CASSANDRA-4762)
 + * Improve compaction logging (CASSANDRA-7818)
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Support user-defined functions (CASSANDRA-7395, 7526, 7562, 7740, 7781, 7929,
 +   7924, 7812, 8063, 7813, 7708)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 + * Fail on very large batch sizes (CASSANDRA-8011)
 + * Improve concurrency of repair (CASSANDRA-6455, 8208)
 + * Select optimal CRC32 implementation at runtime (CASSANDRA-8614)
 + * Evaluate MurmurHash of Token once per query (CASSANDRA-7096)
 + * Generalize progress reporting (CASSANDRA-8901)
 + * Resumable bootstrap streaming (CASSANDRA-8838, CASSANDRA-8942)
 + * Allow scrub for secondary index (CASSANDRA-5174)
 + * Save repair data to system table (CASSANDRA-5839)
 + * fix nodetool names that reference column families (CASSANDRA-8872)
 +
  2.1.5
+  * Update collection types that use a user-defined type when that UDT is
+    modified (CASSANDRA-9148)
+  * Re-add deprecated cold_reads_to_omit param for backwards compat (CASSANDRA-9203)
   * Make anticompaction visible in compactionstats (CASSANDRA-9098)
   * Improve nodetool getendpoints documentation about the partition
     key parameter (CASSANDRA-6458)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5f663f54/test/unit/org/apache/cassandra/cql3/CQLTester.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5f663f54/test/unit/org/apache/cassandra/cql3/UserTypesTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/cql3/UserTypesTest.java
index 3b381fc,1d71fe8..4055d30
--- a/test/unit/org/apache/cassandra/cql3/UserTypesTest.java
+++ b/test/unit/org/apache/cassandra/cql3/UserTypesTest.java
@@@ -113,17 -113,113 +113,128 @@@ public class UserTypesTest extends CQLT
      }
  
      @Test
 +    public void testUDTWithUnsetValues() throws Throwable
 +    {
 +        // set up
 +        String myType = createType("CREATE TYPE %s (x int, y int)");
 +        String myOtherType = createType("CREATE TYPE %s (a frozen<" + myType + ">)");
 +        createTable("CREATE TABLE %s (k int PRIMARY KEY, v frozen<" + myType + ">,
z frozen<" + myOtherType + ">)");
 +
 +        assertInvalidMessage("Invalid unset value for field 'y' of user defined type " +
myType,
 +                "INSERT INTO %s (k, v) VALUES (10, {x:?, y:?})", 1, unset());
 +
 +        assertInvalidMessage("Invalid unset value for field 'y' of user defined type " +
myType,
 +                "INSERT INTO %s (k, v, z) VALUES (10, {x:?, y:?}, {a:{x: ?, y: ?}})", 1,
1, 1, unset());
 +    }
++
++    @Test
+     public void testAlteringUserTypeNestedWithinMap() throws Throwable
+     {
+         // test frozen and non-frozen collections
+         String[] columnTypePrefixes = {"frozen<map<text, ", "map<text, frozen<"};
+         for (String columnTypePrefix : columnTypePrefixes)
+         {
+             String ut1 = createType("CREATE TYPE %s (a int)");
+             String columnType = columnTypePrefix + KEYSPACE + "." + ut1 + ">>";
+ 
+             createTable("CREATE TABLE %s (x int PRIMARY KEY, y " + columnType + ")");
+ 
+             execute("INSERT INTO %s (x, y) VALUES(1, {'firstValue':{a:1}})");
+             assertRows(execute("SELECT * FROM %s"), row(1, map("firstValue", userType(1))));
+             flush();
+ 
+             execute("ALTER TYPE " + KEYSPACE + "." + ut1 + " ADD b int");
+             execute("INSERT INTO %s (x, y) VALUES(2, {'secondValue':{a:2, b:2}})");
+             execute("INSERT INTO %s (x, y) VALUES(3, {'thirdValue':{a:3}})");
+             execute("INSERT INTO %s (x, y) VALUES(4, {'fourthValue':{b:4}})");
+ 
+             assertRows(execute("SELECT * FROM %s"),
+                     row(1, map("firstValue", userType(1))),
+                     row(2, map("secondValue", userType(2, 2))),
+                     row(3, map("thirdValue", userType(3, null))),
+                     row(4, map("fourthValue", userType(null, 4))));
+ 
+             flush();
+ 
+             assertRows(execute("SELECT * FROM %s"),
+                     row(1, map("firstValue", userType(1))),
+                     row(2, map("secondValue", userType(2, 2))),
+                     row(3, map("thirdValue", userType(3, null))),
+                     row(4, map("fourthValue", userType(null, 4))));
+         }
+     }
+ 
+     @Test
+     public void testAlteringUserTypeNestedWithinSet() throws Throwable
+     {
+         // test frozen and non-frozen collections
+         String[] columnTypePrefixes = {"frozen<set<", "set<frozen<"};
+         for (String columnTypePrefix : columnTypePrefixes)
+         {
+             String ut1 = createType("CREATE TYPE %s (a int)");
+             String columnType = columnTypePrefix + KEYSPACE + "." + ut1 + ">>";
+ 
+             createTable("CREATE TABLE %s (x int PRIMARY KEY, y " + columnType + ")");
+ 
+             execute("INSERT INTO %s (x, y) VALUES(1, {1} )");
+             assertRows(execute("SELECT * FROM %s"), row(1, set(userType(1))));
+             flush();
+ 
+             execute("ALTER TYPE " + KEYSPACE + "." + ut1 + " ADD b int");
+             execute("INSERT INTO %s (x, y) VALUES(2, {{a:2, b:2}})");
+             execute("INSERT INTO %s (x, y) VALUES(3, {{a:3}})");
+             execute("INSERT INTO %s (x, y) VALUES(4, {{b:4}})");
+ 
+             assertRows(execute("SELECT * FROM %s"),
+                     row(1, set(userType(1))),
+                     row(2, set(userType(2, 2))),
+                     row(3, set(userType(3, null))),
+                     row(4, set(userType(null, 4))));
+ 
+             flush();
+ 
+             assertRows(execute("SELECT * FROM %s"),
+                     row(1, set(userType(1))),
+                     row(2, set(userType(2, 2))),
+                     row(3, set(userType(3, null))),
+                     row(4, set(userType(null, 4))));
+         }
+     }
+ 
+     @Test
+     public void testAlteringUserTypeNestedWithinList() throws Throwable
+     {
+         // test frozen and non-frozen collections
+         String[] columnTypePrefixes = {"frozen<list<", "list<frozen<"};
+         for (String columnTypePrefix : columnTypePrefixes)
+         {
+             String ut1 = createType("CREATE TYPE %s (a int)");
+             String columnType = columnTypePrefix + KEYSPACE + "." + ut1 + ">>";
+ 
+             createTable("CREATE TABLE %s (x int PRIMARY KEY, y " + columnType + ")");
+ 
+             execute("INSERT INTO %s (x, y) VALUES(1, [1] )");
+             assertRows(execute("SELECT * FROM %s"), row(1, list(userType(1))));
+             flush();
+ 
+             execute("ALTER TYPE " + KEYSPACE + "." + ut1 + " ADD b int");
+             execute("INSERT INTO %s (x, y) VALUES(2, [{a:2, b:2}])");
+             execute("INSERT INTO %s (x, y) VALUES(3, [{a:3}])");
+             execute("INSERT INTO %s (x, y) VALUES(4, [{b:4}])");
+ 
+             assertRows(execute("SELECT * FROM %s"),
+                     row(1, list(userType(1))),
+                     row(2, list(userType(2, 2))),
+                     row(3, list(userType(3, null))),
+                     row(4, list(userType(null, 4))));
+ 
+             flush();
+ 
+             assertRows(execute("SELECT * FROM %s"),
+                     row(1, list(userType(1))),
+                     row(2, list(userType(2, 2))),
+                     row(3, list(userType(3, null))),
+                     row(4, list(userType(null, 4))));
+         }
+     }
  }


Mime
View raw message