Package mondrian.server
Class StatementImpl
- java.lang.Object
-
- mondrian.server.StatementImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected Queryqueryprotected longqueryTimeoutQuery timeout, in milliseconds
-
Constructor Summary
Constructors Constructor Description StatementImpl()Creates a StatementImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Issues a cancel request on this statement.voidcheckCancelOrTimeout()Checks if either a cancel request has been issued on the query or the execution time has exceeded the timeout value (if one has been set).voidenableProfiling(ProfileHandler profileHandler)Enables profiling.voidend(Execution execution)Ends the current execution.ExecutiongetCurrentExecution()Returns execution context if currently executing, null otherwise.longgetId()Returns the ID of this statement, unique within the JVM.ProfileHandlergetProfileHandler()ObjectgetProperty(String name)QuerygetQuery()longgetQueryTimeoutMillis()Returns the query timeout of this statement, in milliseconds.RolapSchemagetSchema()Returns this statement's schema.SchemaReadergetSchemaReader()Returns this statement's schema reader.voidsetQuery(Query query)voidsetQueryTimeoutMillis(long timeoutMillis)Sets the timeout of this statement, in milliseconds.voidstart(Execution execution)Starts an execution.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface mondrian.server.Statement
close, getMondrianConnection
-
-
-
-
Field Detail
-
query
protected Query query
-
queryTimeout
protected long queryTimeout
Query timeout, in milliseconds
-
-
Method Detail
-
start
public void start(Execution execution)
Description copied from interface:StatementStarts an execution.
-
cancel
public void cancel() throws SQLExceptionDescription copied from interface:StatementIssues a cancel request on this statement.Once the thread running the statement detects the cancel request, execution will throw an exception. See
BasicQueryTest.testCancelfor an example of usage of this method.- Specified by:
cancelin interfaceStatement- Throws:
SQLException- on error
-
end
public void end(Execution execution)
Description copied from interface:StatementEnds the current execution.
-
enableProfiling
public void enableProfiling(ProfileHandler profileHandler)
Description copied from interface:StatementEnables profiling.Profiling information will be sent to the given writer when
Result.close()is called.If profileHandler is null, disables profiling.
- Specified by:
enableProfilingin interfaceStatement- Parameters:
profileHandler- Writer to which to send profiling information
-
getProfileHandler
public ProfileHandler getProfileHandler()
- Specified by:
getProfileHandlerin interfaceStatement
-
setQueryTimeoutMillis
public void setQueryTimeoutMillis(long timeoutMillis)
Description copied from interface:StatementSets the timeout of this statement, in milliseconds.Zero means no timeout.
Contrast with JDBC's
Statement.setQueryTimeout(int)method, which uses anintvalue and a granularity of seconds.- Specified by:
setQueryTimeoutMillisin interfaceStatement- Parameters:
timeoutMillis- Timeout in milliseconds
-
getQueryTimeoutMillis
public long getQueryTimeoutMillis()
Description copied from interface:StatementReturns the query timeout of this statement, in milliseconds.Zero means no timeout.
Contrast with JDBC's
Statement.getQueryTimeout()method, which uses anintvalue and a granularity of seconds.- Specified by:
getQueryTimeoutMillisin interfaceStatement- Returns:
- Timeout in milliseconds
-
checkCancelOrTimeout
public void checkCancelOrTimeout()
Description copied from interface:StatementChecks if either a cancel request has been issued on the query or the execution time has exceeded the timeout value (if one has been set). Exceptions are raised if either of these two conditions are met. This method should be called periodically during query execution to ensure timely detection of these events, particularly before/after any potentially long running operations.- Specified by:
checkCancelOrTimeoutin interfaceStatement
-
getSchemaReader
public SchemaReader getSchemaReader()
Description copied from interface:StatementReturns this statement's schema reader.- Specified by:
getSchemaReaderin interfaceStatement- Returns:
- Schema reader, not null
-
getSchema
public RolapSchema getSchema()
Description copied from interface:StatementReturns this statement's schema.
-
getProperty
public Object getProperty(String name)
- Specified by:
getPropertyin interfaceStatement
-
getCurrentExecution
public Execution getCurrentExecution()
Description copied from interface:StatementReturns execution context if currently executing, null otherwise.- Specified by:
getCurrentExecutionin interfaceStatement- Returns:
- Execution context
-
-