You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2013/09/11 08:36:31 UTC

[1/4] git commit: Allow empty CQL3 batches as no-op

Updated Branches:
  refs/heads/trunk 0132b71a0 -> 972184bf7


Allow empty CQL3 batches as no-op

patch by slebresne; reviewed by iamaleksey for CASSANDRA-5994


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

Branch: refs/heads/trunk
Commit: 9b545caab5376e7f6e43aba49888df662a5d6e0d
Parents: fd12966
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed Sep 11 08:29:25 2013 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed Sep 11 08:29:25 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                              | 1 +
 src/java/org/apache/cassandra/cql3/Cql.g | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b545caa/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 12e2017..cfcb364 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,7 @@
  * Correctly handle limits in CompositesSearcher (CASSANDRA-5975)
  * Pig: handle CQL collections (CASSANDRA-5867)
  * Pass the updated cf to the PRSI index() method (CASSANDRA-5999)
+ * Allow empty CQL3 batches (as no-op) (CASSANDRA-5994)
 
 
 1.2.9

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b545caa/src/java/org/apache/cassandra/cql3/Cql.g
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/Cql.g b/src/java/org/apache/cassandra/cql3/Cql.g
index f59be51..2445bf2 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -386,7 +386,7 @@ batchStatement returns [BatchStatement expr]
     : K_BEGIN
       ( K_UNLOGGED { type = BatchStatement.Type.UNLOGGED; } | K_COUNTER { type = BatchStatement.Type.COUNTER; } )?
       K_BATCH ( usingClause[attrs] )?
-          ( s=batchStatementObjective ';'? { statements.add(s); } )+
+          ( s=batchStatementObjective ';'? { statements.add(s); } )*
       K_APPLY K_BATCH
       {
           return new BatchStatement(type, statements, attrs);


[4/4] git commit: Merge branch 'cassandra-2.0' into trunk

Posted by sl...@apache.org.
Merge branch 'cassandra-2.0' into trunk


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

Branch: refs/heads/trunk
Commit: 972184bf750c0340f6ca2a13ee39347d173b5e79
Parents: 0132b71 2c84b14
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed Sep 11 08:36:21 2013 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed Sep 11 08:36:21 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 src/java/org/apache/cassandra/cql3/Cql.g        |  2 +-
 .../cassandra/cql3/functions/TimeuuidFcts.java  | 24 ++++++++++++++++----
 .../cassandra/cql3/functions/TokenFct.java      |  7 +++++-
 4 files changed, 29 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/972184bf/CHANGES.txt
----------------------------------------------------------------------


[3/4] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

Posted by sl...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0

Conflicts:
	src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java


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

Branch: refs/heads/trunk
Commit: 2c84b1403f9bfdaf563f62c6d1751f80627e9915
Parents: f6fda9c 8bedb57
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed Sep 11 08:35:24 2013 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed Sep 11 08:35:24 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 src/java/org/apache/cassandra/cql3/Cql.g        |  2 +-
 .../cassandra/cql3/functions/TimeuuidFcts.java  | 24 ++++++++++++++++----
 .../cassandra/cql3/functions/TokenFct.java      |  7 +++++-
 4 files changed, 29 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c84b140/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 808c558,e420a7b..68829d8
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -27,54 -11,15 +27,56 @@@ Merged from 1.2
   * Correctly handle limits in CompositesSearcher (CASSANDRA-5975)
   * Pig: handle CQL collections (CASSANDRA-5867)
   * Pass the updated cf to the PRSI index() method (CASSANDRA-5999)
+  * Allow empty CQL3 batches (as no-op) (CASSANDRA-5994)
+  * Support null in CQL3 functions (CASSANDRA-5910)
  
  
 -1.2.9
 +2.0.0
 + * Fix thrift validation when inserting into CQL3 tables (CASSANDRA-5138)
 + * Fix periodic memtable flushing behavior with clean memtables (CASSANDRA-5931)
 + * Fix dateOf() function for pre-2.0 timestamp columns (CASSANDRA-5928)
 + * Fix SSTable unintentionally loads BF when opened for batch (CASSANDRA-5938)
 + * Add stream session progress to JMX (CASSANDRA-4757)
 + * Fix NPE during CAS operation (CASSANDRA-5925)
 +Merged from 1.2:
   * Fix getBloomFilterDiskSpaceUsed for AlwaysPresentFilter (CASSANDRA-5900)
 - * migrate 1.1 schema_columnfamilies.key_alias column to key_aliases
 -   (CASSANDRA-5800)
 - * add --migrate option to sstableupgrade and sstablescrub (CASSANDRA-5831)
 + * Don't announce schema version until we've loaded the changes locally
 +   (CASSANDRA-5904)
 + * Fix to support off heap bloom filters size greater than 2 GB (CASSANDRA-5903)
 + * Properly handle parsing huge map and set literals (CASSANDRA-5893)
 +
 +
 +2.0.0-rc2
 + * enable vnodes by default (CASSANDRA-5869)
 + * fix CAS contention timeout (CASSANDRA-5830)
 + * fix HsHa to respect max frame size (CASSANDRA-4573)
 + * Fix (some) 2i on composite components omissions (CASSANDRA-5851)
 + * cqlsh: add DESCRIBE FULL SCHEMA variant (CASSANDRA-5880)
 +Merged from 1.2:
 + * Correctly validate sparse composite cells in scrub (CASSANDRA-5855)
 + * Add KeyCacheHitRate metric to CF metrics (CASSANDRA-5868)
 + * cqlsh: add support for multiline comments (CASSANDRA-5798)
 + * Handle CQL3 SELECT duplicate IN restrictions on clustering columns
 +   (CASSANDRA-5856)
 +
 +
 +2.0.0-rc1
 + * improve DecimalSerializer performance (CASSANDRA-5837)
 + * fix potential spurious wakeup in AsyncOneResponse (CASSANDRA-5690)
 + * fix schema-related trigger issues (CASSANDRA-5774)
 + * Better validation when accessing CQL3 table from thrift (CASSANDRA-5138)
 + * Fix assertion error during repair (CASSANDRA-5801)
 + * Fix range tombstone bug (CASSANDRA-5805)
 + * DC-local CAS (CASSANDRA-5797)
 + * Add a native_protocol_version column to the system.local table (CASSANRDA-5819)
 + * Use index_interval from cassandra.yaml when upgraded (CASSANDRA-5822)
 + * Fix buffer underflow on socket close (CASSANDRA-5792)
 +Merged from 1.2:
 + * Fix reading DeletionTime from 1.1-format sstables (CASSANDRA-5814)
 + * cqlsh: add collections support to COPY (CASSANDRA-5698)
 + * retry important messages for any IOException (CASSANDRA-5804)
 + * Allow empty IN relations in SELECT/UPDATE/DELETE statements (CASSANDRA-5626)
 + * cqlsh: fix crashing on Windows due to libedit detection (CASSANDRA-5812)
   * fix bulk-loading compressed sstables (CASSANDRA-5820)
   * (Hadoop) fix quoting in CqlPagingRecordReader and CqlRecordWriter 
     (CASSANDRA-5824)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c84b140/src/java/org/apache/cassandra/cql3/Cql.g
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/Cql.g
index 0e1be34,2445bf2..61bf3c8
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@@ -419,10 -386,10 +419,10 @@@ batchStatement returns [BatchStatement.
      : K_BEGIN
        ( K_UNLOGGED { type = BatchStatement.Type.UNLOGGED; } | K_COUNTER { type = BatchStatement.Type.COUNTER; } )?
        K_BATCH ( usingClause[attrs] )?
-           ( s=batchStatementObjective ';'? { statements.add(s); } )+
+           ( s=batchStatementObjective ';'? { statements.add(s); } )*
        K_APPLY K_BATCH
        {
 -          return new BatchStatement(type, statements, attrs);
 +          return new BatchStatement.Parsed(type, attrs, statements);
        }
      ;
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c84b140/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
index 18ccd56,52eca54..9c69c19
--- a/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
+++ b/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
@@@ -47,7 -47,11 +47,11 @@@ public abstract class TimeuuidFct
      {
          public ByteBuffer execute(List<ByteBuffer> parameters)
          {
-             return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.minTimeUUID(TimestampType.instance.compose(parameters.get(0)).getTime())));
+             ByteBuffer bb = parameters.get(0);
+             if (bb == null)
+                 return null;
+ 
 -            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.minTimeUUID(DateType.instance.compose(bb).getTime())));
++            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.minTimeUUID(TimestampType.instance.compose(bb).getTime())));
          }
      };
  
@@@ -55,7 -59,11 +59,11 @@@
      {
          public ByteBuffer execute(List<ByteBuffer> parameters)
          {
-             return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.maxTimeUUID(TimestampType.instance.compose(parameters.get(0)).getTime())));
+             ByteBuffer bb = parameters.get(0);
+             if (bb == null)
+                 return null;
+ 
 -            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.maxTimeUUID(DateType.instance.compose(bb).getTime())));
++            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.maxTimeUUID(TimestampType.instance.compose(bb).getTime())));
          }
      };
  
@@@ -63,7 -71,11 +71,11 @@@
      {
          public ByteBuffer execute(List<ByteBuffer> parameters)
          {
-             return TimestampType.instance.decompose(new Date(UUIDGen.unixTimestamp(UUIDGen.getUUID(parameters.get(0)))));
+             ByteBuffer bb = parameters.get(0);
+             if (bb == null)
+                 return null;
+ 
 -            return DateType.instance.decompose(new Date(UUIDGen.unixTimestamp(UUIDGen.getUUID(bb))));
++            return TimestampType.instance.decompose(new Date(UUIDGen.unixTimestamp(UUIDGen.getUUID(bb))));
          }
      };
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c84b140/src/java/org/apache/cassandra/cql3/functions/TokenFct.java
----------------------------------------------------------------------


[2/4] git commit: Support null in CQL3 functions

Posted by sl...@apache.org.
Support null in CQL3 functions

patch by slebresne; reviewed by iamaleksey for CASSANDRA-5910


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

Branch: refs/heads/trunk
Commit: 8bedb57207d54c4e88a762221d20d814fc351b1f
Parents: 9b545ca
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed Sep 11 08:31:05 2013 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed Sep 11 08:31:05 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/cql3/functions/TimeuuidFcts.java  | 24 ++++++++++++++++----
 .../cassandra/cql3/functions/TokenFct.java      |  7 +++++-
 3 files changed, 27 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8bedb572/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cfcb364..e420a7b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -12,6 +12,7 @@
  * Pig: handle CQL collections (CASSANDRA-5867)
  * Pass the updated cf to the PRSI index() method (CASSANDRA-5999)
  * Allow empty CQL3 batches (as no-op) (CASSANDRA-5994)
+ * Support null in CQL3 functions (CASSANDRA-5910)
 
 
 1.2.9

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8bedb572/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java b/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
index e325e8f..52eca54 100644
--- a/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
+++ b/src/java/org/apache/cassandra/cql3/functions/TimeuuidFcts.java
@@ -47,7 +47,11 @@ public abstract class TimeuuidFcts
     {
         public ByteBuffer execute(List<ByteBuffer> parameters)
         {
-            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.minTimeUUID(DateType.instance.compose(parameters.get(0)).getTime())));
+            ByteBuffer bb = parameters.get(0);
+            if (bb == null)
+                return null;
+
+            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.minTimeUUID(DateType.instance.compose(bb).getTime())));
         }
     };
 
@@ -55,7 +59,11 @@ public abstract class TimeuuidFcts
     {
         public ByteBuffer execute(List<ByteBuffer> parameters)
         {
-            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.maxTimeUUID(DateType.instance.compose(parameters.get(0)).getTime())));
+            ByteBuffer bb = parameters.get(0);
+            if (bb == null)
+                return null;
+
+            return ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.maxTimeUUID(DateType.instance.compose(bb).getTime())));
         }
     };
 
@@ -63,7 +71,11 @@ public abstract class TimeuuidFcts
     {
         public ByteBuffer execute(List<ByteBuffer> parameters)
         {
-            return DateType.instance.decompose(new Date(UUIDGen.unixTimestamp(UUIDGen.getUUID(parameters.get(0)))));
+            ByteBuffer bb = parameters.get(0);
+            if (bb == null)
+                return null;
+
+            return DateType.instance.decompose(new Date(UUIDGen.unixTimestamp(UUIDGen.getUUID(bb))));
         }
     };
 
@@ -71,7 +83,11 @@ public abstract class TimeuuidFcts
     {
         public ByteBuffer execute(List<ByteBuffer> parameters)
         {
-            return ByteBufferUtil.bytes(UUIDGen.unixTimestamp(UUIDGen.getUUID(parameters.get(0))));
+            ByteBuffer bb = parameters.get(0);
+            if (bb == null)
+                return null;
+
+            return ByteBufferUtil.bytes(UUIDGen.unixTimestamp(UUIDGen.getUUID(bb)));
         }
     };
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8bedb572/src/java/org/apache/cassandra/cql3/functions/TokenFct.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/TokenFct.java b/src/java/org/apache/cassandra/cql3/functions/TokenFct.java
index 21695ca..28da87a 100644
--- a/src/java/org/apache/cassandra/cql3/functions/TokenFct.java
+++ b/src/java/org/apache/cassandra/cql3/functions/TokenFct.java
@@ -62,8 +62,13 @@ public class TokenFct extends AbstractFunction
     public ByteBuffer execute(List<ByteBuffer> parameters) throws InvalidRequestException
     {
         ColumnNameBuilder builder = cfDef.getKeyNameBuilder();
-        for (ByteBuffer bb : parameters)
+        for (int i = 0; i < parameters.size(); i++)
+        {
+            ByteBuffer bb = parameters.get(i);
+            if (bb == null)
+                return null;
             builder.add(bb);
+        }
         return partitioner.getTokenFactory().toByteArray(partitioner.getToken(builder.build()));
     }
 }