[
https://issues.apache.org/jira/browse/KAFKA-21454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
I-Chau Wang reassigned KAFKA-21454:
-----------------------------------
Assignee: I-Chau Wang (was: Chia-Ping Tsai)
> DescribeShareGroupOffsetsRequest could leverage mapKey to avoid creating
> extra collection
> -----------------------------------------------------------------------------------------
>
> Key: KAFKA-21454
> URL: https://issues.apache.org/jira/browse/KAFKA-21454
> Project: Kafka
> Issue Type: Improvement
> Reporter: Chia-Ping Tsai
> Assignee: I-Chau Wang
> Priority: Minor
>
>
> {code:java}
> Map<String, DescribeShareGroupOffsetsRequestTopic>
> requestTopics = new HashMap<>();
> for (TopicPartition tp : spec.topicPartitions()) {
> requestTopics.computeIfAbsent(tp.topic(), t ->
> new DescribeShareGroupOffsetsRequestTopic()
> .setTopicName(tp.topic())
> .setPartitions(new ArrayList<>()))
> .partitions()
> .add(tp.partition());
> }
> {code}
> The {{requestTopics}} map could be removed if {{TopicName}} is marked as
> {{{}mapKey{}}}.
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)