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()
Query
public void setCancelStatus(Query.CancelStatus cs)
setCancelStatus
in interface Query
public long getExecuteTime()
Query
getExecuteTime
in interface Query
public void setExecuteTime(long executeTime)
setExecuteTime
in interface Query
public void checkCancelTimeout()
checkCancelTimeout
in interface Query
public void resetCancelledState()
resetCancelledState
in interface Query
public <T extends Resultset,M extends Message> ProtocolEntityFactory<T,M> getResultSetFactory()
getResultSetFactory
in interface Query
public NativeSession getSession()
getSession
in interface Query
public java.lang.Object getCancelTimeoutMutex()
getCancelTimeoutMutex
in interface Query
public void closeQuery()
closeQuery
in interface Query
public java.util.List<java.lang.Object> getBatchedArgs()
Query
getBatchedArgs
in interface Query
public void clearBatchedArgs()
clearBatchedArgs
in interface Query
public QueryAttributesBindings getQueryAttributesBindings()
getQueryAttributesBindings
in interface Query
public int getResultFetchSize()
getResultFetchSize
in interface Query
public void setResultFetchSize(int fetchSize)
setResultFetchSize
in interface Query
public Resultset.Type getResultType()
getResultType
in interface Query
public void setResultType(Resultset.Type resultSetType)
setResultType
in interface Query
public int getTimeoutInMillis()
getTimeoutInMillis
in interface Query
public void setTimeoutInMillis(int timeoutInMillis)
setTimeoutInMillis
in interface Query
public CancelQueryTask startQueryTimer(Query stmtToCancel, int timeout)
startQueryTimer
in interface Query
public void stopQueryTimer(CancelQueryTask timeoutTask, boolean rethrowCancelReason, boolean checkCancelTimeout)
stopQueryTimer
in interface Query
public java.util.concurrent.atomic.AtomicBoolean getStatementExecuting()
getStatementExecuting
in interface Query
public java.lang.String getCurrentDatabase()
getCurrentDatabase
in interface Query
public void setCurrentDatabase(java.lang.String currentDb)
setCurrentDatabase
in interface Query
public boolean isClearWarningsCalled()
isClearWarningsCalled
in interface Query
public void setClearWarningsCalled(boolean clearWarningsCalled)
setClearWarningsCalled
in interface Query
public void statementBegins()
statementBegins
in interface Query