showuon commented on code in PR #15050:
URL: https://github.com/apache/kafka/pull/15050#discussion_r1432303423
##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -1585,6 +1585,12 @@ class UnifiedLog(@volatile var logStartOffset: Long,
def onlyLocalLogSegmentsSize: Long =
UnifiedLog.sizeInBytes(logSegments.stream.filter(_.baseOffset >=
highestOffsetInRemoteStorage).collect(Collectors.toList[LogSegment]))
+ /**
+ * The log size in bytes for all segments that are only in remote log.
+ */
+ def onlyRemoteLogSegmentsSize: Long =
+ UnifiedLog.sizeInBytes(logSegments.stream.filter(_.baseOffset <
highestOffsetInRemoteStorage).collect(Collectors.toList[LogSegment]))
Review Comment:
We can calculate the size of remote-only-log-segments from remote log
metadata (i.e. `RemoteLogSegmentMetadata#segmentSizeInBytes`). So I think we
can record the size at the same place I did for remoteLogMetadataCount
[here](https://github.com/apache/kafka/pull/15026/files#diff-380e4d8859ea9148f21794c09039425c82d9012a392c2dbbe1ce2ec8677a1970R1005).
--
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]