diff options
author | Shixiong Zhu <shixiong@databricks.com> | 2016-04-05 15:18:35 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2016-04-05 15:18:35 -0700 |
commit | 7329fe272d3ead7db9bc3e1e32adb7329dabc607 (patch) | |
tree | 2b4db38c93f6b362cc3508deb454a69979f6b407 /sql/core | |
parent | 45d8cdee3945bf94d0f1bd93a12e4cb0d416468e (diff) | |
download | spark-7329fe272d3ead7db9bc3e1e32adb7329dabc607.tar.gz spark-7329fe272d3ead7db9bc3e1e32adb7329dabc607.tar.bz2 spark-7329fe272d3ead7db9bc3e1e32adb7329dabc607.zip |
[SPARK-14411][SQL] Add a note to warn that onQueryProgress is asynchronous
## What changes were proposed in this pull request?
onQueryProgress is asynchronous so the user may see some future status of `ContinuousQuery`. This PR just updated comments to warn it.
## How was this patch tested?
Only updated comments.
Author: Shixiong Zhu <shixiong@databricks.com>
Closes #12180 from zsxwing/ContinuousQueryListener-doc.
Diffstat (limited to 'sql/core')
-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 */ |