Package mondrian.rolap.agg
Class AggregationManager
- java.lang.Object
-
- mondrian.rolap.RolapAggregationManager
-
- mondrian.rolap.agg.AggregationManager
-
public class AggregationManager extends RolapAggregationManager
RolapAggregationManager
manages allAggregation
s in the system. It is a singleton class.- Since:
- 30 August, 2001
- Author:
- jhyde
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AggregationManager.PinSetImpl
Implementation ofRolapAggregationManager.PinSet
using aHashSet
.-
Nested classes/interfaces inherited from class mondrian.rolap.RolapAggregationManager
RolapAggregationManager.PinSet
-
-
Field Summary
Fields Modifier and Type Field Description SegmentCacheManager
cacheMgr
-
Constructor Summary
Constructors Constructor Description AggregationManager(MondrianServer server)
Creates the AggregationManager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RolapAggregationManager.PinSet
createPinSet()
Creates aRolapAggregationManager.PinSet
.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.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.CacheControl
getCacheControl(RolapConnection connection, PrintWriter pw)
Returns an API with which to explicitly manage the contents of the cache.SegmentCacheManager
getCacheMgr()
Object
getCellFromAllCaches(CellRequest request)
Object
getCellFromCache(CellRequest request)
Retrieves the value of a cell from the cache.Object
getCellFromCache(CellRequest request, RolapAggregationManager.PinSet pinSet)
String
getDrillThroughSql(DrillThroughCellRequest request, StarPredicate starPredicateSlicer, List<OlapElement> fields, boolean countOnly)
Generates a SQL statement which will return the rows which contribute to this request.org.apache.logging.log4j.Logger
getLogger()
Returns the log4j logger.static AggregationManager
instance()
Deprecated.No longer a singleton, and will be removed in mondrian-4.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.void
shutdown()
-
Methods inherited from class mondrian.rolap.RolapAggregationManager
getCacheCellReader, makeCacheRegion, makeDrillThroughRequest, makeRequest, makeRequest
-
-
-
-
Field Detail
-
cacheMgr
public final SegmentCacheManager cacheMgr
-
-
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
-
instance
public static AggregationManager instance()
Deprecated.No longer a singleton, and will be removed in mondrian-4. UseMondrianServer.getAggregationManager()
. To get a server, callMondrianServer.forConnection(mondrian.olap.Connection)
, passing in a null connection if you absolutely must.Returns or creates the singleton.
-
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 managercellRequestCount
- Number of missed cells that led to this requestmeasures
- Measures to loadcolumns
- this is the CellRequest's constrained columnsaggregationKey
- this is the CellRequest's constraint keypredicates
- Array of constraints on each columngroupingSetsCollector
- grouping sets collectorsegmentFutures
- 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 controlpw
- Print writer, for tracing- Returns:
- CacheControl API
-
getCellFromCache
public Object getCellFromCache(CellRequest request)
Description copied from class:RolapAggregationManager
Retrieves the value of a cell from the cache.- Specified by:
getCellFromCache
in classRolapAggregationManager
- 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 classRolapAggregationManager
-
getCellFromAllCaches
public Object getCellFromAllCaches(CellRequest request)
-
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 classRolapAggregationManager
- Parameters:
request
- Cell requeststarPredicateSlicer
- A StarPredicate representing slicer positions that could not be represented by the CellRequest, ornull
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
- StarlevelBitKey
- Set of levelsmeasureBitKey
- Set of measuresrollup
- 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 aRolapAggregationManager.PinSet
.- Specified by:
createPinSet
in classRolapAggregationManager
- Returns:
- a new PinSet
-
shutdown
public void shutdown()
-
getCacheMgr
public SegmentCacheManager getCacheMgr()
-
-