blambov commented on code in PR #4114:
URL: https://github.com/apache/cassandra/pull/4114#discussion_r2058482236
##########
src/java/org/apache/cassandra/cache/ChunkCache.java:
##########
@@ -326,4 +327,13 @@ public long weightedSize()
.map(policy ->
policy.weightedSize().orElseGet(cache::estimatedSize))
.orElseGet(cache::estimatedSize);
}
+
+ /**
+ * Returns the number of cached chunks of given file.
+ */
+ @VisibleForTesting
+ public int sizeOfFile(String filePath)
+ {
+ return (int) cache.asMap().keySet().stream().filter(x ->
x.path.equals(filePath)).count();
Review Comment:
It is only meant to be used in tests.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]