Skip to content

ExecutionListenerManager

ExecutionListenerManager is a frontend (facade) of ExecutionListenerBus to manage QueryExecutionListeners (in a SparkSession).

Creating Instance

ExecutionListenerManager takes the following to be created:

ExecutionListenerManager is created when:

ExecutionListenerBus

ExecutionListenerManager creates an ExecutionListenerBus when created with the following:

The ExecutionListenerBus is used for the following:

Accessing ExecutionListenerManager

ExecutionListenerManager is available as SparkSession.listenerManager (and SessionState.listenerManager).

scala> :type spark.listenerManager
org.apache.spark.sql.util.ExecutionListenerManager
scala> :type spark.sessionState.listenerManager
org.apache.spark.sql.util.ExecutionListenerManager

spark.sql.queryExecutionListeners

ExecutionListenerManager is given loadExtensions flag when created.

When enabled, ExecutionListenerManager registers the QueryExecutionListeners that are configured using the spark.sql.queryExecutionListeners configuration property.

Removing All QueryExecutionListeners

clear(): Unit

Registering QueryExecutionListener

register(
  listener: QueryExecutionListener): Unit

register requests the ExecutionListenerBus to register the given QueryExecutionListener.


register is used when:

De-registering QueryExecutionListener

unregister(
  listener: QueryExecutionListener): Unit

Logging

Enable ALL logging level for org.apache.spark.sql.util.ExecutionListenerManager logger to see what happens inside.

Add the following line to conf/log4j2.properties:

log4j.logger.org.apache.spark.sql.util.ExecutionListenerManager=ALL

Refer to Logging.