apourchet commented on code in PR #16033:
URL: https://github.com/apache/kafka/pull/16033#discussion_r1610768911


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/RackAwareTaskAssignor.java:
##########
@@ -486,12 +486,12 @@ public long optimizeStandbyTasks(final SortedMap<UUID, 
ClientState> clientStates
                         .sorted()
                         .collect(Collectors.toList());
 
-                    final Map<TaskId, UUID> taskClientMap = new HashMap<>();
                     final List<UUID> clients = Stream.of(clientList.get(i), 
clientList.get(j))
                         .sorted().collect(
                             Collectors.toList());
-                    final Map<UUID, Integer> originalAssignedTaskNumber = new 
HashMap<>();
 
+                    final Map<TaskId, UUID> taskClientMap = new HashMap<>();
+                    final Map<UUID, Integer> originalAssignedTaskNumber = new 
HashMap<>();

Review Comment:
   I moved this lower down to show them clearly initialized empty right before 
the function call. It turns out there parameters are used as outputs, which is 
why I added the `AssignmentGraph` inner class to the `TaskAssignmentUtils`, in 
order to simplify the usage of the graph functions.



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