|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hive.service.AbstractService
org.apache.hive.service.CompositeService
org.apache.lens.server.LensService
org.apache.lens.server.query.QueryExecutionServiceImpl
public class QueryExecutionServiceImpl
The Class QueryExecutionServiceImpl.
| Nested Class Summary | |
|---|---|
static class |
QueryExecutionServiceImpl.QueryStatusLogger
The Class QueryStatusLogger. |
| Nested classes/interfaces inherited from class org.apache.hive.service.CompositeService |
|---|
org.apache.hive.service.CompositeService.CompositeServiceShutdownHook |
| Nested classes/interfaces inherited from interface org.apache.hive.service.Service |
|---|
org.apache.hive.service.Service.STATE |
| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
The Constant LOG. |
static String |
NAME
The Constant NAME. |
static String |
PREPARED_QUERIES_COUNTER
The Constant PREPARED_QUERIES_COUNTER. |
static String |
PREPARED_QUERY_PURGER_COUNTER
The Constant PREPARED_QUERY_PURGER_COUNTER. |
static String |
QUERY_PURGER_COUNTER
The Constant QUERY_PURGER_COUNTER. |
static String |
QUERY_SUBMITTER_COUNTER
The Constant QUERY_SUBMITTER_COUNTER. |
static String |
STATUS_UPDATE_COUNTER
The Constant STATUS_UPDATE_COUNTER. |
| Constructor Summary | |
|---|---|
QueryExecutionServiceImpl(org.apache.hive.service.cli.CLIService cliService)
Instantiates a new query execution service impl. |
|
| Method Summary | |
|---|---|
void |
addResource(LensSessionHandle sessionHandle,
String type,
String path)
Adds the resource. |
boolean |
cancelQuery(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
Cancel the execution of the query, specified by the handle. |
void |
closeDriverSessions(LensSessionHandle sessionHandle)
Allow drivers to release resources acquired for a session if any. |
void |
closeResultSet(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
Closes result set by releasing any resources used in serving the resultset. |
void |
closeSession(LensSessionHandle sessionHandle)
Close session. |
void |
deleteResource(LensSessionHandle sessionHandle,
String type,
String path)
Delete resource. |
boolean |
destroyPrepared(LensSessionHandle sessionHandle,
QueryPrepareHandle prepared)
Destroy a prepared 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(LensSessionHandle sessionHandle,
String query,
LensConf lensConf)
Explain the given query. |
QueryPlan |
explainAndPrepare(LensSessionHandle sessionHandle,
String query,
LensConf lensConf,
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,
long fromDate,
long toDate)
Returns all the prepared queries for the specified user. |
List<QueryHandle> |
getAllQueries(LensSessionHandle sessionHandle,
String state,
String userName,
String queryName,
long fromDate,
long 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. |
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 |
void |
init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
|
void |
pauseQuerySubmitter()
Pause query submitter. |
QueryPrepareHandle |
prepare(LensSessionHandle sessionHandle,
String query,
LensConf lensConf,
String queryName)
Prepare the query. |
void |
prepareStopping()
Prepare stopping. |
void |
readExternal(ObjectInput in)
|
void |
start()
|
void |
stop()
|
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. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.apache.lens.server.LensService |
|---|
acquire, acquire, getCliService, getHiveSessionHandle, getLensConf, getLensConf, getServerDomain, getSession, getSessionManager, openSession, release, release, restoreSession |
| Methods inherited from class org.apache.hive.service.CompositeService |
|---|
getServices |
| Methods inherited from class org.apache.hive.service.AbstractService |
|---|
getHiveConf, getName, getServiceState, getStartTime, register, unregister |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
public static final String PREPARED_QUERIES_COUNTER
public static final String QUERY_SUBMITTER_COUNTER
public static final String STATUS_UPDATE_COUNTER
public static final String QUERY_PURGER_COUNTER
public static final String PREPARED_QUERY_PURGER_COUNTER
public static final String NAME
| Constructor Detail |
|---|
public QueryExecutionServiceImpl(org.apache.hive.service.cli.CLIService cliService)
throws LensException
cliService - the cli service
LensException - the lens exception| Method Detail |
|---|
public void pauseQuerySubmitter()
public void init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
init in interface org.apache.hive.service.Serviceinit in class org.apache.hive.service.CompositeServicepublic void prepareStopping()
LensService
prepareStopping in class LensServicepublic void stop()
stop in interface org.apache.hive.service.Servicestop in class org.apache.hive.service.CompositeServicepublic void start()
start in interface org.apache.hive.service.Servicestart in class org.apache.hive.service.CompositeService
public QueryPrepareHandle prepare(LensSessionHandle sessionHandle,
String query,
LensConf lensConf,
String queryName)
throws LensException
QueryExecutionService
prepare in interface QueryExecutionServicesessionHandle - the session handlequery - The query should be in HiveQL(SQL like)lensConf - The query configurationqueryName - the query name
LensException - the lens exception
public QueryPlan explainAndPrepare(LensSessionHandle sessionHandle,
String query,
LensConf lensConf,
String queryName)
throws LensException
QueryExecutionService
explainAndPrepare in interface QueryExecutionServicesessionHandle - the session handlequery - The query should be in HiveQL(SQL like)lensConf - The query configurationqueryName - the query name
LensException - the lens exception
public QueryHandle executePrepareAsync(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle,
LensConf conf,
String queryName)
throws LensException
QueryExecutionService
executePrepareAsync in interface QueryExecutionServicesessionHandle - the session handleprepareHandle - The QueryPrepareHandleconf - The configuration for the query to executequeryName - the query name
LensException - the lens exception
public QueryHandleWithResultSet executePrepare(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle,
long timeoutMillis,
LensConf conf,
String queryName)
throws LensException
QueryExecutionService
executePrepare in interface QueryExecutionServicesessionHandle - the session handleprepareHandle - The QueryPrepareHandletimeoutMillis - The timeout after which it will return handle, if query did not finish before.conf - The configuration for the query to executequeryName - the query name
LensException - the lens exception
public QueryHandle executeAsync(LensSessionHandle sessionHandle,
String query,
LensConf conf,
String queryName)
throws LensException
QueryExecutionService
executeAsync in interface QueryExecutionServicesessionHandle - the session handlequery - The query should be in HiveQL(SQL like)conf - The query configurationqueryName - the query name
LensException - the lens exception
public boolean updateQueryConf(LensSessionHandle sessionHandle,
QueryHandle queryHandle,
LensConf newconf)
throws LensException
QueryExecutionService
updateQueryConf in interface QueryExecutionServicesessionHandle - the session handlequeryHandle - the query handlenewconf - the newconf
LensException - the lens exception
public boolean updateQueryConf(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle,
LensConf newconf)
throws LensException
QueryExecutionService
updateQueryConf in interface QueryExecutionServicesessionHandle - the session handleprepareHandle - the prepare handlenewconf - the newconf
LensException - the lens exception
public LensQuery getQuery(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
throws LensException
QueryExecutionService
getQuery in interface QueryExecutionServicesessionHandle - the session handlequeryHandle - The query handle
LensException - the lens exception
public LensPreparedQuery getPreparedQuery(LensSessionHandle sessionHandle,
QueryPrepareHandle prepareHandle)
throws LensException
QueryExecutionService
getPreparedQuery in interface QueryExecutionServicesessionHandle - the session handleprepareHandle - the prepare handle
LensException - the lens exception
public QueryHandleWithResultSet execute(LensSessionHandle sessionHandle,
String query,
long timeoutMillis,
LensConf conf,
String queryName)
throws LensException
QueryExecutionService
execute in interface QueryExecutionServicesessionHandle - 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 name
LensException - the lens exception
public QueryResultSetMetadata getResultSetMetadata(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
throws LensException
QueryExecutionService
getResultSetMetadata in interface QueryExecutionServicesessionHandle - the session handlequeryHandle - the query handle
LensException - the lens exception
public QueryResult fetchResultSet(LensSessionHandle sessionHandle,
QueryHandle queryHandle,
long startIndex,
int fetchSize)
throws LensException
QueryExecutionService
fetchResultSet in interface QueryExecutionServicesessionHandle - the session handlequeryHandle - The query handlestartIndex - The start Index from which result rows have to be fetchedfetchSize - Number of rows to be fetched
LensException - the lens exception
public void closeResultSet(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
throws LensException
QueryExecutionService
closeResultSet in interface QueryExecutionServicesessionHandle - the session handlequeryHandle - the query handle
LensException - the lens exception
public boolean cancelQuery(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
throws LensException
QueryExecutionService
cancelQuery in interface QueryExecutionServicesessionHandle - the session handlequeryHandle - The query handle.
LensException - the lens exception
public List<QueryHandle> getAllQueries(LensSessionHandle sessionHandle,
String state,
String userName,
String queryName,
long fromDate,
long toDate)
throws LensException
QueryExecutionService
getAllQueries in interface QueryExecutionServicesessionHandle - the session handlestate - return queries in this state. if null, all queries will be returneduserName - Get queries submitted by a specific user.
If this set to "all", queries of all users are returnedqueryName - 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 interval
LensException - the lens exception
public List<QueryPrepareHandle> getAllPreparedQueries(LensSessionHandle sessionHandle,
String user,
String queryName,
long fromDate,
long toDate)
throws LensException
QueryExecutionService
getAllPreparedQueries in interface QueryExecutionServicesessionHandle - 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 time
LensException - the lens exception
public boolean destroyPrepared(LensSessionHandle sessionHandle,
QueryPrepareHandle prepared)
throws LensException
QueryExecutionService
destroyPrepared in interface QueryExecutionServicesessionHandle - the session handleprepared - the prepared
LensException - the lens exception
public QueryPlan explain(LensSessionHandle sessionHandle,
String query,
LensConf lensConf)
throws LensException
QueryExecutionService
explain in interface QueryExecutionServicesessionHandle - the session handlequery - The query should be in HiveQL(SQL like)lensConf - The query configuration
LensException - the lens exception
public void addResource(LensSessionHandle sessionHandle,
String type,
String path)
throws LensException
LensService
addResource in class LensServicesessionHandle - the session handletype - the typepath - the path
LensException - the lens exception
public void deleteResource(LensSessionHandle sessionHandle,
String type,
String path)
throws LensException
LensService
deleteResource in class LensServicesessionHandle - the session handletype - the typepath - the path
LensException - the lens exception
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class LensServiceIOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class LensServiceIOException
public javax.ws.rs.core.Response getHttpResultSet(LensSessionHandle sessionHandle,
QueryHandle queryHandle)
throws LensException
QueryExecutionService
getHttpResultSet in interface QueryExecutionServicesessionHandle - The lens session handlequeryHandle - The query handle
LensException - the lens exceptionpublic void closeDriverSessions(LensSessionHandle sessionHandle)
sessionHandle - the session handle
public void closeSession(LensSessionHandle sessionHandle)
throws LensException
LensService
closeSession in class LensServicesessionHandle - the session handle
LensException - the lens exceptionpublic long getQueuedQueriesCount()
QueryExecutionService
getQueuedQueriesCount in interface QueryExecutionServicepublic long getRunningQueriesCount()
QueryExecutionService
getRunningQueriesCount in interface QueryExecutionServicepublic long getFinishedQueriesCount()
QueryExecutionService
getFinishedQueriesCount in interface QueryExecutionService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||