Class StreamingQueryManager
- All Implemented Interfaces:
- org.apache.spark.internal.Logging
StreamingQuery active in a SparkSession.
 - Since:
- 2.0.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.spark.internal.Loggingorg.apache.spark.internal.Logging.SparkShellLoggingFilter
- 
Method SummaryModifier and TypeMethodDescriptionactive()Returns a list of active queries associated with this SQLContextvoidaddListener(StreamingQueryListener listener) Register aStreamingQueryListenerto receive up-calls for life cycle events ofStreamingQuery.voidWait until any of the queries on the associated SQLContext has terminated since the creation of the context, or sinceresetTerminated()was called.booleanawaitAnyTermination(long timeoutMs) Wait until any of the queries on the associated SQLContext has terminated since the creation of the context, or sinceresetTerminated()was called.Returns the query if there is an active query with the given id, or null.Returns the query if there is an active query with the given id, or null.List allStreamingQueryListeners attached to thisStreamingQueryManager.voidremoveListener(StreamingQueryListener listener) Deregister aStreamingQueryListener.voidForget about past terminated queries so thatawaitAnyTermination()can be used again to wait for new terminations.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.internal.LogginginitializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq
- 
Method Details- 
activeReturns a list of active queries associated with this SQLContext- Returns:
- (undocumented)
- Since:
- 2.0.0
 
- 
addListenerRegister aStreamingQueryListenerto receive up-calls for life cycle events ofStreamingQuery.- Parameters:
- listener- (undocumented)
- Since:
- 2.0.0
 
- 
awaitAnyTerminationWait until any of the queries on the associated SQLContext has terminated since the creation of the context, or sinceresetTerminated()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 byquery.stop()), or throw the exception immediately (if the query was terminated with exception). UseresetTerminated()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, thenawaitAnyTermination()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 thequery.exception()for each query.- Throws:
- StreamingQueryException- if any query has terminated with an exception
- Since:
- 2.0.0
 
- 
awaitAnyTerminationWait until any of the queries on the associated SQLContext has terminated since the creation of the context, or sinceresetTerminated()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 returntrueimmediately (if the query was terminated byquery.stop()), or throw the exception immediately (if the query was terminated with exception). UseresetTerminated()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, thenawaitAnyTermination()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 thequery.exception()for each query.- Parameters:
- timeoutMs- (undocumented)
- Returns:
- (undocumented)
- Throws:
- StreamingQueryException- if any query has terminated with an exception
- Since:
- 2.0.0
 
- 
getReturns the query if there is an active query with the given id, or null.- Parameters:
- id- (undocumented)
- Returns:
- (undocumented)
- Since:
- 2.1.0
 
- 
getReturns the query if there is an active query with the given id, or null.- Parameters:
- id- (undocumented)
- Returns:
- (undocumented)
- Since:
- 2.1.0
 
- 
listListenersList allStreamingQueryListeners attached to thisStreamingQueryManager.- Returns:
- (undocumented)
- Since:
- 3.0.0
 
- 
removeListenerDeregister aStreamingQueryListener.- Parameters:
- listener- (undocumented)
- Since:
- 2.0.0
 
- 
resetTerminatedpublic void resetTerminated()Forget about past terminated queries so thatawaitAnyTermination()can be used again to wait for new terminations.- Since:
- 2.0.0
 
 
-