|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmondrian.rolap.RolapUtil
public class RolapUtil
Utility methods for classes in the mondrian.rolap
package.
Nested Class Summary | |
---|---|
(package private) static interface |
RolapUtil.ExecuteQueryHook
|
(package private) static class |
RolapUtil.Semaphore
A Semaphore is a primitive for process synchronization. |
static class |
RolapUtil.TeeWriter
Writes to a string and also to an underlying writer. |
Field Summary | |
---|---|
(package private) static org.apache.log4j.Logger |
LOGGER
|
static org.apache.log4j.Logger |
MDX_LOGGER
|
static org.apache.log4j.Logger |
SQL_LOGGER
|
static java.lang.String |
sqlNullLiteral
|
static java.lang.Comparable |
sqlNullValue
Special value represents a null key. |
(package private) static java.lang.ThreadLocal<RolapUtil.ExecuteQueryHook> |
threadHooks
Hook to run when a query is executed. |
static java.lang.Object |
valueNotReadyException
Special cell value indicates that the value is not in cache yet. |
Constructor Summary | |
---|---|
RolapUtil()
|
Method Summary | |
---|---|
static void |
alertNonNative(java.lang.String functionName,
java.lang.String reason)
Raises an alert that native SQL evaluation could not be used in a case where it might have been beneficial, but some limitation in Mondrian's implementation prevented it. |
static MondrianDef.Relation |
convertInlineTableToRelation(MondrianDef.InlineTable inlineTable,
Dialect dialect)
|
static ExpCompiler |
createDependencyTestingCompiler(ExpCompiler compiler)
Creates a compiler which will generate programs which will test whether the dependencies declared via Calc.dependsOn(Hierarchy) are accurate. |
static Evaluator |
createEvaluator(Query query)
Creates a dummy evaluator. |
static SqlStatement |
executeQuery(javax.sql.DataSource dataSource,
java.lang.String sql,
int maxRows,
java.lang.String component,
java.lang.String message,
int resultSetType,
int resultSetConcurrency)
Executes a query. |
static SqlStatement |
executeQuery(javax.sql.DataSource dataSource,
java.lang.String sql,
java.lang.String component,
java.lang.String message)
Executes a query, printing to the trace log if tracing is enabled. |
static Member |
findBestMemberMatch(java.util.List<? extends Member> members,
RolapMember parent,
RolapLevel level,
Id.Segment searchName,
MatchType matchType,
boolean caseInsensitive)
Locates a member specified by its member name, from an array of members. |
(package private) static RolapUtil.Semaphore |
getQuerySemaphore()
Gets the semaphore which controls how many people can run queries simultaneously. |
static void |
loadDrivers(java.lang.String jdbcDrivers)
Loads a set of JDBC drivers. |
(package private) static RolapMember |
lookupMember(MemberReader reader,
java.util.List<Id.Segment> uniqueNameParts,
boolean failIfNotFound)
|
static java.lang.String |
mdxNullLiteral()
|
static void |
reloadNullLiteral()
|
(package private) static RolapMember[] |
toArray(java.util.List<RolapMember> v)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger MDX_LOGGER
public static final org.apache.log4j.Logger SQL_LOGGER
static final org.apache.log4j.Logger LOGGER
public static final java.lang.Object valueNotReadyException
static final java.lang.ThreadLocal<RolapUtil.ExecuteQueryHook> threadHooks
public static final java.lang.Comparable sqlNullValue
public static final java.lang.String sqlNullLiteral
Constructor Detail |
---|
public RolapUtil()
Method Detail |
---|
public static java.lang.String mdxNullLiteral()
public static void reloadNullLiteral()
static RolapMember[] toArray(java.util.List<RolapMember> v)
static RolapMember lookupMember(MemberReader reader, java.util.List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
public static SqlStatement executeQuery(javax.sql.DataSource dataSource, java.lang.String sql, java.lang.String component, java.lang.String message)
If the query fails, it wraps the SQLException
in a runtime
exception with message
as description, and closes the result
set.
If it succeeds, the caller must call the SqlStatement.close()
method of the returned SqlStatement
.
dataSource
- DataSourcesql
- SQL stringcomponent
- Description of a the component executing the query,
generally a method name, e.g. "SqlTupleReader.readTuples"message
- Description of the purpose of this statement, to be
printed if there is an error
public static SqlStatement executeQuery(javax.sql.DataSource dataSource, java.lang.String sql, int maxRows, java.lang.String component, java.lang.String message, int resultSetType, int resultSetConcurrency)
If the query fails, it wraps the SQLException
in a runtime
exception with message
as description, and closes the result
set.
If it succeeds, the caller must call the SqlStatement.close()
method of the returned SqlStatement
.
dataSource
- DataSourcesql
- SQL stringmaxRows
- Row limit, or -1 if no limitcomponent
- Description of a the component executing the query,
generally a method name, e.g. "SqlTupleReader.readTuples"message
- Description of the purpose of this statement, to be
printed if there is an errorresultSetType
- Result set type, or -1 to use defaultresultSetConcurrency
- Result set concurrency, or -1 to use default
public static void alertNonNative(java.lang.String functionName, java.lang.String reason) throws NativeEvaluationUnsupportedException
functionName
- name of function for which native evaluation
was skippedreason
- reason why native evaluation was skipped
NativeEvaluationUnsupportedException
public static void loadDrivers(java.lang.String jdbcDrivers)
jdbcDrivers
- A string consisting of the comma-separated names
of JDBC driver classes. For example
"sun.jdbc.odbc.JdbcOdbcDriver,com.mysql.jdbc.Driver"
.public static ExpCompiler createDependencyTestingCompiler(ExpCompiler compiler)
Calc.dependsOn(Hierarchy)
are accurate.
public static Member findBestMemberMatch(java.util.List<? extends Member> members, RolapMember parent, RolapLevel level, Id.Segment searchName, MatchType matchType, boolean caseInsensitive)
members
- array of members to search fromparent
- parent member corresponding to the member being searched
forlevel
- level of the membersearchName
- member namematchType
- match typecaseInsensitive
- if true, use case insensitive search (if
applicable) when when doing exact searches
public static MondrianDef.Relation convertInlineTableToRelation(MondrianDef.InlineTable inlineTable, Dialect dialect)
static RolapUtil.Semaphore getQuerySemaphore()
public static Evaluator createEvaluator(Query query)
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |