hudeqi commented on code in PR #14243: URL: https://github.com/apache/kafka/pull/14243#discussion_r1319642559
########## storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java: ########## @@ -494,6 +518,19 @@ public boolean isMarkedForCleanup() { return markedForCleanup; } + public long entrySizeBytes() { + return entrySizeBytes; + } + + public long estimatedEntrySize() { + try { + return Files.size(offsetIndex.file().toPath()) + Files.size(timeIndex.file().toPath()) + Files.size(txnIndex.file().toPath()); + } catch (IOException e) { + log.warn("Error occurred when estimating remote index cache entry bytes size, just set 0 firstly.", e); + return 0L; + } + } Review Comment: Great catch! -- 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