Class AggregationManager


  • public class AggregationManager
    extends RolapAggregationManager
    RolapAggregationManager manages all Aggregations in the system. It is a singleton class.
    Since:
    30 August, 2001
    Author:
    jhyde
    • Constructor Detail

      • AggregationManager

        public AggregationManager​(MondrianServer server)
        Creates the AggregationManager.
    • Method Detail

      • getLogger

        public final org.apache.logging.log4j.Logger getLogger()
        Returns the log4j logger.
        Returns:
        Logger
      • loadAggregation

        public static void loadAggregation​(SegmentCacheManager cacheMgr,
                                           int cellRequestCount,
                                           List<RolapStar.Measure> measures,
                                           RolapStar.Column[] columns,
                                           AggregationKey aggregationKey,
                                           StarColumnPredicate[] predicates,
                                           GroupingSetsCollector groupingSetsCollector,
                                           List<Future<Map<Segment,​SegmentWithData>>> segmentFutures)
        Called by FastBatchingCellReader.load where the RolapStar creates an Aggregation if needed.
        Parameters:
        cacheMgr - Cache manager
        cellRequestCount - Number of missed cells that led to this request
        measures - Measures to load
        columns - this is the CellRequest's constrained columns
        aggregationKey - this is the CellRequest's constraint key
        predicates - Array of constraints on each column
        groupingSetsCollector - grouping sets collector
        segmentFutures - List of futures into which each statement will place a list of the segments it has loaded, when it completes
      • getCacheControl

        public CacheControl getCacheControl​(RolapConnection connection,
                                            PrintWriter pw)
        Returns an API with which to explicitly manage the contents of the cache.
        Parameters:
        connection - Server whose cache to control
        pw - Print writer, for tracing
        Returns:
        CacheControl API
      • getDrillThroughSql

        public String getDrillThroughSql​(DrillThroughCellRequest request,
                                         StarPredicate starPredicateSlicer,
                                         List<OlapElement> fields,
                                         boolean countOnly)
        Description copied from class: RolapAggregationManager
        Generates a SQL statement which will return the rows which contribute to this request.
        Specified by:
        getDrillThroughSql in class RolapAggregationManager
        Parameters:
        request - Cell request
        starPredicateSlicer - A StarPredicate representing slicer positions that could not be represented by the CellRequest, or null if no additional predicate is necessary.
        countOnly - If true, return a statment which returns only the count
        Returns:
        SQL statement
      • generateSql

        public static Pair<String,​List<SqlStatement.Type>> generateSql​(mondrian.rolap.agg.GroupingSetsList groupingSetsList,
                                                                             List<StarPredicate> compoundPredicateList)
        Generates the query to retrieve the cells for a list of segments. Called by Segment.load.
        Returns:
        A pair consisting of a SQL statement and a list of suggested types of columns
      • findAgg

        public static AggStar findAgg​(RolapStar star,
                                      BitKey levelBitKey,
                                      BitKey measureBitKey,
                                      boolean[] rollup)
        Finds an aggregate table in the given star which has the desired levels and measures. Returns null if no aggregate table is suitable.

        If there no aggregate is an exact match, returns a more granular aggregate which can be rolled up, and sets rollup to true. If one or more of the measures are distinct-count measures rollup is possible only in limited circumstances.

        Parameters:
        star - Star
        levelBitKey - Set of levels
        measureBitKey - Set of measures
        rollup - Out parameter, is set to true if the aggregate is not an exact match
        Returns:
        An aggregate, or null if none is suitable.
      • shutdown

        public void shutdown()