Ted Yu created KAFKA-5911:
-----------------------------

             Summary: Avoid creation of extra Map for futures in 
KafkaAdminClient
                 Key: KAFKA-5911
                 URL: https://issues.apache.org/jira/browse/KAFKA-5911
             Project: Kafka
          Issue Type: Bug
            Reporter: Ted Yu


In various methods from KafkaAdminClient, there is extra Map created when 
constructing XXResult instance.
e.g.
{code}
        return new DescribeReplicaLogDirResult(new 
HashMap<TopicPartitionReplica, KafkaFuture<ReplicaLogDirInfo>>(futures));
{code}
Prior to returning, futures Map is already filled.
Calling get() and values() does not involve the internals of HashMap when we 
consider thread-safety.

The extra Map doesn't need to be created.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to