mingyen066 commented on code in PR #19062:
URL: https://github.com/apache/kafka/pull/19062#discussion_r1981696171


##########
raft/src/main/java/org/apache/kafka/raft/internals/LogHistory.java:
##########
@@ -76,42 +75,5 @@ public interface LogHistory<T> {
      */
     void clear();
 
-    final class Entry<T> {
-        private final long offset;
-        private final T value;
-
-        public Entry(long offset, T value) {
-            this.offset = offset;
-            this.value = value;
-        }
-
-        public long offset() {
-            return offset;
-        }
-
-        public T value() {
-            return value;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) return true;
-            if (o == null || getClass() != o.getClass()) return false;
-
-            Entry<?> that = (Entry<?>) o;
-
-            if (offset != that.offset) return false;
-            return Objects.equals(value, that.value);
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hash(offset, value);
-        }
-
-        @Override
-        public String toString() {
-            return String.format("Entry(offset=%d, value=%s)", offset, value);
-        }
-    }
+    record Entry<T>(long offset, T value) { }

Review Comment:
   Yes, we could. But I think we might lose some readibility since something 
like `votersEntry.get().offset()` will be refactored to 
`votersEntry.get().getKey()`



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to