HyukjinKwon commented on a change in pull request #25518: [SPARK-26046][SS] Add 
StreamingQueryManager.removeAllListeners()
URL: https://github.com/apache/spark/pull/25518#discussion_r315962816
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/StreamingQueryManager.scala
 ##########
 @@ -199,6 +199,15 @@ class StreamingQueryManager private[sql] (sparkSession: 
SparkSession) extends Lo
     listenerBus.removeListener(listener)
   }
 
+  /**
+   * Deregister all [[StreamingQueryListener]]s attached to this 
[[StreamingQueryManager]].
+   *
+   * @since 3.0.0
+   */
+  def removeAllListeners(): Unit = {
+    listenerBus.removeAllListeners()
 
 Review comment:
   Hm, is it safe? Looks it's going to remove all other listeners in Spark 
Context. So, seems like if there is one Spark Context is shared for multiple 
shells (like Zeppelin), calling this API will break other shells if they 
registered their own custom listeners.

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