satishd commented on code in PR #14034: URL: https://github.com/apache/kafka/pull/14034#discussion_r1442402573
########## core/src/main/scala/kafka/log/UnifiedLog.scala: ########## @@ -1441,9 +1442,9 @@ class UnifiedLog(@volatile var logStartOffset: Long, * (if there is one). It returns true iff the segment is deletable. * @return the segments ready to be deleted */ - private[log] def deletableSegments(predicate: (LogSegment, Option[LogSegment]) => Boolean): Iterable[LogSegment] = { - def isSegmentEligibleForDeletion(nextSegmentOpt: Option[LogSegment], upperBoundOffset: Long): Boolean = { - val allowDeletionDueToLogStartOffsetIncremented = nextSegmentOpt.isDefined && logStartOffset >= nextSegmentOpt.get.baseOffset + private[log] def deletableSegments(predicate: (LogSegment, Optional[LogSegment]) => Boolean): Iterable[LogSegment] = { Review Comment: I thought these could be addressed when `UnifiedLog` is refactored and moved to storage module. ########## core/src/main/scala/kafka/log/UnifiedLog.scala: ########## @@ -1441,9 +1442,9 @@ class UnifiedLog(@volatile var logStartOffset: Long, * (if there is one). It returns true iff the segment is deletable. * @return the segments ready to be deleted */ - private[log] def deletableSegments(predicate: (LogSegment, Option[LogSegment]) => Boolean): Iterable[LogSegment] = { - def isSegmentEligibleForDeletion(nextSegmentOpt: Option[LogSegment], upperBoundOffset: Long): Boolean = { - val allowDeletionDueToLogStartOffsetIncremented = nextSegmentOpt.isDefined && logStartOffset >= nextSegmentOpt.get.baseOffset + private[log] def deletableSegments(predicate: (LogSegment, Optional[LogSegment]) => Boolean): Iterable[LogSegment] = { Review Comment: I thought these could be addressed when `UnifiedLog` is refactored and moved to storage module. -- 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