Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/11030#discussion_r52368999
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/ContinuousQuery.scala ---
@@ -17,14 +17,84 @@
package org.apache.spark.sql
+import org.apache.spark.annotation.Experimental
+
/**
+ * :: Experimental ::
* A handle to a query that is executing continuously in the background as
new data arrives.
+ * All these methods are thread-safe.
+ * @since 2.0.0
*/
+@Experimental
trait ContinuousQuery {
/**
- * Stops the execution of this query if it is running. This method
blocks until the threads
+ * Returns the name of the query.
+ * @since 2.0.0
+ */
+ def name: String
+
+ /**
+ * Returns the SQLContext associated with `this` query
+ * @since 2.0.0
+ */
+ def sqlContext: SQLContext
+
+ /**
+ * Whether the query is currently active or not
+ * @since 2.0.0
+ */
+ def isActive: Boolean
+
+ /**
+ * Returns the [[ContinuousQueryException]] if the query was terminated
by an exception.
+ * @since 2.0.0
+ */
+ def exception: Option[ContinuousQueryException]
+
+ /**
+ * Returns current status of all the sources.
+ * @since 2.0.0
+ */
+ def sourceStatuses: Array[SourceStatus]
+
+ /** Returns current status of the sink. */
+ def sinkStatus: SinkStatus
+
+ /**
+ * Waits for the termination of `this` query, either by `query.stop()`
or by an exception.
+ * If the query has terminated with an exception, then the exception
will be thrown.
+ *
+ * If the query has terminated, then all subsequent calls to this method
will either return
+ * `true` immediately (if the query was terminated by `stop()`), or
throw the exception
--- End diff --
nit: this method doesn't return a Boolean.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]