package org.apache.spark.sql.streaming
abstract class StreamingQueryListener {
def onQueryStarted(event: QueryStartedEvent): Unit
def onQueryProgress(event: QueryProgressEvent): Unit
def onQueryTerminated(event: QueryTerminatedEvent): Unit
}
def onQueryStarted(event: QueryStartedEvent): Unit
def onQueryProgress(event: QueryProgressEvent): Unit
def onQueryTerminated(event: QueryTerminatedEvent): Unit
val queryListener: StreamingQueryListener = ...
spark.streams.addListener(queryListener)
val queryListener: StreamingQueryListener = ...
spark.streams.removeListener(queryListener)
Use StreamingQueryListener to implement your own listener
Observe how your listener intercepts the lifecycle events
Read Spark Structured Streaming gitbook
Read Mastering Apache Spark 2 gitbook
Follow @jaceklaskowski on twitter
Upvote my questions and answers on StackOverflow