public interface LensDriver extends Externalizable
Modifier and Type | Method and Description |
---|---|
boolean |
cancelQuery(QueryHandle handle)
Cancel the execution of the query, specified by the handle.
|
void |
close()
Close the driver, releasing all resouces used up by the driver.
|
void |
closePreparedQuery(QueryPrepareHandle handle)
Close the prepare query specified by the prepared handle, releases all the resources held by the prepared query.
|
void |
closeQuery(QueryHandle handle)
Close the query specified by the handle, releases all the resources held by the query.
|
void |
closeResultSet(QueryHandle handle)
Close the resultset for the query.
|
void |
configure(org.apache.hadoop.conf.Configuration conf,
String driverType,
String driverName)
Configure driver with
Configuration passed. |
Priority |
decidePriority(AbstractQueryContext queryContext)
decide priority based on query's cost.
|
QueryCost |
estimate(AbstractQueryContext qctx)
Estimate the cost of execution for given query.
|
LensResultSet |
execute(QueryContext context)
Blocking execute of the query
|
void |
executeAsync(QueryContext context)
Asynchronously execute the query.
|
DriverQueryPlan |
explain(AbstractQueryContext explainCtx)
Explain the given query.
|
DriverQueryPlan |
explainAndPrepare(PreparedQueryContext pContext)
Explain and prepare the given query.
|
LensResultSet |
fetchResultSet(QueryContext context)
Fetch the results of the query, specified by the handle.
|
org.apache.hadoop.conf.Configuration |
getConf()
Get driver configuration
|
String |
getFullyQualifiedName() |
com.google.common.collect.ImmutableSet<QueryLaunchingConstraint> |
getQueryConstraints() |
DriverQueryHook |
getQueryHook() |
RetryPolicyDecider<QueryContext> |
getRetryPolicyDecider() |
StatusUpdateMethod |
getStatusUpdateMethod() |
com.google.common.collect.ImmutableSet<WaitingQueriesSelectionPolicy> |
getWaitingQuerySelectionPolicies() |
void |
prepare(PreparedQueryContext pContext)
Prepare the given query.
|
void |
registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener)
Add a listener for driver events.
|
void |
registerForCompletionNotification(QueryContext context,
long timeoutMillis,
QueryCompletionListener listener)
Register for query completion notification.
|
void |
updateStatus(QueryContext context)
Update driver query status in the context object.
|
readExternal, writeExternal
org.apache.hadoop.conf.Configuration getConf()
void configure(org.apache.hadoop.conf.Configuration conf, String driverType, String driverName) throws LensException
Configuration
passed.conf
- The configuration objectdriverType
- Type of the driver (Example: hive, jdbc, el)driverName
- Name of this driverLensException
- the lens exceptionQueryCost estimate(AbstractQueryContext qctx) throws LensException
qctx
- The query contextLensException
- the lens exception if driver cannot estimateDriverQueryPlan explain(AbstractQueryContext explainCtx) throws LensException
explainCtx
- The explain contextLensException
- the lens exceptionvoid prepare(PreparedQueryContext pContext) throws LensException
pContext
- the contextLensException
- the lens exceptionDriverQueryPlan explainAndPrepare(PreparedQueryContext pContext) throws LensException
pContext
- the contextLensException
- the lens exceptionvoid closePreparedQuery(QueryPrepareHandle handle) throws LensException
handle
- The query handleLensException
- the lens exceptionLensResultSet execute(QueryContext context) throws LensException
context
- the contextLensException
- the lens exceptionvoid executeAsync(QueryContext context) throws LensException
context
- The query contextLensException
- the lens exceptionvoid registerForCompletionNotification(QueryContext context, long timeoutMillis, QueryCompletionListener listener) throws LensException
context
- the contexttimeoutMillis
- the timeout millislistener
- the listener. Only query completions are guaranteed to be notified.
Notably: SUCCESS and FAILURELensException
- the lens exceptionvoid updateStatus(QueryContext context) throws LensException
context
- The query contextLensException
- the lens exceptionLensResultSet fetchResultSet(QueryContext context) throws LensException
context
- The query contextLensException
- the lens exceptionvoid closeResultSet(QueryHandle handle) throws LensException
handle
- The query handleLensException
- the lens exceptionboolean cancelQuery(QueryHandle handle) throws LensException
handle
- The query handle.LensException
- the lens exceptionvoid closeQuery(QueryHandle handle) throws LensException
handle
- The query handleLensException
- the lens exceptionvoid close() throws LensException
LensException
- the lens exceptionvoid registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener)
driverEventListener
- the driver event listenercom.google.common.collect.ImmutableSet<QueryLaunchingConstraint> getQueryConstraints()
QueryLaunchingConstraint
s to be checked before launching a query on driver. If there are no
driver level constraints, then an empty set is returned. null is never returned.com.google.common.collect.ImmutableSet<WaitingQueriesSelectionPolicy> getWaitingQuerySelectionPolicies()
WaitingQueriesSelectionPolicy
s to be used to select waiting queries eligible to be moved out
of waiting state. If there are no driver level waiting query selection policies, then an empty set is returned.
null is never returned.String getFullyQualifiedName()
Priority decidePriority(AbstractQueryContext queryContext)
queryContext
- Query context whose priority is to be decidedDriverQueryHook getQueryHook()
for more details.
StatusUpdateMethod getStatusUpdateMethod()
RetryPolicyDecider<QueryContext> getRetryPolicyDecider()
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.