chia7712 commented on code in PR #22474:
URL: https://github.com/apache/kafka/pull/22474#discussion_r3367642970
##########
core/src/test/scala/unit/kafka/utils/TestUtils.scala:
##########
@@ -317,10 +317,10 @@ object TestUtils extends Logging {
numPartitions: Int = 1,
replicationFactor: Int = 1,
replicaAssignment: collection.Map[Int, Seq[Int]] = Map.empty,
- topicConfig: Properties = new Properties,
+ topicConfig: util.Map[String, String] = util.Map.of(),
): Uuid = {
val configsMap = new util.HashMap[String, String]()
Review Comment:
Using `Map<string, String>` instead making the copy unnecessary
##########
server/src/main/java/org/apache/kafka/server/DefaultAutoTopicCreationManager.java:
##########
@@ -276,12 +275,12 @@ yield new CreatableTopic()
};
}
- private static CreatableTopicConfigCollection
convertToTopicConfigCollections(Properties config) {
+ private static CreatableTopicConfigCollection
convertToTopicConfigCollections(Map<String, String> config) {
return new CreatableTopicConfigCollection(
config.entrySet().stream()
.map(entry -> new CreatableTopicConfig()
- .setName(entry.getKey().toString())
- .setValue(entry.getValue().toString()))
+ .setName(entry.getKey())
+ .setValue(entry.getValue()))
.toList()
.iterator()
Review Comment:
With a collection, you can build the `CreatableTopicConfigCollection`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]