10.8. Event Listener
Presto supports custom event listeners that are invoked for the followingevents:
- Query creation
- Query completion (success or failure)
- Split completion (success or failure)This functionality enables development of custom logging, debugging andperformance analysis plugins. In a Presto cluster, only a single eventlistener plugin can be active at a time .
Implementation
EventListenerFactory
is responsible for creating anEventListener
instance. It also defines an EventListener
name which is used by the administrator in a Presto configuration.Implementations of EventListener
implement methods for the event typesthey are interested in handling.
The implementation of EventListener
and EventListenerFactory
must be wrapped as a plugin and installed on the Presto cluster.
Configuration
After a plugin that implements EventListener
andEventListenerFactory
has been installed on the coordinator, it isconfigured using an etc/event-listener.properties
file. All of theproperties other than event-listener.name
are specific to theEventListener
implementation.
The event-listener.name
property is used by Presto to find a registeredEventListenerFactory
based on the name returned byEventListenerFactory.getName()
. The remaining properties are passedas a map to EventListenerFactory.create()
.
Example configuration file:
- event-listener.name=custom-event-listener
- custom-property1=custom-value1
- custom-property2=custom-value2