You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Ismael Juma (Jira)" <ji...@apache.org> on 2020/01/29 21:55:00 UTC

[jira] [Resolved] (KAFKA-9405) Use Map API computeIfAbsent Where Applicable

     [ https://issues.apache.org/jira/browse/KAFKA-9405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ismael Juma resolved KAFKA-9405.
--------------------------------
    Fix Version/s: 2.5.0
       Resolution: Fixed

> Use Map API computeIfAbsent Where Applicable
> --------------------------------------------
>
>                 Key: KAFKA-9405
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9405
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>            Reporter: David Mollitor
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> {quote}
> to implement a multi-value map, Map<K,Collection<V>>, supporting multiple values per key:
>  
>  map.computeIfAbsent(key, k -> new HashSet<V>()).add(v);
> {quote}
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#computeIfAbsent-K-java.util.function.Function-



--
This message was sent by Atlassian Jira
(v8.3.4#803005)