|
||||||||||
| 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. |
protected Thread |
querySubmitter
The query submitter. |
static String |
STATUS_UPDATE_COUNTER
The Constant STATUS_UPDATE_COUNTER. |
| Fields inherited from class org.apache.lens.server.LensService |
|---|
sessionMap, stopped |
| Constructor Summary | |
|---|---|
QueryExecutionServiceImpl(org.apache.hive.service.cli.CLIService cliService)
Instantiates a new query execution service impl. |
|
| Method Summary | |
|---|---|
void |
addResource(org.apache.lens.api.LensSessionHandle sessionHandle,
String type,
String path)
Adds the resource. |
boolean |
cancelQuery(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
|
void |
closeDriverSessions(org.apache.lens.api.LensSessionHandle sessionHandle)
Allow drivers to release resources acquired for a session if any. |
void |
closeResultSet(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
|
void |
closeSession(org.apache.lens.api.LensSessionHandle sessionHandle)
Close session. |
protected QueryContext |
createContext(PreparedQueryContext pctx,
String userName,
org.apache.lens.api.LensConf conf,
org.apache.hadoop.conf.Configuration qconf)
Creates the context. |
protected QueryContext |
createContext(String query,
String userName,
org.apache.lens.api.LensConf conf,
org.apache.hadoop.conf.Configuration qconf)
Creates the context. |
void |
deleteResource(org.apache.lens.api.LensSessionHandle sessionHandle,
String type,
String path)
Delete resource. |
boolean |
destroyPrepared(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepared)
|
org.apache.lens.api.query.QueryHandleWithResultSet |
execute(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
long timeoutMillis,
org.apache.lens.api.LensConf conf,
String queryName)
|
org.apache.lens.api.query.QueryHandle |
executeAsync(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf conf,
String queryName)
|
org.apache.lens.api.query.QueryHandleWithResultSet |
executePrepare(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle,
long timeoutMillis,
org.apache.lens.api.LensConf conf,
String queryName)
|
org.apache.lens.api.query.QueryHandle |
executePrepareAsync(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle,
org.apache.lens.api.LensConf conf,
String queryName)
|
org.apache.lens.api.query.QueryPlan |
explain(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf lensConf)
|
org.apache.lens.api.query.QueryPlan |
explainAndPrepare(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf lensConf,
String queryName)
|
org.apache.lens.api.query.QueryResult |
fetchResultSet(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle,
long startIndex,
int fetchSize)
|
List<org.apache.lens.api.query.QueryPrepareHandle> |
getAllPreparedQueries(org.apache.lens.api.LensSessionHandle sessionHandle,
String user,
String queryName,
long fromDate,
long toDate)
|
List<org.apache.lens.api.query.QueryHandle> |
getAllQueries(org.apache.lens.api.LensSessionHandle sessionHandle,
String state,
String userName,
String queryName,
long fromDate,
long toDate)
|
protected LensEventService |
getEventService()
|
long |
getFinishedQueriesCount()
|
javax.ws.rs.core.Response |
getHttpResultSet(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
|
org.apache.lens.api.query.LensPreparedQuery |
getPreparedQuery(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle)
|
org.apache.lens.api.query.LensQuery |
getQuery(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
|
long |
getQueuedQueriesCount()
|
org.apache.lens.api.query.QueryResultSetMetadata |
getResultSetMetadata(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
|
long |
getRunningQueriesCount()
|
protected void |
handleDriverSessionStart(DriverEvent event)
Handle driver session start. |
void |
init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
|
void |
pauseQuerySubmitter()
Pause query submitter. |
org.apache.lens.api.query.QueryPrepareHandle |
prepare(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf lensConf,
String queryName)
|
void |
prepareStopping()
Prepare stopping. |
void |
readExternal(ObjectInput in)
|
void |
start()
|
void |
stop()
|
boolean |
updateQueryConf(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle,
org.apache.lens.api.LensConf newconf)
|
boolean |
updateQueryConf(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle,
org.apache.lens.api.LensConf newconf)
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.apache.lens.server.LensService |
|---|
acquire, acquire, getCliService, getHiveSessionHandle, getLensConf, getLensConf, getServerDomain, getSession, getSessionHandle, getSessionManager, openSession, release, release, restoreSession |
| Methods inherited from class org.apache.hive.service.CompositeService |
|---|
addService, getServices, removeService |
| Methods inherited from class org.apache.hive.service.AbstractService |
|---|
getHiveConf, getName, getServiceState, getStartTime, register, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, 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
protected final Thread querySubmitter
| Constructor Detail |
|---|
public QueryExecutionServiceImpl(org.apache.hive.service.cli.CLIService cliService)
throws org.apache.lens.api.LensException
cliService - the cli service
org.apache.lens.api.LensException - the lens exception| Method Detail |
|---|
protected LensEventService getEventService()
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 org.apache.lens.api.query.QueryPrepareHandle prepare(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf lensConf,
String queryName)
throws org.apache.lens.api.LensException
prepare in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryPlan explainAndPrepare(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf lensConf,
String queryName)
throws org.apache.lens.api.LensException
explainAndPrepare in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryHandle executePrepareAsync(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle,
org.apache.lens.api.LensConf conf,
String queryName)
throws org.apache.lens.api.LensException
executePrepareAsync in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryHandleWithResultSet executePrepare(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle,
long timeoutMillis,
org.apache.lens.api.LensConf conf,
String queryName)
throws org.apache.lens.api.LensException
executePrepare in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryHandle executeAsync(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf conf,
String queryName)
throws org.apache.lens.api.LensException
executeAsync in interface QueryExecutionServiceorg.apache.lens.api.LensException
protected QueryContext createContext(String query,
String userName,
org.apache.lens.api.LensConf conf,
org.apache.hadoop.conf.Configuration qconf)
throws org.apache.lens.api.LensException
query - the queryuserName - the user nameconf - the confqconf - the qconf
org.apache.lens.api.LensException - the lens exception
protected QueryContext createContext(PreparedQueryContext pctx,
String userName,
org.apache.lens.api.LensConf conf,
org.apache.hadoop.conf.Configuration qconf)
throws org.apache.lens.api.LensException
pctx - the pctxuserName - the user nameconf - the confqconf - the qconf
org.apache.lens.api.LensException - the lens exception
public boolean updateQueryConf(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle,
org.apache.lens.api.LensConf newconf)
throws org.apache.lens.api.LensException
updateQueryConf in interface QueryExecutionServiceorg.apache.lens.api.LensException
public boolean updateQueryConf(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle,
org.apache.lens.api.LensConf newconf)
throws org.apache.lens.api.LensException
updateQueryConf in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.LensQuery getQuery(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
throws org.apache.lens.api.LensException
getQuery in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.LensPreparedQuery getPreparedQuery(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepareHandle)
throws org.apache.lens.api.LensException
getPreparedQuery in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryHandleWithResultSet execute(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
long timeoutMillis,
org.apache.lens.api.LensConf conf,
String queryName)
throws org.apache.lens.api.LensException
execute in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryResultSetMetadata getResultSetMetadata(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
throws org.apache.lens.api.LensException
getResultSetMetadata in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryResult fetchResultSet(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle,
long startIndex,
int fetchSize)
throws org.apache.lens.api.LensException
fetchResultSet in interface QueryExecutionServiceorg.apache.lens.api.LensException
public void closeResultSet(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
throws org.apache.lens.api.LensException
closeResultSet in interface QueryExecutionServiceorg.apache.lens.api.LensException
public boolean cancelQuery(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
throws org.apache.lens.api.LensException
cancelQuery in interface QueryExecutionServiceorg.apache.lens.api.LensException
public List<org.apache.lens.api.query.QueryHandle> getAllQueries(org.apache.lens.api.LensSessionHandle sessionHandle,
String state,
String userName,
String queryName,
long fromDate,
long toDate)
throws org.apache.lens.api.LensException
getAllQueries in interface QueryExecutionServiceorg.apache.lens.api.LensException
public List<org.apache.lens.api.query.QueryPrepareHandle> getAllPreparedQueries(org.apache.lens.api.LensSessionHandle sessionHandle,
String user,
String queryName,
long fromDate,
long toDate)
throws org.apache.lens.api.LensException
getAllPreparedQueries in interface QueryExecutionServiceorg.apache.lens.api.LensException
public boolean destroyPrepared(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryPrepareHandle prepared)
throws org.apache.lens.api.LensException
destroyPrepared in interface QueryExecutionServiceorg.apache.lens.api.LensException
public org.apache.lens.api.query.QueryPlan explain(org.apache.lens.api.LensSessionHandle sessionHandle,
String query,
org.apache.lens.api.LensConf lensConf)
throws org.apache.lens.api.LensException
explain in interface QueryExecutionServiceorg.apache.lens.api.LensException
public void addResource(org.apache.lens.api.LensSessionHandle sessionHandle,
String type,
String path)
throws org.apache.lens.api.LensException
LensService
addResource in class LensServicesessionHandle - the session handletype - the typepath - the path
org.apache.lens.api.LensException - the lens exception
public void deleteResource(org.apache.lens.api.LensSessionHandle sessionHandle,
String type,
String path)
throws org.apache.lens.api.LensException
LensService
deleteResource in class LensServicesessionHandle - the session handletype - the typepath - the path
org.apache.lens.api.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(org.apache.lens.api.LensSessionHandle sessionHandle,
org.apache.lens.api.query.QueryHandle queryHandle)
throws org.apache.lens.api.LensException
getHttpResultSet in interface QueryExecutionServiceorg.apache.lens.api.LensExceptionpublic void closeDriverSessions(org.apache.lens.api.LensSessionHandle sessionHandle)
sessionHandle - the session handle
public void closeSession(org.apache.lens.api.LensSessionHandle sessionHandle)
throws org.apache.lens.api.LensException
LensService
closeSession in class LensServicesessionHandle - the session handle
org.apache.lens.api.LensException - the lens exceptionpublic long getQueuedQueriesCount()
getQueuedQueriesCount in interface QueryExecutionServicepublic long getRunningQueriesCount()
getRunningQueriesCount in interface QueryExecutionServicepublic long getFinishedQueriesCount()
getFinishedQueriesCount in interface QueryExecutionServiceprotected void handleDriverSessionStart(DriverEvent event)
event - the event
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||