Package mondrian.rolap
Class RolapEvaluatorRoot
- java.lang.Object
-
- mondrian.rolap.RolapEvaluatorRoot
-
- Direct Known Subclasses:
RolapResult.RolapResultEvaluatorRoot
class RolapEvaluatorRoot extends Object
Context at the root of a tree of evaluators.Contains the context that does not change as evaluation context is pushed/popped.
- Since:
- Nov 11, 2008
- Author:
- jhyde
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Set<Exp>
activeNativeExpansions
(package private) Map<mondrian.rolap.RolapEvaluatorRoot.CompiledExpKey,Calc>
compiledExps
(package private) RolapConnection
connection
(package private) RolapCube
cube
(package private) Dialect
currentDialect
(package private) RolapMember[]
defaultMembers
Default members of each hierarchy, from the schema reader's perspective.Execution
execution
(package private) Map<Object,Object>
expResultCache
(package private) int
nonAllPositionCount
(package private) int[]
nonAllPositions
(package private) Query
query
(package private) int
recursionCheckCommandCount
The size of the command stack at which we will next check for recursion.(package private) SchemaReader
schemaReader
(package private) SolveOrderMode
solveOrderMode
(package private) Statement
statement
(package private) Map<Object,Object>
tmpExpResultCache
-
Constructor Summary
Constructors Constructor Description RolapEvaluatorRoot(Execution execution)
RolapEvaluatorRoot(Statement statement)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearResultCache(boolean clearValidResult)
Clears the expression result cache.protected Evaluator.NamedSetEvaluator
evaluateNamedSet(NamedSet namedSet, boolean create)
Evaluates a named set.protected Evaluator.SetEvaluator
evaluateSet(Exp exp, boolean create)
Evaluates a named set represented by an expression.Object
getCacheResult(Object key)
Gets result from cache.(package private) Calc
getCompiled(Exp exp, boolean scalar, ResultStyle resultStyle)
Implements a cheap-and-cheerful mapping from expressions to compiled expressions.Object
getParameterValue(ParameterSlot slot)
Returns the value of a parameter, evaluating its default expression if necessary.Date
getQueryStartTime()
Get query start time.void
putCacheResult(Object key, Object result, boolean isValidResult)
Puts result in cache.
-
-
-
Field Detail
-
cube
final RolapCube cube
-
connection
final RolapConnection connection
-
schemaReader
final SchemaReader schemaReader
-
statement
final Statement statement
-
query
final Query query
-
currentDialect
final Dialect currentDialect
-
defaultMembers
final RolapMember[] defaultMembers
Default members of each hierarchy, from the schema reader's perspective. Finding the default member is moderately expensive, but happens very often.
-
nonAllPositions
final int[] nonAllPositions
-
nonAllPositionCount
int nonAllPositionCount
-
solveOrderMode
final SolveOrderMode solveOrderMode
-
recursionCheckCommandCount
int recursionCheckCommandCount
The size of the command stack at which we will next check for recursion.
-
execution
public final Execution execution
-
-
Method Detail
-
getCompiled
final Calc getCompiled(Exp exp, boolean scalar, ResultStyle resultStyle)
Implements a cheap-and-cheerful mapping from expressions to compiled expressions.TODO: Save compiled expressions somewhere better.
- Parameters:
exp
- Expressionscalar
- Whether expression is scalarresultStyle
- Preferred result style; if null, use query's default result style; ignored if expression is scalar- Returns:
- compiled expression
-
evaluateNamedSet
protected Evaluator.NamedSetEvaluator evaluateNamedSet(NamedSet namedSet, boolean create)
Evaluates a named set.The default implementation throws
UnsupportedOperationException
.- Parameters:
namedSet
- Named setcreate
- Whether to create named set evaluator if not found
-
evaluateSet
protected Evaluator.SetEvaluator evaluateSet(Exp exp, boolean create)
Evaluates a named set represented by an expression.The default implementation throws
UnsupportedOperationException
.- Parameters:
exp
- Expressioncreate
- Whether to create named set evaluator if not found
-
getParameterValue
public Object getParameterValue(ParameterSlot slot)
Returns the value of a parameter, evaluating its default expression if necessary.The default implementation throws
UnsupportedOperationException
.
-
putCacheResult
public final void putCacheResult(Object key, Object result, boolean isValidResult)
Puts result in cache.- Parameters:
key
- keyresult
- value to be cachedisValidResult
- indicate if this result is valid
-
getCacheResult
public final Object getCacheResult(Object key)
Gets result from cache.- Parameters:
key
- cache key- Returns:
- cached expression
-
clearResultCache
public final void clearResultCache(boolean clearValidResult)
Clears the expression result cache.- Parameters:
clearValidResult
- whether to clear valid expression results
-
getQueryStartTime
public Date getQueryStartTime()
Get query start time.- Returns:
- the query start time
-
-