public class StreamingQueryManager
extends Object
StreamingQuery
active on a SparkSession
.
Modifier and Type | Method and Description |
---|---|
StreamingQuery[] |
active()
Returns a list of active queries associated with this SQLContext
|
void |
addListener(StreamingQueryListener listener)
Register a
StreamingQueryListener to receive up-calls for life cycle events of
StreamingQuery . |
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. |
StreamingQuery |
get(long id)
Returns the query if there is an active query with the given id, or null.
|
void |
removeListener(StreamingQueryListener listener)
Deregister a
StreamingQueryListener . |
void |
resetTerminated()
Forget about past terminated queries so that
awaitAnyTermination() can be used again to
wait for new terminations. |
public StreamingQuery[] active()
public StreamingQuery get(long id)
id
- (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.
StreamingQueryException,
- 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)StreamingQueryException,
- if any query has terminated with an exception
public void resetTerminated()
awaitAnyTermination()
can be used again to
wait for new terminations.
public void addListener(StreamingQueryListener listener)
StreamingQueryListener
to receive up-calls for life cycle events of
StreamingQuery
.
listener
- (undocumented)public void removeListener(StreamingQueryListener listener)
StreamingQueryListener
.
listener
- (undocumented)