dcapwell commented on code in PR #4808:
URL: https://github.com/apache/cassandra/pull/4808#discussion_r3250419283
##########
src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java:
##########
@@ -466,7 +466,7 @@ public static Collection<SSTableReader>
intersecting(Collection<SSTableReader> s
for (SSTableReader sstable : sstables)
{
Range<Token> sstableRange = new
Range<>(sstable.getFirst().getToken(), sstable.getLast().getToken());
Review Comment:
why not just switch to bounds
```
diff --git
a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
index a22f06e562..5ae1ab38c0 100644
---
a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
+++
b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
@@ -48,6 +48,7 @@ import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.ColumnFamilyStore;
import org.apache.cassandra.db.lifecycle.LifecycleTransaction;
import org.apache.cassandra.db.rows.UnfilteredRowIterator;
+import org.apache.cassandra.dht.Bounds;
import org.apache.cassandra.dht.Range;
import org.apache.cassandra.dht.Token;
import org.apache.cassandra.exceptions.ConfigurationException;
@@ -465,8 +466,8 @@ public class LeveledCompactionStrategy extends
AbstractCompactionStrategy
{
for (SSTableReader sstable : sstables)
{
- Range<Token> sstableRange = new
Range<>(sstable.getFirst().getToken(), sstable.getLast().getToken());
- if (range == null || sstableRange.intersects(range))
+ Bounds<Token> sstableRange = new
Bounds<>(sstable.getFirst().getToken(), sstable.getLast().getToken());
+ if (range == null || range.intersects(sstableRange))
filtered.add(sstable);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]