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


##########
group-coordinator/group-coordinator-api/src/main/java/org/apache/kafka/coordinator/group/api/assignor/GroupSpec.java:
##########
@@ -35,11 +35,24 @@ public interface GroupSpec {
     SubscriptionType subscriptionType();
 
     /**
+     * @param topicId           Uuid corresponding to the partition's topic.

Review Comment:
   nit: Let's add a first sentence too while we are doing changes here.



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleAssignor.java:
##########
@@ -373,13 +364,8 @@ private List<TopicIdPartition> computeTargetPartitions(
                 );
             }
 
-            // Since we are returning a list here, we can keep it sorted
-            // to add determinism while testing and iterating.
-            
targetPartitions.addAll(subscribedTopicDescriber.assignablePartitions(topicId).stream()
-                .sorted()
-                .map(partition -> new TopicIdPartition(topicId, partition))
-                .toList()
-            );
+            IntStream.range(0, numPartitions).filter(partition -> 
groupSpec.isPartitionAssignable(topicId, partition))

Review Comment:
   A good old for loop will be faster. :)



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