mimaison commented on code in PR #19030: URL: https://github.com/apache/kafka/pull/19030#discussion_r1970379536
########## core/src/main/scala/kafka/raft/KafkaMetadataLog.scala: ########## @@ -109,14 +103,17 @@ final class KafkaMetadataLog private ( } private def handleAndConvertLogAppendInfo(appendInfo: internals.log.LogAppendInfo): LogAppendInfo = { - if (appendInfo.firstOffset != JUnifiedLog.UNKNOWN_OFFSET) + if (appendInfo.firstOffset != UnifiedLog.UNKNOWN_OFFSET) new LogAppendInfo(appendInfo.firstOffset, appendInfo.lastOffset) else throw new KafkaException(s"Append failed unexpectedly") } override def lastFetchedEpoch: Int = { - log.latestEpoch.getOrElse { + val le = log.latestEpoch + if (le.isPresent) + le.get() + else { Review Comment: I was having issues with `orElse()` probably because of the implicit conversion between `Integer` to `Int` so resorted to the good old if/else. -- 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