cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject [8/8] cassandra git commit: Merge branch cassandra-3.11 into trunk
Date Fri, 14 Jul 2017 15:31:37 GMT
Merge branch cassandra-3.11 into trunk


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

Branch: refs/heads/trunk
Commit: e0ce6ce77d38db1890c5f2bccba1f19fdfe256be
Parents: 465cfd5 7aa89a6
Author: Benjamin Lerer <b.lerer@gmail.com>
Authored: Fri Jul 14 17:21:19 2017 +0200
Committer: Benjamin Lerer <b.lerer@gmail.com>
Committed: Fri Jul 14 17:23:36 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |   7 +-
 .../apache/cassandra/db/ColumnFamilyStore.java  |   3 +-
 src/java/org/apache/cassandra/db/DataRange.java |   5 +
 .../cassandra/db/PartitionRangeReadCommand.java |   6 +
 .../org/apache/cassandra/db/ReadCommand.java    |   2 +-
 src/java/org/apache/cassandra/db/ReadQuery.java |  12 +
 .../db/SinglePartitionReadCommand.java          |  21 +-
 .../apache/cassandra/db/filter/DataLimits.java  |  73 +++--
 .../apache/cassandra/db/filter/RowFilter.java   |  15 +
 .../apache/cassandra/service/CacheService.java  |   2 +-
 .../apache/cassandra/service/DataResolver.java  |   4 +-
 .../apache/cassandra/service/StorageProxy.java  |   8 +-
 .../service/pager/AbstractQueryPager.java       |   2 +-
 .../service/pager/MultiPartitionPager.java      |   9 +-
 .../org/apache/cassandra/cql3/CQLTester.java    |   8 +-
 .../validation/operations/SelectLimitTest.java  | 279 +++++++++++++++++++
 .../db/rows/UnfilteredRowIteratorsTest.java     |  10 +-
 17 files changed, 412 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 70aae21,edd66e2..44b8ce8
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -105,9 -9,9 +105,10 @@@ Merged from 3.0
   * Fix secondary index queries on COMPACT tables (CASSANDRA-13627)
   * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568)
  Merged from 2.2:
-   * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
-   * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)
-   * Fix nested Tuples/UDTs validation (CASSANDRA-13646)
+  * Fix queries with LIMIT and filtering on clustering columns (CASSANDRA-11223)
+  * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
 - * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)  * Fix nested
Tuples/UDTs validation (CASSANDRA-13646)
++ * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)
++ * Fix nested Tuples/UDTs validation (CASSANDRA-13646)
  
  3.11.0
   * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/DataRange.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java
index bc80907,c3d6e05..1f54f16
--- a/src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java
+++ b/src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java
@@@ -327,10 -331,17 +327,16 @@@ public class PartitionRangeReadCommand 
      }
  
      @Override
+     public boolean selectsFullPartition()
+     {
+         return dataRange.selectsAllPartition() && !rowFilter().hasExpressionOnClusteringOrRegularColumns();
+     }
+ 
+     @Override
      public String toString()
      {
 -        return String.format("Read(%s.%s columns=%s rowfilter=%s limits=%s %s)",
 -                             metadata().ksName,
 -                             metadata().cfName,
 +        return String.format("Read(%s columns=%s rowfilter=%s limits=%s %s)",
 +                             metadata().toString(),
                               columnFilter(),
                               rowFilter(),
                               limits(),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/ReadCommand.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/ReadQuery.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
index dc66711,11444db..ccab218
--- a/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
+++ b/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
@@@ -920,10 -958,17 +920,16 @@@ public class SinglePartitionReadComman
      }
  
      @Override
+     public boolean selectsFullPartition()
+     {
+         return clusteringIndexFilter.selectsAllPartition() && !rowFilter().hasExpressionOnClusteringOrRegularColumns();
+     }
+ 
+     @Override
      public String toString()
      {
 -        return String.format("Read(%s.%s columns=%s rowFilter=%s limits=%s key=%s filter=%s,
nowInSec=%d)",
 -                             metadata().ksName,
 -                             metadata().cfName,
 +        return String.format("Read(%s columns=%s rowFilter=%s limits=%s key=%s filter=%s,
nowInSec=%d)",
 +                             metadata().toString(),
                               columnFilter(),
                               rowFilter(),
                               limits(),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/filter/DataLimits.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/db/filter/RowFilter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/filter/RowFilter.java
index d3fc301,37e1810..cecfede
--- a/src/java/org/apache/cassandra/db/filter/RowFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/RowFilter.java
@@@ -114,6 -128,21 +114,21 @@@ public abstract class RowFilter impleme
      }
  
      /**
+      * Checks if some of the expressions apply to clustering or regular columns.
+      * @return {@code true} if some of the expressions apply to clustering or regular columns,
{@code false} otherwise.
+      */
+     public boolean hasExpressionOnClusteringOrRegularColumns()
+     {
+         for (Expression expression : expressions)
+         {
 -            ColumnDefinition column = expression.column();
++            ColumnMetadata column = expression.column();
+             if (column.isClusteringColumn() || column.isRegular())
+                 return true;
+         }
+         return false;
+     }
+ 
+     /**
       * Filters the provided iterator so that only the row satisfying the expression of this
filter
       * are included in the resulting iterator.
       *

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/service/CacheService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/CacheService.java
index 4cb7470,e209450..479470c
--- a/src/java/org/apache/cassandra/service/CacheService.java
+++ b/src/java/org/apache/cassandra/service/CacheService.java
@@@ -412,11 -439,11 +412,11 @@@ public class CacheService implements Ca
                  {
                      DecoratedKey key = cfs.decorateKey(buffer);
                      int nowInSec = FBUtilities.nowInSeconds();
 -                    SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata,
nowInSec, key);
 +                    SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata(),
nowInSec, key);
                      try (ReadExecutionController controller = cmd.executionController();
UnfilteredRowIterator iter = cmd.queryMemtableAndDisk(cfs, controller))
                      {
-                         CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter,
nowInSec), nowInSec);
+                         CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter,
nowInSec, true), nowInSec);
 -                        return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key),
(IRowCacheEntry)toCache);
 +                        return Pair.create(new RowCacheKey(cfs.metadata(), key), toCache);
                      }
                  }
              });

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/service/DataResolver.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0ce6ce7/test/unit/org/apache/cassandra/db/rows/UnfilteredRowIteratorsTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/rows/UnfilteredRowIteratorsTest.java
index 9e0dd0c,cce8599..ccf9781
--- a/test/unit/org/apache/cassandra/db/rows/UnfilteredRowIteratorsTest.java
+++ b/test/unit/org/apache/cassandra/db/rows/UnfilteredRowIteratorsTest.java
@@@ -106,15 -110,15 +106,15 @@@ public class UnfilteredRowIteratorsTes
                     row(3, cell(v1Metadata, 3)), row(4, cell(v1Metadata, 4)));
  
          // concat with CQL limits
 -        iter1 = rows(metadata.partitionColumns(), 1,
 +        iter1 = rows(metadata.regularAndStaticColumns(), 1,
                       row(1, cell(v1Metadata, 1), cell(v2Metadata, 1)),
                       row(2, cell(v1Metadata, 2), cell(v2Metadata, 2)));
 -        iter2 = rows(metadata.partitionColumns(), 1,
 +        iter2 = rows(metadata.regularAndStaticColumns(), 1,
                       row(3, cell(v1Metadata, 3), cell(v2Metadata, 3)),
                       row(4, cell(v1Metadata, 4), cell(v2Metadata, 4)));
-         concat = UnfilteredRowIterators.concat(DataLimits.cqlLimits(1).filter(iter1, FBUtilities.nowInSeconds()),
-                                                DataLimits.cqlLimits(1).filter(iter2, FBUtilities.nowInSeconds()));
+         concat = UnfilteredRowIterators.concat(DataLimits.cqlLimits(1).filter(iter1, FBUtilities.nowInSeconds(),
true),
+                                                DataLimits.cqlLimits(1).filter(iter2, FBUtilities.nowInSeconds(),
true));
 -        Assert.assertEquals(concat.columns(), metadata.partitionColumns());
 +        Assert.assertEquals(concat.columns(), metadata.regularAndStaticColumns());
          assertRows(concat,
                     row(1, cell(v1Metadata, 1), cell(v2Metadata, 1)),
                     row(3, cell(v1Metadata, 3), cell(v2Metadata, 3)));
@@@ -127,15 -131,15 +127,15 @@@
                       row(3, cell(v1Metadata, 3), cell(v2Metadata, 3)),
                       row(4, cell(v1Metadata, 4), cell(v2Metadata, 4)));
  
-         concat = UnfilteredRowIterators.concat(DataLimits.cqlLimits(1).filter(iter1, FBUtilities.nowInSeconds()),
-                                                DataLimits.cqlLimits(1).filter(iter2, FBUtilities.nowInSeconds()));
+         concat = UnfilteredRowIterators.concat(DataLimits.cqlLimits(1).filter(iter1, FBUtilities.nowInSeconds(),
true),
+                                                DataLimits.cqlLimits(1).filter(iter2, FBUtilities.nowInSeconds(),
true));
  
 -        iter3 = rows(metadata.partitionColumns(), 1,
 +        iter3 = rows(metadata.regularAndStaticColumns(), 1,
                       row(4, cell(v1Metadata, 4), cell(v2Metadata, 4)),
                       row(5, cell(v1Metadata, 5), cell(v2Metadata, 5)));
-         concat = UnfilteredRowIterators.concat(concat, DataLimits.cqlLimits(1).filter(iter3,
FBUtilities.nowInSeconds()));
+         concat = UnfilteredRowIterators.concat(concat, DataLimits.cqlLimits(1).filter(iter3,
FBUtilities.nowInSeconds(), true));
  
 -        Assert.assertEquals(concat.columns(), metadata.partitionColumns());
 +        Assert.assertEquals(concat.columns(), metadata.regularAndStaticColumns());
          assertRows(concat,
                     row(1, cell(v1Metadata, 1), cell(v2Metadata, 1)),
                     row(3, cell(v1Metadata, 3), cell(v2Metadata, 3)),


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


Mime
View raw message