Skip to content

Commit

Permalink
Add more comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
hshi2022 committed Mar 14, 2024
1 parent 2b6c6e3 commit 1016d3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/scala/kafka/server/DynamicBrokerConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,12 @@ class DynamicLogConfig(logManager: LogManager, server: KafkaBroker) extends Brok
val origUncleanLeaderElectionEnable = logManager.currentDefaultConfig.uncleanLeaderElectionEnable
val newBrokerDefaults = new util.HashMap[String, Object](currentLogConfig.originals)
// Call extractLogConfigMap to get the new LogConfig because there are some special handling for some configs, e.g.,
// RetentionMsProp. This is to ensure that the new LogConfig is consistent with LogManager's behavior.
// RetentionMsProp. This is to ensure that the new LogConfig is consistent with LogManager's LogConfig creation behavior.
val newLogConfig = LogConfig.extractLogConfigMap(newConfig)
newLogConfig.forEach { (k, v) =>
// Only update the config if it is a reconfigurable config. ReconfigurableConfigs is a subset of TopicConfigSynonyms.values.
// TopicConfigSynonyms is a map from log config name to kafka config name. Here we get the value of k and
// then check whether ReconfigurableConfigs contains it.
if (LogConfig.TopicConfigSynonyms.contains(k) && DynamicLogConfig.ReconfigurableConfigs.contains(LogConfig.TopicConfigSynonyms(k))) {
if (v == null) {
newBrokerDefaults.remove(k)
Expand Down

0 comments on commit 1016d3e

Please sign in to comment.