This is an automated email from the ASF dual-hosted git repository.
payang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new be6f22f83f6 MINOR: change updateBrokerConfig and updateDefaultConfig
error message (#21162)
be6f22f83f6 is described below
commit be6f22f83f64947213ad0b954f0c4307002b29e0
Author: TaiJuWu <[email protected]>
AuthorDate: Wed Dec 17 21:17:56 2025 +0800
MINOR: change updateBrokerConfig and updateDefaultConfig error message
(#21162)
The original error show `java.util.Collections$3@af78c87`, after change
it show the `[config.key.3, config.key.1, config.key.2]`
Example:
```
@Test
def testPropertiesContent(): Unit = {
val props = new Properties()
props.put("config.key.1", "value1")
props.put("config.key.2", "value2")
props.put("config.key.3", "value3")
System.err.println("\nProperties content:") System.err.println(s"
props = $props") // output: props = {config.key.3=value3,
config.key.2=value2, config.key.1=value1}
System.err.println(s"\n props.keySet() = ${props.keySet()}") //
output: props.keySet() = [config.key.3, config.key.2, config.key.1]
System.err.println(s"\n Set from keys = ${props.keys()}")
// output: Set from keySet = java.util.Collections$3@af78c87
}
```
Reviewers: Lan Ding <[email protected]>, Ken Huang <[email protected]>,
PoAn Yang <[email protected]>
---
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/src/main/scala/kafka/server/DynamicBrokerConfig.scala
b/core/src/main/scala/kafka/server/DynamicBrokerConfig.scala
index 61230884d97..f0b077b17f1 100755
--- a/core/src/main/scala/kafka/server/DynamicBrokerConfig.scala
+++ b/core/src/main/scala/kafka/server/DynamicBrokerConfig.scala
@@ -391,7 +391,7 @@ class DynamicBrokerConfig(private val kafkaConfig:
KafkaConfig) extends Logging
dynamicBrokerConfigs ++= props.asScala
updateCurrentConfig(doLog)
} catch {
- case e: Exception => error(s"Per-broker configs of $brokerId could not
be applied: ${persistentProps.keys()}", e)
+ case e: Exception => error(s"Per-broker configs of $brokerId could not
be applied: ${persistentProps.keySet()}", e)
}
}
@@ -402,7 +402,7 @@ class DynamicBrokerConfig(private val kafkaConfig:
KafkaConfig) extends Logging
dynamicDefaultConfigs ++= props.asScala
updateCurrentConfig(doLog)
} catch {
- case e: Exception => error(s"Cluster default configs could not be
applied: ${persistentProps.keys()}", e)
+ case e: Exception => error(s"Cluster default configs could not be
applied: ${persistentProps.keySet()}", e)
}
}