HeartSaVioR commented on a change in pull request #26855: [SPARK-30227][SQL] 
Add close() on DataWriter interface
URL: https://github.com/apache/spark/pull/26855#discussion_r357026904
 
 

 ##########
 File path: 
external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaDataWriter.scala
 ##########
 @@ -63,12 +63,5 @@ private[kafka010] class KafkaDataWriter(
 
   def abort(): Unit = {}
 
-  def close(): Unit = {
-    checkForErrors()
-    if (producer != null) {
-      producer.flush()
-      checkForErrors()
-      CachedKafkaProducer.close(producerParams)
-    }
-  }
+  def close(): Unit = {}
 
 Review comment:
   So there's no "return" in current Kafka producer cache and the cache evicts 
the expired producer on policy. Previously we force invalidating the Kafka 
producer when close() is explicitly called as callers of `close()` are 
temporarily using the producer (instead of running some query), and current 
code just let cache expire the producer on policy for all cases.

----------------------------------------------------------------
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