junrao commented on code in PR #23316:
URL: https://github.com/apache/kafka/pull/23316#discussion_r3954218882
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java:
##########
@@ -944,6 +944,20 @@ public int numberOfSegments() {
return localLog.segments().numberOfSegments();
}
+ /**
+ * Append the largest time index entry to the time index of the active
segment and trim the log and indexes.
+ * This is the same operation performed when rolling a segment and should
be called before flushing and
+ * closing the log during shutdown.
+ */
+ public void prepareActiveSegmentForClose() {
Review Comment:
With this change, FileRecords.close() doesn't need to call trim() and
flush().
--
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]