mondrian.rolap.agg
Class AggregationManager

java.lang.Object
  extended by mondrian.rolap.RolapAggregationManager
      extended by mondrian.rolap.agg.AggregationManager
Direct Known Subclasses:
CountingAggregationManager

public class AggregationManager
extends RolapAggregationManager

RolapAggregationManager manages all Aggregations in the system. It is a singleton class.

Since:
30 August, 2001
Author:
jhyde
 

Nested Class Summary
static class AggregationManager.PinSetImpl
          Implementation of RolapAggregationManager.PinSet using a HashSet.
 
Nested classes/interfaces inherited from class mondrian.rolap.RolapAggregationManager
RolapAggregationManager.PinSet
 
Constructor Summary
AggregationManager()
           
 
Method Summary
 RolapAggregationManager.PinSet createPinSet()
          Creates a RolapAggregationManager.PinSet.
 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.
 String generateSql(GroupingSetsList groupingSetsList, List<StarPredicate> compoundPredicateList)
          Generates the query to retrieve the cells for a list of segments.
 Object getCellFromCache(CellRequest request)
          Retrieves the value of a cell from the cache.
 Object getCellFromCache(CellRequest request, RolapAggregationManager.PinSet pinSet)
           
 String getDrillThroughSql(CellRequest request, boolean countOnly)
          Generates a SQL statement which will return the rows which contribute to this request.
 org.apache.log4j.Logger getLogger()
           
static AggregationManager instance()
          Returns or creates the singleton.
 void loadAggregation(RolapStar.Measure[] measures, RolapStar.Column[] columns, AggregationKey aggregationKey, StarColumnPredicate[] predicates, RolapAggregationManager.PinSet pinnedSegments, GroupingSetsCollector groupingSetsCollector)
          Called by FastBatchingCellReader.loadAggregation where the RolapStar creates an Aggregation if needed.
 
Methods inherited from class mondrian.rolap.RolapAggregationManager
getCacheCellReader, getCacheControl, makeCacheRegion, makeDrillThroughRequest, makeRequest, makeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregationManager

AggregationManager()
Method Detail

instance

public static AggregationManager instance()
Returns or creates the singleton.


getLogger

public org.apache.log4j.Logger getLogger()

loadAggregation

public void loadAggregation(RolapStar.Measure[] measures,
                            RolapStar.Column[] columns,
                            AggregationKey aggregationKey,
                            StarColumnPredicate[] predicates,
                            RolapAggregationManager.PinSet pinnedSegments,
                            GroupingSetsCollector groupingSetsCollector)
Called by FastBatchingCellReader.loadAggregation where the RolapStar creates an Aggregation if needed.

Parameters:
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
pinnedSegments - Set of pinned segments
groupingSetsCollector - grouping sets collector

getCellFromCache

public Object getCellFromCache(CellRequest request)
Description copied from class: RolapAggregationManager
Retrieves the value of a cell from the cache.

Specified by:
getCellFromCache in class RolapAggregationManager
Parameters:
request - Cell request
Returns:
Cell value, or null if cell is not in any aggregation in cache, or Util.nullValue if cell's value is null

getCellFromCache

public Object getCellFromCache(CellRequest request,
                               RolapAggregationManager.PinSet pinSet)
Specified by:
getCellFromCache in class RolapAggregationManager

getDrillThroughSql

public String getDrillThroughSql(CellRequest request,
                                 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
countOnly - If true, return a statment which returns only the count
Returns:
SQL statement

generateSql

public String generateSql(GroupingSetsList groupingSetsList,
                          List<StarPredicate> compoundPredicateList)
Generates the query to retrieve the cells for a list of segments. Called by Segment.load


findAgg

public 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.

createPinSet

public RolapAggregationManager.PinSet createPinSet()
Description copied from class: RolapAggregationManager
Creates a RolapAggregationManager.PinSet.

Specified by:
createPinSet in class RolapAggregationManager
Returns:
a new PinSet

SourceForge.net_Logo