public class LensStatement extends Object
| Constructor and Description | 
|---|
| LensStatement(LensConnection connection)Instantiates a new lens statement. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | closeResultSet()Close result set. | 
| boolean | destroyPrepared(QueryPrepareHandle phandle)Destroy prepared. | 
| LensAPIResult<QueryHandle> | execute(String sql,
       boolean waitForQueryToComplete,
       String queryName)Execute. | 
| void | execute(String sql,
       String queryName)Execute. | 
| QueryHandle | executeQuery(QueryPrepareHandle phandle,
            boolean waitForQueryToComplete,
            String queryName)Execute query. | 
| QueryHandle | executeQuery(QueryPrepareHandle phandle,
            String queryName)Execute query. | 
| LensAPIResult<QueryHandle> | executeQuery(String sql,
            boolean waitForQueryToComplete,
            String queryName)Execute query. | 
| QueryPlan | explainAndPrepare(String sql,
                 String queryName)Explain and prepare. | 
| QueryPlan | explainQuery(String sql)Explain query. | 
| List<QueryPrepareHandle> | getAllPreparedQueries(String userName,
                     String queryName,
                     long fromDate,
                     long toDate)Gets the all prepared queries. | 
| List<QueryHandle> | getAllQueries(String state,
             String queryName,
             String user,
             long fromDate,
             long toDate)Gets the all queries. | 
| int | getErrorCode() | 
| String | getErrorMessage() | 
| javax.ws.rs.core.Response | getHttpResultSet() | 
| javax.ws.rs.core.Response | getHttpResultSet(LensQuery query)Gets the http result set. | 
| LensPreparedQuery | getPreparedQuery(QueryPrepareHandle handle)Gets the prepared query. | 
| LensQuery | getQuery() | 
| LensQuery | getQuery(QueryHandle handle)Gets the query. | 
| String | getQueryHandleString() | 
| QueryResult | getResultSet() | 
| QueryResult | getResultSet(LensQuery query)Gets the result set. | 
| QueryResultSetMetadata | getResultSetMetaData() | 
| QueryResultSetMetadata | getResultSetMetaData(LensQuery query)Gets the result set meta data. | 
| QueryStatus | getStatus() | 
| boolean | isIdle() | 
| boolean | kill()Kill. | 
| boolean | kill(LensQuery query)Kill. | 
| QueryPrepareHandle | prepareQuery(String sql,
            String queryName)Prepare query. | 
| void | waitForQueryToComplete(QueryHandle handle)Wait for query to complete. | 
| boolean | wasQuerySuccessful()Was query successful. | 
public LensStatement(LensConnection connection)
connection - the connectionpublic LensAPIResult<QueryHandle> execute(String sql, boolean waitForQueryToComplete, String queryName) throws LensAPIException
sql - the sqlwaitForQueryToComplete - the wait for query to completequeryName - the query nameLensAPIExceptionpublic void execute(String sql, String queryName) throws LensAPIException
sql - the sqlqueryName - the query nameLensAPIExceptionpublic LensAPIResult<QueryHandle> executeQuery(String sql, boolean waitForQueryToComplete, String queryName) throws LensAPIException
sql - the sqlwaitForQueryToComplete - the wait for query to completequeryName - the query nameLensAPIExceptionpublic QueryHandle executeQuery(QueryPrepareHandle phandle, boolean waitForQueryToComplete, String queryName)
phandle - the phandlewaitForQueryToComplete - the wait for query to completequeryName - the query namepublic QueryPrepareHandle prepareQuery(String sql, String queryName)
sql - the sqlqueryName - the query namepublic QueryPlan explainAndPrepare(String sql, String queryName)
sql - the sqlqueryName - the query namepublic void waitForQueryToComplete(QueryHandle handle)
handle - the handlepublic LensQuery getQuery(QueryHandle handle)
handle - the handlepublic LensPreparedQuery getPreparedQuery(QueryPrepareHandle handle)
handle - the handlepublic QueryHandle executeQuery(QueryPrepareHandle phandle, String queryName)
phandle - the phandlequeryName - the query namepublic QueryPlan explainQuery(String sql)
sql - the sqlpublic List<QueryHandle> getAllQueries(String state, String queryName, String user, long fromDate, long toDate)
state - the statequeryName - the query nameuser - the userfromDate - the from datetoDate - the to datepublic List<QueryPrepareHandle> getAllPreparedQueries(String userName, String queryName, long fromDate, long toDate)
userName - the user namequeryName - the query namefromDate - the from datetoDate - the to datepublic QueryResultSetMetadata getResultSetMetaData()
public QueryResultSetMetadata getResultSetMetaData(LensQuery query)
query - the querypublic QueryResult getResultSet()
public javax.ws.rs.core.Response getHttpResultSet()
public QueryResult getResultSet(LensQuery query)
query - the querypublic javax.ws.rs.core.Response getHttpResultSet(LensQuery query)
query - the querypublic boolean kill()
public boolean kill(LensQuery query)
query - the querypublic boolean closeResultSet()
public boolean destroyPrepared(QueryPrepareHandle phandle)
phandle - the phandlepublic boolean isIdle()
public boolean wasQuerySuccessful()
public QueryStatus getStatus()
public LensQuery getQuery()
public int getErrorCode()
public String getErrorMessage()
public String getQueryHandleString()
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.