Copilot commented on code in PR #20574:
URL: https://github.com/apache/kafka/pull/20574#discussion_r2371934925
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsTopology.java:
##########
@@ -95,4 +97,42 @@ public static StreamsTopology
fromHeartbeatRequest(StreamsGroupHeartbeatRequestD
.collect(Collectors.toMap(StreamsGroupTopologyValue.Subtopology::subtopologyId,
x -> x));
return new StreamsTopology(topology.epoch(), subtopologyMap);
}
+
+ public StreamsGroupDescribeResponseData.Topology
asStreamsGroupDescribeTopology() {
+ return new StreamsGroupDescribeResponseData.Topology()
+ .setEpoch(topologyEpoch)
+ .setSubtopologies(
+ subtopologies.entrySet().stream().map(
+ entry -> asStreamsGroupDescribeSubtopology(entry.getKey(),
entry.getValue())
+ ).toList()
Review Comment:
The subtopologies should be sorted by subtopology ID to ensure consistent
ordering in the response, similar to how the test expects sorted subtopologies.
```suggestion
subtopologies.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.map(entry ->
asStreamsGroupDescribeSubtopology(entry.getKey(), entry.getValue()))
.toList()
```
--
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]