cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [03/10] cassandra git commit: Don't query more results than necessary when paging range queries
Date Fri, 22 Jan 2016 14:33:41 GMT
Don't query more results than necessary when paging range queries

patch by slebresne; reviewed by blerer for CASSANDRA-8521


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

Branch: refs/heads/cassandra-3.3
Commit: 7bab8240e63753ac338890cbd31572e38234c23d
Parents: 38dde32
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Tue Jan 12 16:38:38 2016 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Jan 22 15:32:25 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                       | 1 +
 .../org/apache/cassandra/service/pager/RangeSliceQueryPager.java  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7bab8240/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 751267e..54ed851 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.5
+ * Avoid over-fetching during the page of range queries (CASSANDRA-8521)
  * Start L0 STCS-compactions even if there is a L0 -> L1 compaction
    going (CASSANDRA-10979)
  * Make UUID LSB unique per process (CASSANDRA-7925)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7bab8240/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java b/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
index fd14c82..10e470b 100644
--- a/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
+++ b/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
@@ -72,7 +72,8 @@ public class RangeSliceQueryPager extends AbstractQueryPager
     protected List<Row> 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<RowPosition> keyRange = lastReturnedKey == null ? command.keyRange
: makeIncludingKeyBounds(lastReturnedKey);
         Composite start = lastReturnedName == null ? sf.start() : lastReturnedName;
         PagedRangeCommand pageCmd = new PagedRangeCommand(command.keyspace,


Mime
View raw message