wcarlson5 commented on a change in pull request #9572: URL: https://github.com/apache/kafka/pull/9572#discussion_r525464495
########## File path: streams/src/main/java/org/apache/kafka/streams/state/internals/ThreadCache.java ########## @@ -71,6 +72,26 @@ public long flushes() { return numFlushes; } + public void resize(final long maxCacheSizeBytes) { + final boolean shrink = maxCacheSizeBytes < this.maxCacheSizeBytes; + this.maxCacheSizeBytes = maxCacheSizeBytes; + if (shrink) { + final CircularIterator<NamedCache> circularIterator = new CircularIterator<>(caches.values()); + while (sizeBytes() > maxCacheSizeBytes) { + if (!circularIterator.hasNext()) { + log.error("Unable to remove any more entries as all caches are empty"); Review comment: Yeah, in retrospect it was not very clear. Hopefully its better this way now ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org