You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/20 21:11:00 UTC
[jira] [Commented] (KAFKA-5911) Avoid creation of extra Map for
futures in KafkaAdminClient
[ https://issues.apache.org/jira/browse/KAFKA-5911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16173830#comment-16173830 ]
ASF GitHub Bot commented on KAFKA-5911:
---------------------------------------
GitHub user tedyu opened a pull request:
https://github.com/apache/kafka/pull/3925
KAFKA-5911 Avoid creation of extra Map for futures in KafkaAdminClient
This reduces creation of garbage while keeping thread safety untouched.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tedyu/kafka trunk
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/3925.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3925
----
commit b53379ed9a327b2c195dffc4c5d537fb0a0ace13
Author: tedyu <yu...@gmail.com>
Date: 2017-09-20T21:09:21Z
KAFKA-5911 Avoid creation of extra Map for futures in KafkaAdminClient
----
> 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
> Attachments: 5911.v1.txt
>
>
> 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)