dajac commented on code in PR #17444:
URL: https://github.com/apache/kafka/pull/17444#discussion_r1818704285


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/TopicMetadata.java:
##########
@@ -41,10 +41,25 @@ public class TopicMetadata {
      */
     private final int numPartitions;
 
+    /**
+     * Map of every partition Id to a set of its rack Ids, if they exist.
+     * If rack information is unavailable for all partitions, this is an empty 
map.
+     */
+    private final Map<Integer, Set<String>> partitionRacks;

Review Comment:
   > Maybe we should revert the structure from `partition -> racks` to `rack -> 
partitions` for the following reasons:
   > 
   > 1. The number of racks is typically smaller than the number of partitions, 
so this new structure can reduce duplicate information.
   > 2. The size of a rack (string) is usually larger than a partition (int), 
so it's better to duplicate partitions rather than racks.
   > 3. If the size of the new structure is acceptable, we could use it instead 
of a hash to avoid calculating a hash for the entire structure, as we can 
leverage a map/set for a quick equality check.
   
   I'd like to get rid of `TopicMetadata` :).



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