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.
[LI-HOTFIX] Fix the SumOfTopicNameLength metric (#388)
TICKET = N/A LI_DESCRIPTION = There is a bug in the current implementation of sumOfTopicNameLength: controllerContext.allTopics.map(_.size + topicNameBytesOverheadOnZk).sum Since controllerContext.allTopics is a Set, the result of controllerContext.allTopics.map(_.size + topicNameBytesOverheadOnZk) is also a Set, i.e. Set[Int]. That means if two topics have the same length, their size gets deduped and only one topic's name length gets counted. This PR fixes the bug by using the foldLeft operator on the allTopics. EXIT_CRITERIA = N/A
- Loading branch information
Showing
2 changed files
with
15 additions
and
6 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