public abstract class AbstractStatement extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected Set<ResourceAction> |
cancellationResourceActions
Resource actions used with authorizing a cancellation request.
|
protected Set<ResourceAction> |
fullResourceActions
Full resource actions authorized as part of this request.
|
protected PlannerContext |
plannerContext |
protected SqlQueryPlus |
queryPlus |
protected SqlExecutionReporter |
reporter |
protected SqlToolbox |
sqlToolbox |
| Constructor and Description |
|---|
AbstractStatement(SqlToolbox sqlToolbox,
SqlQueryPlus queryPlus,
String remoteAddress) |
| Modifier and Type | Method and Description |
|---|---|
Set<ResourceAction> |
allResources() |
protected void |
authorize(DruidPlanner planner,
Function<Set<ResourceAction>,Access> authorizer)
Authorize the query using the authorizer provided, and an option to authorize
context variables as well as query resources.
|
protected Function<Set<ResourceAction>,Access> |
authorizer()
Resource authorizer based on the authentication result
provided earlier.
|
void |
close()
Releases resources and emits logs and metrics as defined the
associated reporter.
|
void |
closeQuietly()
Closes the statement without reporting metrics.
|
void |
closeWithError(Throwable e)
Convenience method to close the statement and report an error
associated with the statement.
|
SqlQueryPlus |
query() |
SqlExecutionReporter |
reporter() |
Set<ResourceAction> |
resources()
Return the datasource and table resources for this
statement.
|
String |
sqlQueryId() |
protected void |
validate(DruidPlanner planner)
Validate SQL query and authorize against any datasources or views which
will take part in the query.
|
protected final SqlToolbox sqlToolbox
protected final SqlQueryPlus queryPlus
protected final SqlExecutionReporter reporter
protected PlannerContext plannerContext
protected Set<ResourceAction> cancellationResourceActions
protected Set<ResourceAction> fullResourceActions
public AbstractStatement(SqlToolbox sqlToolbox, SqlQueryPlus queryPlus, String remoteAddress)
public String sqlQueryId()
protected void validate(DruidPlanner planner)
protected void authorize(DruidPlanner planner, Function<Set<ResourceAction>,Access> authorizer)
protected Function<Set<ResourceAction>,Access> authorizer()
public Set<ResourceAction> resources()
public Set<ResourceAction> allResources()
public SqlQueryPlus query()
public SqlExecutionReporter reporter()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic void closeQuietly()
public void closeWithError(Throwable e)
stmt.reporter().failed(e);
stmt.close();
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.