dcapwell commented on code in PR #4257:
URL: https://github.com/apache/cassandra/pull/4257#discussion_r2211279866
##########
src/java/org/apache/cassandra/index/accord/SSTableIndex.java:
##########
@@ -81,11 +82,13 @@ public static SSTableIndex create(IndexDescriptor id)
throws IOException
return new SSTableIndex(id, files, segments, cleanup);
}
- public Collection<? extends ByteBuffer> search(Group group, byte[] key)
+ public Collection<? extends ByteBuffer> search(Key group, byte[] key,
Timestamp minTimestamp, Timestamp maxTimestamp)
{
List<Segment> matches = segments.stream().filter(s -> {
Segment.Metadata metadata =
s.groups.get(group);
if (metadata == null) return false;
+ if
(metadata.maxTimestamp.compareTo(minTimestamp) < 0 ||
metadata.minTimestamp.compareTo(maxTimestamp) > 0)
Review Comment:
only do a metadata filter for segments. The thinking is that
`org.apache.cassandra.service.accord.RangeSearcher.DefaultResult#consume(java.util.function.Consumer<accord.primitives.TxnId>)`
is going to do the filtering on the actual values, so don't get a benefit by
filtering out within a segment (its already going to do that)
--
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]