You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "David Jacot (Jira)" <ji...@apache.org> on 2021/12/08 07:18:00 UTC
[jira] [Updated] (KAFKA-13512) topicIdsToNames and topicNamesToIds allocate unnecessary maps
[ https://issues.apache.org/jira/browse/KAFKA-13512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Jacot updated KAFKA-13512:
--------------------------------
Fix Version/s: 3.1.0
> topicIdsToNames and topicNamesToIds allocate unnecessary maps
> -------------------------------------------------------------
>
> Key: KAFKA-13512
> URL: https://issues.apache.org/jira/browse/KAFKA-13512
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 3.1.0
> Reporter: Justine Olshan
> Assignee: Justine Olshan
> Priority: Blocker
> Fix For: 3.1.0
>
>
> Currently we write the methods as follows:
> {{def topicNamesToIds(): util.Map[String, Uuid] = {}}
> {{ new util.HashMap(metadataSnapshot.topicIds.asJava)}}
> {{}}}
> We do not need to allocate a new map however, we can simply use
> {{Collections.unmodifiableMap(metadataSnapshot.topicIds.asJava)}}
> We can do something similar for the topicIdsToNames implementation.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)