mjsax commented on code in PR #20326:
URL: https://github.com/apache/kafka/pull/20326#discussion_r2281015201


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java:
##########
@@ -461,120 +466,119 @@ public Set<String> makeReady(final Map<String, 
InternalTopicConfig> topics) {
         // have existed with the expected number of partitions, or some create 
topic returns fatal errors.
         log.debug("Starting to validate internal topics {} in partition 
assignor.", topics);
 
-        long currentWallClockMs = time.milliseconds();
+        final long currentWallClockMs = time.milliseconds();
         final long deadlineMs = currentWallClockMs + retryTimeoutMs;
 
-        Set<String> topicsNotReady = new HashSet<>(topics.keySet());
-        final Set<String> newlyCreatedTopics = new HashSet<>();
+        final Set<String> topicsNotReady = new HashSet<>(topics.keySet());
+        final Set<String> newTopics = new HashSet<>();

Review Comment:
   Next, we have `computeTopicsToCreate(...)` -- here we pass in `newTopics` 
which in the end tracks (over all iterations we need), all topics we do create 
-- the difference to the return value of `computeTopicsToCreate(...)` is that 
the method may return a subset of topic only, which we would create in the 
current iteration.
   
   Again, it seems not to be clean to pass `newTopics` into 
`computeTopicsToCreate(...)` to begin with, and we should instead add newly 
created topic after they where created, so maybe we should do:
   ```
   final Set<String> createdTopics = createTopics(topicsToCreate, deadlineMs); 
topicsNotReady.removeAll(createdTopics);
   newTopic.addAll(createdTopics); // for this case, it would make sense not to 
rename the variable to `newlyCreatedTopics` as I proposed originally?
   ```



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

Reply via email to