public class ESDriver extends Object implements LensDriver
Constructor and Description |
---|
ESDriver() |
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)
removing the result set as soon as the fetch is done
|
void |
configure(org.apache.hadoop.conf.Configuration conf)
Configure driver with
Configuration passed. |
QueryCost |
estimate(AbstractQueryContext qctx)
Estimate the cost of execution for given query.
|
LensResultSet |
execute(QueryContext context)
Elastic search does not have a concept of prepared query.
|
void |
executeAsync(QueryContext context)
Asynchronously execute the query.
|
DriverQueryPlan |
explain(AbstractQueryContext context)
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
|
com.google.common.collect.ImmutableSet<QueryLaunchingConstraint> |
getQueryConstraints() |
com.google.common.collect.ImmutableSet<WaitingQueriesSelectionPolicy> |
getWaitingQuerySelectionPolicies() |
void |
prepare(PreparedQueryContext pContext)
Prepare the given query.
|
void |
readExternal(ObjectInput in)
This flow could be abstracted out at the driver level
|
void |
registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener)
Add a listener for driver events.
|
void |
registerForCompletionNotification(QueryHandle handle,
long timeoutMillis,
QueryCompletionListener listener)
Register for query completion notification.
|
void |
updateStatus(QueryContext context)
Update driver query status in the context object.
|
void |
writeExternal(ObjectOutput out) |
public org.apache.hadoop.conf.Configuration getConf()
LensDriver
getConf
in interface LensDriver
public QueryCost estimate(AbstractQueryContext qctx)
LensDriver
estimate
in interface LensDriver
qctx
- The query contextpublic DriverQueryPlan explain(AbstractQueryContext context) throws LensException
LensDriver
explain
in interface LensDriver
context
- The explain contextLensException
- the lens exceptionpublic void prepare(PreparedQueryContext pContext) throws LensException
LensDriver
prepare
in interface LensDriver
pContext
- the contextLensException
- the lens exceptionpublic DriverQueryPlan explainAndPrepare(PreparedQueryContext pContext) throws LensException
LensDriver
explainAndPrepare
in interface LensDriver
pContext
- the contextLensException
- the lens exceptionpublic void closePreparedQuery(QueryPrepareHandle handle)
LensDriver
closePreparedQuery
in interface LensDriver
handle
- The query handlepublic LensResultSet execute(QueryContext context) throws LensException
execute
in interface LensDriver
context
- the contextLensException
- the lens exceptionpublic void executeAsync(QueryContext context)
LensDriver
executeAsync
in interface LensDriver
context
- The query contextpublic void registerForCompletionNotification(QueryHandle handle, long timeoutMillis, QueryCompletionListener listener)
LensDriver
registerForCompletionNotification
in interface LensDriver
handle
- the handletimeoutMillis
- the timeout millislistener
- the listenerpublic void updateStatus(QueryContext context)
LensDriver
updateStatus
in interface LensDriver
context
- The query contextpublic LensResultSet fetchResultSet(QueryContext context) throws LensException
LensDriver
fetchResultSet
in interface LensDriver
context
- The query contextLensException
- the lens exceptionpublic void closeResultSet(QueryHandle handle) throws LensException
closeResultSet
in interface LensDriver
handle
- The query handleLensException
- the lens exceptionpublic boolean cancelQuery(QueryHandle handle) throws LensException
LensDriver
cancelQuery
in interface LensDriver
handle
- The query handle.LensException
- the lens exceptionpublic void closeQuery(QueryHandle handle) throws LensException
LensDriver
closeQuery
in interface LensDriver
handle
- The query handleLensException
- the lens exceptionpublic void close() throws LensException
LensDriver
close
in interface LensDriver
LensException
- the lens exceptionpublic void registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener)
LensDriver
registerDriverEventListener
in interface LensDriver
driverEventListener
- the driver event listenerpublic com.google.common.collect.ImmutableSet<QueryLaunchingConstraint> getQueryConstraints()
getQueryConstraints
in interface LensDriver
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.public com.google.common.collect.ImmutableSet<WaitingQueriesSelectionPolicy> getWaitingQuerySelectionPolicies()
getWaitingQuerySelectionPolicies
in interface LensDriver
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.public void configure(org.apache.hadoop.conf.Configuration conf) throws LensException
LensDriver
Configuration
passed.configure
in interface LensDriver
conf
- The configuration objectLensException
- the lens exceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.