adixitconfluent commented on code in PR #17825:
URL: https://github.com/apache/kafka/pull/17825#discussion_r1844556817
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2426,4 +2421,28 @@ public String toString() {
")";
}
}
+
+ /**
+ * FetchOffsetMetadata class is used to cache offset and its log metadata.
+ */
+ static final class OffsetMetadata {
+ private long offset;
+ private LogOffsetMetadata offsetMetadata;
+
+ OffsetMetadata() {
+ }
Review Comment:
I am not sure if initializing the fields has any benefits. The only value
initialization inside the constructor that makes sense is `offset=-1` i.e. an
invalid case. We don't really need this initialization since we can use
`offsetMetadata() == null` to check if the object `fetchOffsetMetadata` has
been cached yet or not.
--
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]