chia7712 commented on code in PR #19867: URL: https://github.com/apache/kafka/pull/19867#discussion_r2121902463
########## core/src/main/scala/kafka/server/ConfigHelper.scala: ########## @@ -39,14 +39,30 @@ import org.apache.kafka.server.logger.LoggingController import org.apache.kafka.server.metrics.ClientMetricsConfigs import org.apache.kafka.storage.internals.log.LogConfig +import java.util.stream.Collectors import scala.collection.{Map, mutable} import scala.jdk.CollectionConverters._ import scala.jdk.OptionConverters.RichOptional +import java.util.{HashMap, HashSet, List => JList, Map => JMap} class ConfigHelper(metadataCache: MetadataCache, config: KafkaConfig, configRepository: ConfigRepository) extends Logging { - def allConfigs(config: AbstractConfig): mutable.Map[String, Any] = { - config.originals.asScala.filter(_._2 != null) ++ config.nonInternalValues.asScala + def allConfigs(config: AbstractConfig): JMap[String, Object] = { Review Comment: yes, it would be good to keep the prefix `java.util` or `util.` to help us distinguish the "scala" and "java" ########## core/src/main/scala/kafka/server/ConfigHelper.scala: ########## @@ -39,14 +39,30 @@ import org.apache.kafka.server.logger.LoggingController import org.apache.kafka.server.metrics.ClientMetricsConfigs import org.apache.kafka.storage.internals.log.LogConfig +import java.util.stream.Collectors import scala.collection.{Map, mutable} import scala.jdk.CollectionConverters._ import scala.jdk.OptionConverters.RichOptional +import java.util.{HashMap, HashSet, List => JList, Map => JMap} class ConfigHelper(metadataCache: MetadataCache, config: KafkaConfig, configRepository: ConfigRepository) extends Logging { - def allConfigs(config: AbstractConfig): mutable.Map[String, Any] = { - config.originals.asScala.filter(_._2 != null) ++ config.nonInternalValues.asScala + def allConfigs(config: AbstractConfig): JMap[String, Object] = { + val result = new HashMap[String, Object]() + + config.originals.forEach { (k, v) => + if (v != null) { + result.put(k, v) + } + } + + config.nonInternalValues.forEach { (k, v) => + if (v != null) { Review Comment: Do we need this check? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org