mjsax commented on a change in pull request #9572:
URL: https://github.com/apache/kafka/pull/9572#discussion_r525540418



##########
File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
##########
@@ -806,6 +803,20 @@ private KafkaStreams(final InternalTopologyBuilder 
internalTopologyBuilder,
         rocksDBMetricsRecordingService = 
maybeCreateRocksDBMetricsRecordingService(clientId, config);
     }
 
+    private long getCacheSizePerThread(final int numStreamThreads) {
+        return totalCacheSize / (numStreamThreads + ((globalTaskTopology != 
null) ? 1 : 0));
+    }
+
+    private void resizeThreadCache(final int numStreamThreads) {
+        if (numStreamThreads < 0) {

Review comment:
       Yes, it can be zero, but the check says `< 0`, so it would always 
evaluate to false?
   
   And if we have zero threads, we should not resize the cache as we might end 
up in an infinite loop? But we would only call this method if we "shrink", ie, 
if the thread count grows, but it can never grow from negative to zero, right?




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


Reply via email to