public interface QueryInterceptor
| Modifier and Type | Method and Description |
|---|---|
default void |
destroy()
Called once to release any resources when
PrestoConnection is closing. |
default void |
init(Map<String,String> properties)
Called once per
PrestoConnection at instantiation. |
default Optional<PrestoResultSet> |
postProcess(String sql,
Statement interceptedStatement,
PrestoResultSet interceptedResultSet)
Called after the query has been sent to the server.
|
default Optional<PrestoResultSet> |
preProcess(String sql,
Statement interceptedStatement)
Called before the query has been sent to the server.
|
default void init(Map<String,String> properties)
PrestoConnection at instantiation.properties - the session properties supplied in the URIdefault void destroy()
PrestoConnection is closing.default Optional<PrestoResultSet> preProcess(String sql, Statement interceptedStatement)
QueryInterceptor is not intercepted.
This method can optionally return a PrestoResultSet. If a PrestoResultSet is returned from
from preProcess then the intercepted query is not executed and that PrestoResultSet is
returned instead. If there are multiple QueryInterceptors, preProcess will be called
on each and the last PrestoResultSet is returned.sql - the SQL string of the query.interceptedStatement - the Statement being executed.PrestoResultSet to be returneddefault Optional<PrestoResultSet> postProcess(String sql, Statement interceptedStatement, PrestoResultSet interceptedResultSet)
QueryInterceptor is not intercepted.
This method can optionally return a PrestoResultSet. If a PrestoResultSet is returned
from postProcess then that PrestoResultSet is returned instead. If there are multiple
QueryInterceptors, postProcess will be called on each and the last PrestoResultSet is returned.sql - the SQL string of the query.interceptedStatement - the Statement being executed.interceptedResultSet - the intercepted PrestoResultSetPrestoResultSet to be returned instead of the original PrestoResultSetCopyright © 2012–2024. All rights reserved.