Class 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 Detail

      • compiledExps

        final Map<mondrian.rolap.RolapEvaluatorRoot.CompiledExpKey,​Calc> compiledExps
      • 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
      • activeNativeExpansions

        final Set<Exp> activeNativeExpansions
      • recursionCheckCommandCount

        int recursionCheckCommandCount
        The size of the command stack at which we will next check for recursion.
      • execution

        public final Execution execution
    • Constructor Detail

      • RolapEvaluatorRoot

        public RolapEvaluatorRoot​(Statement statement)
        Deprecated.
        Creates a RolapEvaluatorRoot.
        Parameters:
        statement - statement
      • RolapEvaluatorRoot

        public RolapEvaluatorRoot​(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 - Expression
        scalar - Whether expression is scalar
        resultStyle - Preferred result style; if null, use query's default result style; ignored if expression is scalar
        Returns:
        compiled expression
      • evaluateSet

        protected Evaluator.SetEvaluator evaluateSet​(Exp exp,
                                                     boolean create)
        Evaluates a named set represented by an expression.

        The default implementation throws UnsupportedOperationException.

        Parameters:
        exp - Expression
        create - Whether to create named set evaluator if not found
      • putCacheResult

        public final void putCacheResult​(Object key,
                                         Object result,
                                         boolean isValidResult)
        Puts result in cache.
        Parameters:
        key - key
        result - value to be cached
        isValidResult - 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