vanzin commented on a change in pull request #24627: [SPARK-27748][SS] Kafka 
consumer/producer password/token redaction.
URL: https://github.com/apache/spark/pull/24627#discussion_r288626926
 
 

 ##########
 File path: 
external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/CachedKafkaProducer.scala
 ##########
 @@ -63,9 +65,12 @@ private[kafka010] object CachedKafkaProducer extends 
Logging {
       .removalListener(removalListener)
       .build[Seq[(String, Object)], Producer](cacheLoader)
 
-  private def createKafkaProducer(producerConfiguration: ju.Map[String, 
Object]): Producer = {
-    val kafkaProducer: Producer = new Producer(producerConfiguration)
-    logDebug(s"Created a new instance of KafkaProducer for 
$producerConfiguration.")
+  private def createKafkaProducer(paramsSeq: Seq[(String, Object)]): Producer 
= {
+    val kafkaProducer: Producer = new Producer(paramsSeq.map(x => x._1 -> 
x._2).toMap.asJava)
 
 Review comment:
   Why do you need the `.map`? Seems like just `.toMap` would work?
   
   If you really need it, then use `.map { x => ... }`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to