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


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/RackAwareTaskAssignor.java:
##########
@@ -48,23 +49,25 @@ public class RackAwareTaskAssignor {
 
     private final Cluster fullMetadata;
     private final Map<TaskId, Set<TopicPartition>> partitionsForTask;
-    private final Map<UUID, Map<String, Optional<String>>> racksForProcess;
+    private final Map<UUID, Map<String, Optional<String>>> 
racksForProcessConsumer;
     private final AssignmentConfigs assignmentConfigs;
     private final Map<TopicPartition, Set<String>> racksForPartition;
+    private final Map<UUID, String> racksForProcess;
     private final InternalTopicManager internalTopicManager;
 
     public RackAwareTaskAssignor(final Cluster fullMetadata,
                                  final Map<TaskId, Set<TopicPartition>> 
partitionsForTask,
                                  final Map<Subtopology, Set<TaskId>> 
tasksForTopicGroup,
-                                 final Map<UUID, Map<String, 
Optional<String>>> racksForProcess,
+                                 final Map<UUID, Map<String, 
Optional<String>>> racksForProcessConsumer,
                                  final InternalTopicManager 
internalTopicManager,
                                  final AssignmentConfigs assignmentConfigs) {
         this.fullMetadata = fullMetadata;
         this.partitionsForTask = partitionsForTask;
-        this.racksForProcess = racksForProcess;
+        this.racksForProcessConsumer = racksForProcessConsumer;

Review Comment:
   Looking into the code, it seems we store `racksForProcessConsumer` only to 
verify if the same `rack.id` is set for all consumers inside 
`validateClientRack()` -- thus, I am wondering if we should do this check right 
away in the constructor and not have it as a member variable to begin with? In 
the end, we only need the new `racksForProcess` only (if it's set).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to