public class ContinuousQueryManager
extends java.lang.Object
ContinuousQueries
active
on a SparkSession
.
Constructor and Description |
---|
ContinuousQueryManager(SparkSession sparkSession) |
Modifier and Type | Method and Description |
---|---|
ContinuousQuery[] |
active()
Returns a list of active queries associated with this SQLContext
|
void |
addListener(ContinuousQueryListener listener)
Register a
ContinuousQueryListener to receive up-calls for life cycle events of
ContinuousQueries . |
void |
awaitAnyTermination()
Wait until any of the queries on the associated SQLContext has terminated since the
creation of the context, or since
resetTerminated() was called. |
boolean |
awaitAnyTermination(long timeoutMs)
Wait until any of the queries on the associated SQLContext has terminated since the
creation of the context, or since
resetTerminated() was called. |
ContinuousQuery |
get(java.lang.String name)
Returns an active query from this SQLContext or throws exception if bad name
|
void |
removeListener(ContinuousQueryListener listener)
Deregister a
ContinuousQueryListener . |
void |
resetTerminated()
Forget about past terminated queries so that
awaitAnyTermination() can be used again to
wait for new terminations. |
public ContinuousQueryManager(SparkSession sparkSession)
public ContinuousQuery[] active()
public ContinuousQuery get(java.lang.String name)
name
- (undocumented)public void awaitAnyTermination()
resetTerminated()
was called. If any query was terminated
with an exception, then the exception will be thrown.
If a query has terminated, then subsequent calls to awaitAnyTermination()
will either
return immediately (if the query was terminated by query.stop()
),
or throw the exception immediately (if the query was terminated with exception). Use
resetTerminated()
to clear past terminations and wait for new terminations.
In the case where multiple queries have terminated since resetTermination()
was called,
if any query has terminated with exception, then awaitAnyTermination()
will
throw any of the exception. For correctly documenting exceptions across multiple queries,
users need to stop all of them after any of them terminates with exception, and then check the
query.exception()
for each query.
ContinuousQueryException,
- if any query has terminated with an exception
public boolean awaitAnyTermination(long timeoutMs)
resetTerminated()
was called. Returns whether any query
has terminated or not (multiple may have terminated). If any query has terminated with an
exception, then the exception will be thrown.
If a query has terminated, then subsequent calls to awaitAnyTermination()
will either
return true
immediately (if the query was terminated by query.stop()
),
or throw the exception immediately (if the query was terminated with exception). Use
resetTerminated()
to clear past terminations and wait for new terminations.
In the case where multiple queries have terminated since resetTermination()
was called,
if any query has terminated with exception, then awaitAnyTermination()
will
throw any of the exception. For correctly documenting exceptions across multiple queries,
users need to stop all of them after any of them terminates with exception, and then check the
query.exception()
for each query.
timeoutMs
- (undocumented)ContinuousQueryException,
- if any query has terminated with an exception
public void resetTerminated()
awaitAnyTermination()
can be used again to
wait for new terminations.
public void addListener(ContinuousQueryListener listener)
ContinuousQueryListener
to receive up-calls for life cycle events of
ContinuousQueries
.
listener
- (undocumented)public void removeListener(ContinuousQueryListener listener)
ContinuousQueryListener
.
listener
- (undocumented)