Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5911

Avoid creation of extra Map for futures in KafkaAdminClient

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Later
    • None
    • None
    • None

    Description

      In various methods from KafkaAdminClient, there is extra Map created when constructing XXResult instance.
      e.g.

              return new DescribeReplicaLogDirResult(new HashMap<TopicPartitionReplica, KafkaFuture<ReplicaLogDirInfo>>(futures));
      

      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.

      Attachments

        1. 5911.v1.txt
          17 kB
          Ted Yu

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: