szetszwo commented on code in PR #1020:
URL: https://github.com/apache/ratis/pull/1020#discussion_r1457961898
##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/LogSegment.java:
##########
@@ -452,9 +453,17 @@ public String toString() {
"log-" + startIndex + "_" + endIndex;
}
- @Override
- @SuppressFBWarnings("EQ_COMPARETO_USE_OBJECT_EQUALS")
- public int compareTo(Long l) {
+ /** Comparator to find <code>index</code> in list of
<code>LogSegment</code>s. */
+ static final Comparator<Object> SEGMENT_TO_INDEX_COMPARATOR = (o1, o2) -> {
Review Comment:
The `Comparator<Object>` is a great idea! I was thinking implementing
binary search on our own.
--
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]