mimaison commented on code in PR #13038: URL: https://github.com/apache/kafka/pull/13038#discussion_r1057264707
########## core/src/main/scala/kafka/log/UnifiedLog.scala: ########## @@ -444,13 +444,12 @@ class UnifiedLog(@volatile var logStartOffset: Long, */ def maybeUpdateHighWatermark(hw: Long): Option[Long] = { lock.synchronized { - val oldHighWatermark = highWatermarkMetadata - updateHighWatermark(LogOffsetMetadata(hw)) match { - case oldHighWatermark.messageOffset => - None - case newHighWatermark => - Some(newHighWatermark) - } + val oldHighWatermark = highWatermarkMetadata.messageOffset() + val updatedHighWatermark = updateHighWatermark(new LogOffsetMetadata(hw)) + if (updatedHighWatermark == oldHighWatermark) + None + else + Some(updatedHighWatermark) Review Comment: I was required previously as we can't have getters as an `case` option. Now that we're moving to public fields this change is not needed anymore, so I'll revert it. -- 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