kamalcph commented on code in PR #15050:
URL: https://github.com/apache/kafka/pull/15050#discussion_r1432252882


##########
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:
   The `logSegments` points to the local-log segments, we cannot calculate the 
size of remote-only-log-segments from here.



-- 
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]

Reply via email to