ijuma commented on a change in pull request #10960:
URL: https://github.com/apache/kafka/pull/10960#discussion_r664036719



##########
File path: core/src/main/scala/kafka/log/LogSegment.scala
##########
@@ -386,15 +385,13 @@ class LogSegment private[log] (val log: FileRecords,
   private def loadLargestTimestamp(): Unit = {
     // Get the last time index entry. If the time index is empty, it will 
return (-1, baseOffset)
     val lastTimeIndexEntry = timeIndex.lastEntry
-    maxTimestampSoFar = lastTimeIndexEntry.timestamp
-    offsetOfMaxTimestampSoFar = lastTimeIndexEntry.offset
+    maxTimestampAndOffsetSoFar = TimestampOffset(lastTimeIndexEntry.timestamp, 
lastTimeIndexEntry.offset)

Review comment:
       Why are we creating a new instance here? Isn't `lastIndexEntry` what we 
want already?




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