forked from apache/kafka
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KAFKA-8788: Optimize client metadata handling with a large number of …
…partitions (apache#7192) Credit to @lbradstreet for profiling the producer with a large number of partitions. Cache `topicMetadata`, `brokers` and `controller` in the `MetadataResponse` the first time it's needed avoid unnecessary recomputation. We were previously computing`brokersMap` 4 times per partition in one code path that was invoked from multiple places. This is a regression introduced via a42f16f and first released in 2.3.0. The `Cluster` constructor became significantly more allocation heavy due to 2c44e77, first released in 2.2.0. Replaced `merge` calls with more verbose, but more efficient code. Added a test to verify that the returned collections are unmodifiable. Add `topicAuthorizedOperations` and `clusterAuthorizedOperations` to `MetadataResponse` and remove `data()` method. Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Lucas Bradstreet <lucasbradstreet@gmail.com>, Colin P. McCabe <cmccabe@confluent.io>, Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Justine Olshan <jolshan@confluent.io>
- Loading branch information
Showing
5 changed files
with
198 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.