diff options
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/util/ContinuousQueryListener.scala | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/util/ContinuousQueryListener.scala b/sql/core/src/main/scala/org/apache/spark/sql/util/ContinuousQueryListener.scala index 2c5358cbd7..bf78be9d9f 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/util/ContinuousQueryListener.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/util/ContinuousQueryListener.scala @@ -34,11 +34,19 @@ abstract class ContinuousQueryListener { * @note This is called synchronously with * [[org.apache.spark.sql.DataFrameWriter `DataFrameWriter.startStream()`]], * that is, `onQueryStart` will be called on all listeners before - * `DataFrameWriter.startStream()` returns the corresponding [[ContinuousQuery]]. + * `DataFrameWriter.startStream()` returns the corresponding [[ContinuousQuery]]. Please + * don't block this method as it will block your query. */ def onQueryStarted(queryStarted: QueryStarted) - /** Called when there is some status update (ingestion rate updated, etc. */ + /** + * Called when there is some status update (ingestion rate updated, etc.) + * + * @note This method is asynchronous. The status in [[ContinuousQuery]] will always be + * latest no matter when this method is called. Therefore, the status of [[ContinuousQuery]] + * may be changed before/when you process the event. E.g., you may find [[ContinuousQuery]] + * is terminated when you are processing [[QueryProgress]]. + */ def onQueryProgress(queryProgress: QueryProgress) /** Called when a query is stopped, with or without error */ |