adixitconfluent commented on code in PR #18864:
URL: https://github.com/apache/kafka/pull/18864#discussion_r1960968611
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleAssignor.java:
##########
@@ -111,12 +258,26 @@ private Map<Uuid, Set<Integer>> computeTargetPartitions(
);
}
- Set<Integer> partitions = new HashSet<>();
for (int i = 0; i < numPartitions; i++) {
- partitions.add(i);
+ targetPartitions.add(new TargetPartition(topicId, i));
}
- targetPartitions.put(topicId, partitions);
});
return targetPartitions;
}
+
+ record TargetPartition(Uuid topicId, int partition) {
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ TargetPartition that = (TargetPartition) o;
+ return topicId.equals(that.topicId) && partition == that.partition;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(topicId, partition);
+ }
Review Comment:
used `org.apache.kafka.server.common.TopicIdPartition`, so we don't need
TargetPartition now.
--
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]