mondrian.rolap.agg
Class Aggregation

java.lang.Object
  extended by mondrian.rolap.agg.Aggregation

public class Aggregation
extends Object

A Aggregation is a pre-computed aggregation over a set of columns.

Rollup operations:

Representation of aggregations. Sparse and dense representations are necessary for different data sets. Should adapt automatically. Use an interface to hold the data set, so the segment doesn't care.

Suppose we have a segment {year=1997, quarter={1,2,3}, state={CA,WA}}. We want to roll up to a segment for {year=1997, state={CA,WA}}. We need to know that we have all quarters. We don't. Because year and quarter are independent, we know that we have all of the ...

Suppose we have a segment specified by {region=West, state=*, year=*}, which materializes to ({West}, {CA,WA,OR}, {1997,1998}). Because state=*, we can rollup to {region=West, year=*} or {region=West, year=1997}.

The space required for a segment depends upon the dimensionality (d), cell count (c) and the value count (v). We don't count the space required for the actual values, which is the same in any scheme.

Since:
28 August, 2001
Author:
jhyde

Constructor Summary
Aggregation(AggregationKey aggregationKey)
          Creates an Aggregation.
 
Method Summary
 BitKey getConstrainedColumnsBitKey()
          Returns the BitKey for ALL columns (Measures and Levels) involved in the query.
 Date getCreationTimestamp()
           
 RolapStar getStar()
          This is called during SQL generation.
 void load(SegmentCacheManager cacheMgr, int cellRequestCount, RolapStar.Column[] columns, List<RolapStar.Measure> measures, StarColumnPredicate[] predicates, GroupingSetsCollector groupingSetsCollector, List<Future<Map<Segment,SegmentWithData>>> segmentFutures)
          Loads a set of segments into this aggregation, one per measure, each constrained by the same set of column values, and each pinned once.
 StarColumnPredicate[] optimizePredicates(RolapStar.Column[] columns, StarColumnPredicate[] predicates)
          Drops predicates, where the list of values is close to the values which would be returned anyway.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aggregation

public Aggregation(AggregationKey aggregationKey)
Creates an Aggregation.

Parameters:
aggregationKey - the key specifying the axes, the context and the RolapStar for this Aggregation
Method Detail

getCreationTimestamp

public Date getCreationTimestamp()
Returns:
Returns the timestamp when the aggregation was created

load

public void load(SegmentCacheManager cacheMgr,
                 int cellRequestCount,
                 RolapStar.Column[] columns,
                 List<RolapStar.Measure> measures,
                 StarColumnPredicate[] predicates,
                 GroupingSetsCollector groupingSetsCollector,
                 List<Future<Map<Segment,SegmentWithData>>> segmentFutures)
Loads a set of segments into this aggregation, one per measure, each constrained by the same set of column values, and each pinned once.

A Column and its constraints are accessed at the same level in their respective arrays.

For example,

 measures = {unit_sales, store_sales},
 state = {CA, OR},
 gender = unconstrained

Parameters:
segmentFutures - List of futures wherein each statement will place a list of the segments it has loaded, when it completes

optimizePredicates

public StarColumnPredicate[] optimizePredicates(RolapStar.Column[] columns,
                                                StarColumnPredicate[] predicates)
Drops predicates, where the list of values is close to the values which would be returned anyway.


getStar

public RolapStar getStar()
This is called during SQL generation.


getConstrainedColumnsBitKey

public BitKey getConstrainedColumnsBitKey()
Returns the BitKey for ALL columns (Measures and Levels) involved in the query.


Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads