Interface Statement
- All Known Implementing Classes:
StatementImpl
This interface is typically implemented by a MondrianOlap4jStatement, but not necessarily: statements may be created internally, not via olap4j.
Not part of Mondrian's public API. This class may change without notice.
- Author:
- jhyde
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Issues a cancel request on this statement.void
Deprecated.void
close()
Closes this statement.void
enableProfiling
(ProfileHandler profileHandler) Enables profiling.void
Ends the current execution.Returns execution context if currently executing, null otherwise.long
getId()
Returns the ID of this statement, unique within the JVM.Returns this statement's connection.getProperty
(String name) getQuery()
long
Returns the query timeout of this statement, in milliseconds.Returns this statement's schema.Returns this statement's schema reader.void
void
setQueryTimeoutMillis
(long timeoutMillis) Sets the timeout of this statement, in milliseconds.void
Starts an execution.
-
Method Details
-
close
void close()Closes this statement. -
getSchemaReader
SchemaReader getSchemaReader()Returns this statement's schema reader.- Returns:
- Schema reader, not null
-
getSchema
RolapSchema getSchema()Returns this statement's schema.- Returns:
- Schema, not null
-
getMondrianConnection
RolapConnection getMondrianConnection()Returns this statement's connection.- Returns:
- connection
-
getProperty
-
getQuery
Query getQuery() -
setQuery
-
enableProfiling
Enables profiling.Profiling information will be sent to the given writer when
Result.close()
is called.If profileHandler is null, disables profiling.
- Parameters:
profileHandler
- Writer to which to send profiling information
-
getProfileHandler
ProfileHandler getProfileHandler() -
setQueryTimeoutMillis
void setQueryTimeoutMillis(long timeoutMillis) Sets the timeout of this statement, in milliseconds.Zero means no timeout.
Contrast with JDBC's
Statement.setQueryTimeout(int)
method, which uses anint
value and a granularity of seconds.- Parameters:
timeoutMillis
- Timeout in milliseconds
-
getQueryTimeoutMillis
long getQueryTimeoutMillis()Returns the query timeout of this statement, in milliseconds.Zero means no timeout.
Contrast with JDBC's
Statement.getQueryTimeout()
method, which uses anint
value and a granularity of seconds.- Returns:
- Timeout in milliseconds
-
checkCancelOrTimeout
void checkCancelOrTimeout()Deprecated.This method will be removed in mondrian-4.0; useExecution.checkCancelOrTimeout()
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). 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. -
cancel
Issues a cancel request on this statement.Once the thread running the statement detects the cancel request, execution will throw an exception. See
BasicQueryTest.testCancel
for an example of usage of this method.- Throws:
SQLException
- on error
-
getCurrentExecution
Execution getCurrentExecution()Returns execution context if currently executing, null otherwise.- Returns:
- Execution context
-
end
Ends the current execution.- Parameters:
execution
- Execution; must match the execution that was started- Throws:
IllegalArgumentException
- if not started, or if execution does not match
-
start
Starts an execution.- Parameters:
execution
- Execution context
-
getId
long getId()Returns the ID of this statement, unique within the JVM.- Returns:
- Unique ID of this statement
-
Execution.checkCancelOrTimeout()