public interface QueryExecutionService extends LensService, SessionValidator
Modifier and Type | Method and Description |
---|---|
boolean |
cancelQuery(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
Cancel the execution of the query, specified by the handle.
|
void |
closeResultSet(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
Closes result set by releasing any resources used in serving the resultset.
|
boolean |
destroyPrepared(LensSessionHandle sessionHandle,
QueryPrepareHandle prepared)
Destroy a prepared query.
|
QueryCost |
estimate(String requestId,
LensSessionHandle sessionHandle,
String query,
LensConf conf)
Estimate the cost of given query.
|
QueryHandleWithResultSet |
execute(LensSessionHandle sessionHandle,
String query,
long timeoutmillis,
LensConf conf,
String queryName)
Execute the query with a timeout.
|
QueryHandle |
executeAsync(LensSessionHandle sessionHandle,
String query,
LensConf conf,
String queryName)
Asynchronously execute the query.
|
QueryHandleWithResultSet |
executePrepare(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle,
long timeoutmillis,
LensConf conf,
String queryName)
Execute already prepared query with timeout.
|
QueryHandle |
executePrepareAsync(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle,
LensConf conf,
String queryName)
Execute already prepared query asynchronously.
|
QueryPlan |
explain(String requestId,
LensSessionHandle sessionHandle,
String query,
LensConf conf)
Explain the given query.
|
QueryPlan |
explainAndPrepare(LensSessionHandle sessionHandle,
String query,
LensConf conf,
String queryName)
Explain the given query and prepare it as well.
|
QueryResult |
fetchResultSet(LensSessionHandle sessionHandle,
QueryHandle queryHandle,
long startIndex,
int fetchSize)
Fetch the results of the query, specified by the handle.
|
List<QueryPrepareHandle> |
getAllPreparedQueries(LensSessionHandle sessionHandle,
String user,
String queryName,
String fromDate,
String toDate)
Returns all the prepared queries for the specified user.
|
List<QueryHandle> |
getAllQueries(LensSessionHandle sessionHandle,
String states,
String user,
String driver,
String queryName,
String fromDate,
String toDate)
Returns all the queries in the specified state, for the given user and matching query name.
|
List<LensQuery> |
getAllQueryDetails(LensSessionHandle sessionHandle,
String states,
String user,
String driver,
String queryName,
String fromDate,
String toDate)
Returns all the queries in the specified state, for the given user and matching query name.
|
long |
getFinishedQueriesCount()
Get finished queries count
|
javax.ws.rs.core.Response |
getHttpResultSet(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
Get the http end point for the result set.
|
long |
getLaunchingQueriesCount()
Get queries being launched count
|
LensPreparedQuery |
getPreparedQuery(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle)
Get prepared query.
|
LensQuery |
getQuery(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
Get the query, specified by the handle.
|
long |
getQueuedQueriesCount()
Get queued queries count
|
QueryResultSetMetadata |
getResultSetMetadata(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
Get the result set metadata - list of columns(names and types) and result size.
|
long |
getRunningQueriesCount()
Get running queries count
|
long |
getWaitingQueriesCount()
Get waiting queries count
|
QueryPrepareHandle |
prepare(LensSessionHandle sessionHandle,
String query,
LensConf conf,
String queryName)
Prepare the query.
|
boolean |
updateQueryConf(LensSessionHandle sessionHandle,
QueryHandle queryHandle,
LensConf newconf)
Update the query conf.
|
boolean |
updateQueryConf(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle,
LensConf newconf)
Update configuration for prepared query.
|
getHealthStatus
validateSession
static final String NAME
QueryCost estimate(String requestId, LensSessionHandle sessionHandle, String query, LensConf conf) throws LensException
requestId
- the request Id of request used to start estimate operationsessionHandle
- the session handlequery
- The query should be in HiveQL(SQL like)conf
- The query configurationLensException
- thrown in case of failureQueryPlan explain(String requestId, LensSessionHandle sessionHandle, String query, LensConf conf) throws LensException
requestId
- the request Id of request used to start explain operationsessionHandle
- the session handlequery
- The query should be in HiveQL(SQL like)conf
- The query configurationLensException
- the lens exceptionQueryPrepareHandle prepare(LensSessionHandle sessionHandle, String query, LensConf conf, String queryName) throws LensException
sessionHandle
- the session handlequery
- The query should be in HiveQL(SQL like)conf
- The query configurationqueryName
- the query nameLensException
- the lens exceptionQueryPlan explainAndPrepare(LensSessionHandle sessionHandle, String query, LensConf conf, String queryName) throws LensException
sessionHandle
- the session handlequery
- The query should be in HiveQL(SQL like)conf
- The query configurationqueryName
- the query nameLensException
- the lens exceptionQueryHandle executePrepareAsync(LensSessionHandle sessionHandle, QueryPrepareHandle prepareHandle, LensConf conf, String queryName) throws LensException
sessionHandle
- the session handleprepareHandle
- The QueryPrepareHandle
conf
- The configuration for the query to executequeryName
- the query nameLensException
- the lens exceptionQueryHandleWithResultSet executePrepare(LensSessionHandle sessionHandle, QueryPrepareHandle prepareHandle, long timeoutmillis, LensConf conf, String queryName) throws LensException
sessionHandle
- the session handleprepareHandle
- The QueryPrepareHandle
timeoutmillis
- The timeout after which it will return handle, if query did not finish before.conf
- The configuration for the query to executequeryName
- the query nameLensException
- the lens exceptionQueryHandle executeAsync(LensSessionHandle sessionHandle, String query, LensConf conf, String queryName) throws LensException
sessionHandle
- the session handlequery
- The query should be in HiveQL(SQL like)conf
- The query configurationqueryName
- the query nameLensException
- the lens exceptionboolean updateQueryConf(LensSessionHandle sessionHandle, QueryHandle queryHandle, LensConf newconf) throws LensException
sessionHandle
- the session handlequeryHandle
- the query handlenewconf
- the newconfLensException
- the lens exceptionQueryHandleWithResultSet execute(LensSessionHandle sessionHandle, String query, long timeoutmillis, LensConf conf, String queryName) throws LensException
sessionHandle
- the session handlequery
- The query should be in HiveQL(SQL like)timeoutmillis
- The timeout after which it will return handle, if query did not finish before.conf
- The query configurationqueryName
- the query nameLensException
- the lens exceptionLensQuery getQuery(LensSessionHandle sessionHandle, QueryHandle queryHandle) throws LensException
sessionHandle
- the session handlequeryHandle
- The query handleLensException
- the lens exceptionQueryResultSetMetadata getResultSetMetadata(LensSessionHandle sessionHandle, QueryHandle queryHandle) throws LensException
sessionHandle
- the session handlequeryHandle
- the query handleLensException
- the lens exceptionQueryResult fetchResultSet(LensSessionHandle sessionHandle, QueryHandle queryHandle, long startIndex, int fetchSize) throws LensException
sessionHandle
- the session handlequeryHandle
- The query handlestartIndex
- The start Index from which result rows have to be fetchedfetchSize
- Number of rows to be fetchedLensException
- the lens exceptionjavax.ws.rs.core.Response getHttpResultSet(LensSessionHandle sessionHandle, QueryHandle queryHandle) throws LensException
sessionHandle
- The lens session handlequeryHandle
- The query handleLensException
- the lens exceptionvoid closeResultSet(LensSessionHandle sessionHandle, QueryHandle queryHandle) throws LensException
sessionHandle
- the session handlequeryHandle
- the query handleLensException
- the lens exceptionboolean cancelQuery(LensSessionHandle sessionHandle, QueryHandle queryHandle) throws LensException
sessionHandle
- the session handlequeryHandle
- The query handle.LensException
- the lens exceptionList<QueryHandle> getAllQueries(LensSessionHandle sessionHandle, String states, String user, String driver, String queryName, String fromDate, String toDate) throws LensException
sessionHandle
- the session handlestates
- return queries in these state. if null, all queries will be returned. Multiple states can
be supplied separated by commauser
- Get queries submitted by a specific user.
If this set to "all", queries of all users are returneddriver
- Get queries submitted on a specific driver.queryName
- return queries containing the query name. If null, all queries will be returnedfromDate
- start date of time range intervaltoDate
- end date of the time range intervalLensException
- the lens exceptionList<LensQuery> getAllQueryDetails(LensSessionHandle sessionHandle, String states, String user, String driver, String queryName, String fromDate, String toDate) throws LensException
sessionHandle
- the session handlestates
- return queries in these state. if null, all queries will be returned. Multiple states can
be supplied separated by commauser
- Get queries submitted by a specific user.
If this set to "all", queries of all users are returneddriver
- Get queries submitted on a specific driver.queryName
- return queries containing the query name. If null, all queries will be returnedfromDate
- start date of time range intervaltoDate
- end date of the time range intervalLensException
- the lens exceptionList<QueryPrepareHandle> getAllPreparedQueries(LensSessionHandle sessionHandle, String user, String queryName, String fromDate, String toDate) throws LensException
sessionHandle
- the session handleuser
- returns queries of the user. If set to "all", returns queries of all users.
By default returns the queries
of the current user.queryName
- returns queries matching the query namefromDate
- start time for filtering prepared queries by preparation timetoDate
- end time for filtering prepared queries by preparation timeLensException
- the lens exceptionboolean destroyPrepared(LensSessionHandle sessionHandle, QueryPrepareHandle prepared) throws LensException
sessionHandle
- the session handleprepared
- the preparedLensException
- the lens exceptionLensPreparedQuery getPreparedQuery(LensSessionHandle sessionHandle, QueryPrepareHandle prepareHandle) throws LensException
sessionHandle
- the session handleprepareHandle
- the prepare handleLensException
- the lens exceptionboolean updateQueryConf(LensSessionHandle sessionHandle, QueryPrepareHandle prepareHandle, LensConf newconf) throws LensException
sessionHandle
- the session handleprepareHandle
- the prepare handlenewconf
- the newconfLensException
- the lens exceptionlong getQueuedQueriesCount()
long getRunningQueriesCount()
long getWaitingQueriesCount()
long getFinishedQueriesCount()
long getLaunchingQueriesCount()
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.