cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/3] git commit: use sstable partitioner for SSTableScanner patch by jbellis; reviewed by Aleksey Yeschenko for CASSANDRA-2524
Date Tue, 27 Aug 2013 02:08:10 GMT
Updated Branches:
  refs/heads/cassandra-2.0 37c7d2396 -> db381eaa0
  refs/heads/trunk 300f1a65c -> 3bba76dd1


use sstable partitioner for SSTableScanner
patch by jbellis; reviewed by Aleksey Yeschenko for CASSANDRA-2524


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

Branch: refs/heads/cassandra-2.0
Commit: db381eaa0823e2d36bec664722fd17714efeecc8
Parents: 37c7d23
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Mon Aug 26 21:07:49 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Mon Aug 26 21:07:49 2013 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java   |  2 +-
 src/java/org/apache/cassandra/dht/Bounds.java             |  2 +-
 .../org/apache/cassandra/io/sstable/SSTableScanner.java   | 10 ++++++----
 3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/db381eaa/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index e04756f..0cd4ef4 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -1477,7 +1477,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
         for (RowCacheKey key : CacheService.instance.rowCache.getKeySet())
         {
-            DecoratedKey dk = StorageService.getPartitioner().decorateKey(ByteBuffer.wrap(key.key));
+            DecoratedKey dk = partitioner.decorateKey(ByteBuffer.wrap(key.key));
             if (key.cfId == metadata.cfId && !Range.isInRanges(dk.token, ranges))
                 invalidateCachedRow(dk);
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/db381eaa/src/java/org/apache/cassandra/dht/Bounds.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/Bounds.java b/src/java/org/apache/cassandra/dht/Bounds.java
index fedc407..a27f6b1 100644
--- a/src/java/org/apache/cassandra/dht/Bounds.java
+++ b/src/java/org/apache/cassandra/dht/Bounds.java
@@ -34,7 +34,7 @@ public class Bounds<T extends RingPosition> extends AbstractBounds<T>
         this(left, right, StorageService.getPartitioner());
     }
 
-    Bounds(T left, T right, IPartitioner partitioner)
+    public Bounds(T left, T right, IPartitioner partitioner)
     {
         super(left, right, partitioner);
         // unlike a Range, a Bounds may not wrap

http://git-wip-us.apache.org/repos/asf/cassandra/blob/db381eaa/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java b/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java
index 13ce706..703b6e9 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableScanner.java
@@ -74,12 +74,12 @@ public class SSTableScanner implements ICompactionScanner
         {
             // split the wrapping range into two parts: 1) the part that starts at the beginning
of the sstable, and
             // 2) the part that comes before the wrap-around
-            boundsList.add(new Bounds<>(sstable.partitioner.getMinimumToken().minKeyBound(),
dataRange.stopKey()));
-            boundsList.add(new Bounds<>(dataRange.startKey(), sstable.partitioner.getMinimumToken().maxKeyBound()));
+            boundsList.add(new Bounds<>(sstable.partitioner.getMinimumToken().minKeyBound(),
dataRange.stopKey(), sstable.partitioner));
+            boundsList.add(new Bounds<>(dataRange.startKey(), sstable.partitioner.getMinimumToken().maxKeyBound(),
sstable.partitioner));
         }
         else
         {
-            boundsList.add(new Bounds<>(dataRange.startKey(), dataRange.stopKey()));
+            boundsList.add(new Bounds<>(dataRange.startKey(), dataRange.stopKey(),
sstable.partitioner));
         }
         this.rangeIterator = boundsList.iterator();
     }
@@ -101,7 +101,9 @@ public class SSTableScanner implements ICompactionScanner
         List<Range<Token>> normalized = Range.normalize(tokenRanges);
         List<AbstractBounds<RowPosition>> boundsList = new ArrayList<>(normalized.size());
         for (Range<Token> range : normalized)
-            boundsList.add(new Range<RowPosition>(range.left.maxKeyBound(sstable.partitioner),
range.right.maxKeyBound(sstable.partitioner)));
+            boundsList.add(new Range<RowPosition>(range.left.maxKeyBound(sstable.partitioner),
+                                                  range.right.maxKeyBound(sstable.partitioner),
+                                                  sstable.partitioner));
 
         this.rangeIterator = boundsList.iterator();
     }


Mime
View raw message