ifesdjeen commented on code in PR #4392:
URL: https://github.com/apache/cassandra/pull/4392#discussion_r2383274512
##########
src/java/org/apache/cassandra/journal/Segments.java:
##########
@@ -128,6 +128,28 @@ void selectActive(long maxTimestamp,
Collection<ActiveSegment<K, V>> into)
into.add(segment.asActive());
}
+ void select(long minTimestamp, long maxTimestamp, Collection<Segment<K,
V>> into)
+ {
+ // TODO (required): use binary search in the sorted structure!
+ for (Segment<K, V> segment : segments.values())
+ if (segment.descriptor.timestamp >= minTimestamp &&
segment.descriptor.timestamp <= maxTimestamp)
+ into.add(segment);
+ }
+
+ Segment<K, V>[] select(long[] segmentIds)
+ {
+ @SuppressWarnings({ "unchecked" })
+ Segment<K, V>[] segments = new Segment[segmentIds.length];
+ for (int i = 0; i < segmentIds.length; i++)
+ segments[i] = Invariants.nonNull(this.segments.get(segmentIds[i]));
Review Comment:
actually, removed both methods since I stopped using them eventually
--
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]