public abstract class AbstractQuery extends java.lang.Object implements Query
Query.CancelStatus| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.Object> |
batchedArgs
Holds batched commands
|
protected java.lang.Object |
cancelTimeoutMutex
Mutex to prevent race between returning query results and noticing that query has been timed-out or cancelled.
|
protected java.lang.String |
charEncoding
The character encoding to use (if available)
|
protected boolean |
clearWarningsCalled
Has clearWarnings() been called?
|
protected java.lang.String |
currentDb
The database in use
|
protected int |
fetchSize
The number of rows to fetch at a time (currently ignored)
|
protected RuntimeProperty<java.lang.Integer> |
maxAllowedPacket |
protected QueryAttributesBindings |
queryAttributesBindings
Query attributes bindings
|
protected Resultset.Type |
resultSetType
The type of this result set (scroll sensitive or in-sensitive)
|
NativeSession |
session |
protected java.util.concurrent.atomic.AtomicBoolean |
statementExecuting
Currently executing a statement?
|
protected int |
statementId
Used to identify this statement when profiling.
|
protected int |
timeoutInMillis
The timeout for a query
|
| Constructor and Description |
|---|
AbstractQuery(NativeSession sess) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch(java.lang.Object batch) |
void |
checkCancelTimeout() |
void |
clearBatchedArgs() |
void |
closeQuery() |
java.util.List<java.lang.Object> |
getBatchedArgs()
Get the batched args as added by the addBatch method(s).
|
java.lang.Object |
getCancelTimeoutMutex() |
java.lang.String |
getCurrentDatabase() |
long |
getExecuteTime()
Returns the elapsed time for the server to execute the query.
|
int |
getId()
Returns the query id used when profiling
|
QueryAttributesBindings |
getQueryAttributesBindings() |
int |
getResultFetchSize() |
<T extends Resultset,M extends Message> |
getResultSetFactory() |
Resultset.Type |
getResultType() |
NativeSession |
getSession() |
java.util.concurrent.atomic.AtomicBoolean |
getStatementExecuting() |
int |
getTimeoutInMillis() |
boolean |
isClearWarningsCalled() |
void |
resetCancelledState() |
void |
setCancelStatus(Query.CancelStatus cs) |
void |
setClearWarningsCalled(boolean clearWarningsCalled) |
void |
setCurrentDatabase(java.lang.String currentDb) |
void |
setExecuteTime(long executeTime) |
void |
setResultFetchSize(int fetchSize) |
void |
setResultType(Resultset.Type resultSetType) |
void |
setTimeoutInMillis(int timeoutInMillis) |
CancelQueryTask |
startQueryTimer(Query stmtToCancel,
int timeout) |
void |
statementBegins() |
void |
stopQueryTimer(CancelQueryTask timeoutTask,
boolean rethrowCancelReason,
boolean checkCancelTimeout) |
public NativeSession session
protected int statementId
protected RuntimeProperty<java.lang.Integer> maxAllowedPacket
protected java.lang.String charEncoding
protected java.lang.Object cancelTimeoutMutex
protected int timeoutInMillis
protected java.util.List<java.lang.Object> batchedArgs
protected Resultset.Type resultSetType
protected int fetchSize
protected final java.util.concurrent.atomic.AtomicBoolean statementExecuting
protected java.lang.String currentDb
protected boolean clearWarningsCalled
protected QueryAttributesBindings queryAttributesBindings
public AbstractQuery(NativeSession sess)
public int getId()
Querypublic void setCancelStatus(Query.CancelStatus cs)
setCancelStatus in interface Querypublic long getExecuteTime()
QuerygetExecuteTime in interface Querypublic void setExecuteTime(long executeTime)
setExecuteTime in interface Querypublic void checkCancelTimeout()
checkCancelTimeout in interface Querypublic void resetCancelledState()
resetCancelledState in interface Querypublic <T extends Resultset,M extends Message> ProtocolEntityFactory<T,M> getResultSetFactory()
getResultSetFactory in interface Querypublic NativeSession getSession()
getSession in interface Querypublic java.lang.Object getCancelTimeoutMutex()
getCancelTimeoutMutex in interface Querypublic void closeQuery()
closeQuery in interface Querypublic java.util.List<java.lang.Object> getBatchedArgs()
QuerygetBatchedArgs in interface Querypublic void clearBatchedArgs()
clearBatchedArgs in interface Querypublic QueryAttributesBindings getQueryAttributesBindings()
getQueryAttributesBindings in interface Querypublic int getResultFetchSize()
getResultFetchSize in interface Querypublic void setResultFetchSize(int fetchSize)
setResultFetchSize in interface Querypublic Resultset.Type getResultType()
getResultType in interface Querypublic void setResultType(Resultset.Type resultSetType)
setResultType in interface Querypublic int getTimeoutInMillis()
getTimeoutInMillis in interface Querypublic void setTimeoutInMillis(int timeoutInMillis)
setTimeoutInMillis in interface Querypublic CancelQueryTask startQueryTimer(Query stmtToCancel, int timeout)
startQueryTimer in interface Querypublic void stopQueryTimer(CancelQueryTask timeoutTask, boolean rethrowCancelReason, boolean checkCancelTimeout)
stopQueryTimer in interface Querypublic java.util.concurrent.atomic.AtomicBoolean getStatementExecuting()
getStatementExecuting in interface Querypublic java.lang.String getCurrentDatabase()
getCurrentDatabase in interface Querypublic void setCurrentDatabase(java.lang.String currentDb)
setCurrentDatabase in interface Querypublic boolean isClearWarningsCalled()
isClearWarningsCalled in interface Querypublic void setClearWarningsCalled(boolean clearWarningsCalled)
setClearWarningsCalled in interface Querypublic void statementBegins()
statementBegins in interface Query