Github user thunterdb commented on a diff in the pull request:
https://github.com/apache/spark/pull/11030#discussion_r52202089
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/ContinuousQuery.scala ---
@@ -17,11 +17,47 @@
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.
+ * @since 2.0.0
*/
+@Experimental
trait ContinuousQuery {
+ /** Returns the name of the query */
+ def name: String
+
+ def sqlContext: SQLContext
+
+ /** Whether the query is currently active or not */
+ def isActive: Boolean
+
+ /** Returns the [[ContinuousQueryException]] if the query was terminated
by an exception. */
+ def exception: Option[ContinuousQueryException]
+
+ /** Returns current status of all the sources. */
+ def sourceStatuses: Array[SourceStatus]
+
+ /** Returns current status of the sink. */
+ def sinkStatus: SinkStatus
+
+ /**
+ * Waits for the termination of this query, either by `stop` or by any
exception.
+ * @throws ContinuousQueryException, if the query terminated by an
exception.
+ */
+ def awaitTermination(): Unit
+
+ /**
+ * Waits for the termination of this query, either by `stop` or by any
exception.
+ * Returns whether the query has terminated or not.
+ * @throws ContinuousQueryException, if the query terminated by an
exception before
+ * `timeoutMs` milliseconds
+ */
+ def awaitTermination(timeoutMs: Long): Boolean
+
/**
* Stops the execution of this query if it is running. This method
blocks until the threads
--- End diff --
Also, can you document if the methods above are thread-safe? This is
important for complex client applications.
---
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]