public class SegmentLoader extends Object
The SegmentLoader
queries database and loads the data into the given set of segments.
It reads a segment of measure
, where columns
are constrained to values
. Each
entry in values
can be null, meaning don't constrain, or can have several values. For example,
getSegment({Unit_sales}, {Region, State, Year}, {"West"},
{"CA", "OR", "WA"}, null})
returns sales in states CA, OR and WA in the Western region, for all years.
It will also look at the MondrianProperties.SegmentCache
property and make usage of the SegmentCache provided
as an SPI.
Modifier and Type | Class and Description |
---|---|
protected static class |
SegmentLoader.RowList
Collection of rows, each with a set of columns of type Object, double, or int.
|
Constructor and Description |
---|
SegmentLoader(SegmentCacheManager cacheMgr)
Creates a SegmentLoader.
|
Modifier and Type | Method and Description |
---|---|
void |
load(int cellRequestCount,
List<GroupingSet> groupingSets,
List<StarPredicate> compoundPredicateList,
List<Future<Map<Segment,SegmentWithData>>> segmentFutures)
Loads data for all the segments of the GroupingSets.
|
public SegmentLoader(SegmentCacheManager cacheMgr)
cacheMgr
- Cache managerpublic void load(int cellRequestCount, List<GroupingSet> groupingSets, List<StarPredicate> compoundPredicateList, List<Future<Map<Segment,SegmentWithData>>> segmentFutures)
Dialect.supportsGroupingSets()
then grouping sets list should always have only one element in
it.
For example, if list has 2 grouping sets with columns A, B, C and B, C respectively, then the SQL will be "GROUP BY GROUPING SETS ((A, B, C), (B, C))".
Else if the list has only one grouping set then sql would be without grouping sets.
The groupingSets
list should be topological order, with more detailed higher-level grouping sets
occurring first. In other words, the first element of the list should always be the detailed grouping set (default
grouping set), followed by grouping sets which can be rolled-up on this detailed grouping set. In the example (A,
B, C) is the detailed grouping set and (B, C) is rolled-up using the detailed.
Grouping sets are removed from the groupingSets
list as they are loaded.
cellRequestCount
- Number of missed cells that led to this requestgroupingSets
- List of grouping sets whose segments are loadedcompoundPredicateList
- Compound predicatessegmentFutures
- List of futures wherein each statement will place a list of the segments it has loaded, when it completesCopyright © 2021 Hitachi Vantara. All rights reserved.