bdeggleston commented on code in PR #4508:
URL: https://github.com/apache/cassandra/pull/4508#discussion_r2600223932


##########
src/java/org/apache/cassandra/journal/Segments.java:
##########
@@ -157,6 +157,10 @@ void select(long minTimestamp, long maxTimestamp, 
Collection<Segment<K, V>> into
         }
     }
 
+    /**
+     * Find index of first segment with timestamp >= given timestamp.
+     * Returns sorted.size() if timestamp greater than all segments.
+     */
     int findIdxFor(long timestamp)

Review Comment:
   It _does..._ but it takes a search key of the same type, so you have to 
instantiate an anonymous Segment instance that stubs out all the abstract 
methods. Before you do that though, you need a fake descriptor instance. Imo 
this is one of those cases where the binary search reimplementation is actually 
cleaner and easier to read. 



-- 
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]

Reply via email to