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:
BaseSessionStateBuilderis requested for the session ExecutionListenerManager (whileSessionStateis built)ExecutionListenerManageris requested to clone
ExecutionListenerBus¶
ExecutionListenerManager creates an ExecutionListenerBus when created with the following:
- This
ExecutionListenerManager - SparkSession
The ExecutionListenerBus is used for the following:
- Register a QueryExecutionListener
- Unregister a QueryExecutionListener
- Unregister all QueryExecutionListeners
- clone
Accessing ExecutionListenerManager¶
ExecutionListenerManager is available as SparkSession.listenerManager (and SessionState.listenerManager).
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¶
Registering QueryExecutionListener¶
register requests the ExecutionListenerBus to register the given QueryExecutionListener.
register is used when:
De-registering QueryExecutionListener¶
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:
Refer to Logging.