Package org.apache.spark.sql.util
Interface QueryExecutionListener
public interface QueryExecutionListener
The interface of query execution listener that can be used to analyze execution metrics.
- Note:
- Implementations should guarantee thread-safety as they can be invoked by multiple different threads.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
A callback function that will be called when a query execution failed.void
A callback function that will be called when a query executed successfully.
-
Method Details
-
onFailure
void onFailure(String funcName, org.apache.spark.sql.execution.QueryExecution qe, Exception exception) A callback function that will be called when a query execution failed.- Parameters:
funcName
- the name of the action that triggered this query.qe
- the QueryExecution object that carries detail information like logical plan, physical plan, etc.exception
- the exception that failed this query. Ifjava.lang.Error
is thrown during execution, it will be wrapped with anException
and it can be accessed byexception.getCause
.- Note:
- This can be invoked by multiple different threads.
-
onSuccess
A callback function that will be called when a query executed successfully.- Parameters:
funcName
- name of the action that triggered this query.qe
- the QueryExecution object that carries detail information like logical plan, physical plan, etc.durationNs
- the execution time for this query in nanoseconds.- Note:
- This can be invoked by multiple different threads.
-