cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jji...@apache.org
Subject [5/7] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11
Date Mon, 11 Sep 2017 16:38:15 GMT
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/trunk
Commit: fadf2e8392bc41e75d475f9c6a141059c9480f6d
Parents: 0fdbcc3 433f24c
Author: Jeff Jirsa <jjirsa@apple.com>
Authored: Mon Sep 11 09:35:58 2017 -0700
Committer: Jeff Jirsa <jjirsa@apple.com>
Committed: Mon Sep 11 09:36:20 2017 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../cql3/statements/BatchStatement.java         |  36 ++++--
 .../cql3/statements/CQL3CasRequest.java         |  32 ++++++
 .../cql3/statements/ModificationStatement.java  |  15 ++-
 .../org/apache/cassandra/cql3/BatchTests.java   |  51 +++++++--
 .../cql3/validation/operations/BatchTest.java   | 111 +++++++++++++++++++
 6 files changed, 220 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fadf2e83/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 23e6c8b,76d155e..52775e7
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,15 -1,5 +1,16 @@@
 -3.0.15
 +3.11.1
 + * Add a compaction option to TWCS to ignore sstables overlapping checks (CASSANDRA-13418)
 + * BTree.Builder memory leak (CASSANDRA-13754)
 + * Revert CASSANDRA-10368 of supporting non-pk column filtering due to correctness (CASSANDRA-13798)
 + * Fix cassandra-stress hang issues when an error during cluster connection happens (CASSANDRA-12938)
 + * Better bootstrap failure message when blocked by (potential) range movement (CASSANDRA-13744)
 + * "ignore" option is ignored in sstableloader (CASSANDRA-13721)
 + * Deadlock in AbstractCommitLogSegmentManager (CASSANDRA-13652)
 + * Duplicate the buffer before passing it to analyser in SASI operation (CASSANDRA-13512)
 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641)
 +Merged from 3.0:
+  * Range deletes in a CAS batch are ignored (CASSANDRA-13655)
 + * Avoid assertion error when IndexSummary > 2G (CASSANDRA-12014)
   * Change repair midpoint logging for tiny ranges (CASSANDRA-13603)
   * Better handle corrupt final commitlog segment (CASSANDRA-11995)
   * StreamingHistogram is not thread safe (CASSANDRA-13756)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fadf2e83/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fadf2e83/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java
index 5683af4,e14ae6c..47920a4
--- a/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java
@@@ -226,8 -232,14 +232,10 @@@ public class CQL3CasRequest implements 
          PartitionUpdate update = new PartitionUpdate(cfm, key, updatedColumns(), conditions.size());
          for (RowUpdate upd : updates)
              upd.applyUpdates(current, update);
+         for (RangeDeletion upd : rangeDeletions)
+             upd.applyUpdates(current, update);
  
          Keyspace.openAndGetStore(cfm).indexManager.validate(update);
 -
 -        if (isBatch)
 -            BatchStatement.verifyBatchSize(Collections.singleton(update));
 -
          return update;
      }
  
@@@ -260,6 -272,29 +268,30 @@@
          }
      }
  
+     private class RangeDeletion
+     {
+         private final Slice slice;
+         private final ModificationStatement stmt;
+         private final QueryOptions options;
+         private final long timestamp;
+ 
+         private RangeDeletion(Slice slice, ModificationStatement stmt, QueryOptions options,
long timestamp)
+         {
+             this.slice = slice;
+             this.stmt = stmt;
+             this.options = options;
+             this.timestamp = timestamp;
+         }
+ 
+         public void applyUpdates(FilteredPartition current, PartitionUpdate updates) throws
InvalidRequestException
+         {
++            // No slice statements currently require a read, but this maintains consistency
with RowUpdate, and future proofs us
+             Map<DecoratedKey, Partition> map = stmt.requiresRead() ? Collections.<DecoratedKey,
Partition>singletonMap(key, current) : null;
+             UpdateParameters params = new UpdateParameters(cfm, updates.columns(), options,
timestamp, stmt.getTimeToLive(options), map);
+             stmt.addUpdateForKey(updates, slice, params);
+         }
+     }
+ 
      private static abstract class RowCondition
      {
          public final Clustering clustering;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fadf2e83/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index 832d417,0afd34d..c925128
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@@ -406,7 -402,14 +406,14 @@@ public abstract class ModificationState
          return !conditions.isEmpty();
      }
  
+     public boolean hasSlices()
+     {
+         return type.allowClusteringColumnSlices()
 -               && getRestrictions().hasClusteringColumnsRestriction()
++               && getRestrictions().hasClusteringColumnsRestrictions()
+                && getRestrictions().isColumnRange();
+     }
+ 
 -    public ResultMessage execute(QueryState queryState, QueryOptions options)
 +    public ResultMessage execute(QueryState queryState, QueryOptions options, long queryStartNanoTime)
      throws RequestExecutionException, RequestValidationException
      {
          if (options.getConsistency() == null)
@@@ -697,10 -698,10 +702,10 @@@
          }
      }
  
-     private Slices createSlice(QueryOptions options)
+     Slices createSlices(QueryOptions options)
      {
 -        SortedSet<Slice.Bound> startBounds = restrictions.getClusteringColumnsBounds(Bound.START,
options);
 -        SortedSet<Slice.Bound> endBounds = restrictions.getClusteringColumnsBounds(Bound.END,
options);
 +        SortedSet<ClusteringBound> startBounds = restrictions.getClusteringColumnsBounds(Bound.START,
options);
 +        SortedSet<ClusteringBound> endBounds = restrictions.getClusteringColumnsBounds(Bound.END,
options);
  
          return toSlices(startBounds, endBounds);
      }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fadf2e83/test/unit/org/apache/cassandra/cql3/validation/operations/BatchTest.java
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message