guozhangwang commented on code in PR #14149:
URL: https://github.com/apache/kafka/pull/14149#discussion_r1286454991


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java:
##########
@@ -618,18 +618,24 @@ private boolean assignTasksToClients(final Cluster 
fullMetadata,
         final boolean lagComputationSuccessful =
             populateClientStatesMap(clientStates, clientMetadataMap, 
taskForPartition, changelogTopics);
 
-        log.info("{} members participating in this rebalance: \n{}.",
-                clientStates.size(),
-                clientStates.entrySet().stream()
-                        .sorted(comparingByKey())
-                        .map(entry -> entry.getKey() + ": " + 
entry.getValue().consumers())
-                        .collect(Collectors.joining(Utils.NL)));
+
+        log.info("{} client nodes and {} consumers participating in this 
rebalance: \n{}.",
+                 clientStates.size(),
+                 
clientStates.values().stream().map(ClientState::capacity).reduce(Integer::sum),
+                 clientStates.entrySet().stream()
+                     .sorted(comparingByKey())
+                     .map(entry -> entry.getKey() + ": " + 
entry.getValue().consumers())
+                     .collect(Collectors.joining(Utils.NL)));
 
         final Set<TaskId> allTasks = partitionsForTask.keySet();
         statefulTasks.addAll(changelogTopics.statefulTaskIds());
 
-        log.debug("Assigning tasks {} including stateful {} to clients {} with 
number of replicas {}",
-            allTasks, statefulTasks, clientStates, numStandbyReplicas());
+        log.info("Assigning stateful tasks: {}\n"
+                     + "and stateless tasks: {}",
+                 statefulTasks,
+                 allTasks.removeAll(statefulTasks));

Review Comment:
   Won't this change the content of `allTasks`? Also `removeAll` returns a 
boolean.



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java:
##########
@@ -1063,9 +1071,13 @@ private Map<TaskId, Set<TopicPartition>> 
buildStandbyTaskMap(final String consum
         }
 
         for (final TaskId task : revokedTasks) {
-            if (allStatefulTasks.contains(task)) {

Review Comment:
   Not sure I fully understand the change here either. Would appreciate some 
more explanations --- specifically, could you give a simple example in the PR 
description?



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