Package mondrian.rolap
Class RolapCube
java.lang.Object
mondrian.olap.OlapElementBase
mondrian.olap.CubeBase
mondrian.rolap.RolapCube
- All Implemented Interfaces:
Annotated
,Cube
,OlapElement
RolapCube
implements Cube
for a ROLAP database.- Since:
- 10 August, 2001
- Author:
- jhyde
-
Nested Class Summary
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
-
Field Summary
Fields inherited from class mondrian.olap.CubeBase
CATALOG_NAME, CUBE_NAME, DIMENSION_UNIQUE_NAME, dimensions, HIERARCHY_UNIQUE_NAME, LEVEL_NUMBER, LEVEL_UNIQUE_NAME, maxNofConstraintsForAdSchemaMember, MDPROP_USERDEFINED0, MDTREEOP_CHILDREN, MDTREEOP_SELF, MEMBER_CAPTION, MEMBER_NAME, MEMBER_TYPE, MEMBER_UNIQUE_NAME, name, SCHEMA_NAME, Tree_Operator
Fields inherited from class mondrian.olap.OlapElementBase
caption, visible
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the in memory aggregate cache associated with this Cube, but only if Disabling Caching has been enabled.void
clearCachedAggregations
(boolean forced) Clear the in memory aggregate cache associated with this Cube.Creates a calculated member in this cube.findBaseCubeLevel
(RolapLevel level) Locates the base cube level for a particular virtual level.Returns a list of annotations.Returns the list of base cubes associated with this cube if this one is a virtual cube, otherwise return just this cubegetFact()
Returns this cube's fact table, null if the cube is virtual.Returns a list of all hierarchies in this cube, in order of dimension.protected org.apache.logging.log4j.Logger
Returns the measures hierarchy.Member[]
getMembersForQuery
(String query, List<Member> calcMembers) Returns Member[].NamedSet[]
Returns the named sets of this cube.Returns the schema reader which enforces the appropriate access-control context.getSchemaReader
(Role role) Returns aSchemaReader
for which this cube is the context for lookup up members.getStar()
Returns this cube's underlying star schema.getTimeHierarchy
(String funName) Returns the time hierarchy for this cube.A Hierarchy may have one or more HierarchyUsages.boolean
boolean
Returns true if this Cube is either virtual or if the Cube's RolapStar is caching aggregates.boolean
boolean
Returns whether this cube is virtual.lookupChild
(SchemaReader schemaReader, Id.Segment s) lookupChild
(SchemaReader schemaReader, Id.Segment s, MatchType matchType) Looks up a child element, returning null if it does not exist.protected RolapStar.Column
makeColumns
(RolapStar.Table table, RolapCubeLevel level, RolapStar.Column parentColumn, String usagePrefix) Adds a column to the appropriate table in theRolapStar
.nonJoiningDimensions
(Set<Dimension> otherDims) Finds out non joining dimensions for this cube.nonJoiningDimensions
(Member[] tuple) Finds out non joining dimensions for this cube.void
setCacheAggregations
(boolean cache) Set if this (non-virtual) Cube's RolapStar should cache aggregations.boolean
shouldIgnoreUnrelatedDimensions
(String baseCubeName) This method tells us if unrelated dimensions to measures from the input base cube should be pushed to default member or not during aggregation.Methods inherited from class mondrian.olap.CubeBase
getDescription, getDimension, getDimensions, getHierarchy, getMonthLevel, getName, getQualifiedName, getQuarterLevel, getUniqueName, getWeekLevel, getYearLevel, lookupDimension, lookupHierarchy
Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, equals, equals, getCaption, getLocalized, hashCode, isVisible, setCaption, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface mondrian.olap.OlapElement
getCaption, getLocalized, isVisible
-
Method Details
-
getLogger
protected org.apache.logging.log4j.Logger getLogger()- Specified by:
getLogger
in classOlapElementBase
-
getAnnotationMap
Description copied from interface:Annotated
Returns a list of annotations.The map may be empty, never null.
- Returns:
- Map from annotation name to annotations.
-
hasAggGroup
public boolean hasAggGroup() -
getAggGroup
-
getSchema
-
getNamedSets
Returns the named sets of this cube. -
getSchemaReader
Returns the schema reader which enforces the appropriate access-control context. schemaReader is cached, and needs to stay in sync with any changes to the cube.- See Also:
-
getSchemaReader
Description copied from interface:Cube
Returns aSchemaReader
for which this cube is the context for lookup up members. Ifrole
is null, the returned schema reader also obeys the access-control profile of role. -
isCacheAggregations
public boolean isCacheAggregations()Returns true if this Cube is either virtual or if the Cube's RolapStar is caching aggregates.- Returns:
- Whether this Cube's RolapStar should cache aggregations
-
setCacheAggregations
public void setCacheAggregations(boolean cache) Set if this (non-virtual) Cube's RolapStar should cache aggregations.- Parameters:
cache
- Whether this Cube's RolapStar should cache aggregations
-
clearCachedAggregations
public void clearCachedAggregations()Clear the in memory aggregate cache associated with this Cube, but only if Disabling Caching has been enabled. -
clearCachedAggregations
public void clearCachedAggregations(boolean forced) Clear the in memory aggregate cache associated with this Cube. -
getStar
Returns this cube's underlying star schema. -
getUsages
A Hierarchy may have one or more HierarchyUsages. This method returns an array holding the one or more usages associated with a Hierarchy. The HierarchyUsages hierarchyName attribute always equals the name attribute of the Hierarchy.- Parameters:
hierarchy
- Hierarchy- Returns:
- an HierarchyUsages array with 0 or more members.
-
makeColumns
protected RolapStar.Column makeColumns(RolapStar.Table table, RolapCubeLevel level, RolapStar.Column parentColumn, String usagePrefix) Adds a column to the appropriate table in theRolapStar
. Note that if the RolapLevel has a table attribute, then the associated column needs to be associated with that table. -
getHierarchies
Returns a list of all hierarchies in this cube, in order of dimension.TODO: Make this method return RolapCubeHierarchy, when the measures hierarchy is a RolapCubeHierarchy.
- Returns:
- List of hierarchies
-
isLoadInProgress
public boolean isLoadInProgress() -
getMembersForQuery
Description copied from interface:Cube
Returns Member[]. It builds Member[] by analyzing cellset, which gets created by running mdx sQuery.query
has to be in the format of something like "[with calculated members] select *members* on columns fromthis
". -
getTimeHierarchy
Returns the time hierarchy for this cube. If there is no time hierarchy, throws. -
nonJoiningDimensions
Finds out non joining dimensions for this cube. Useful for finding out non joining dimensions for a stored measure from a base cube.- Parameters:
tuple
- array of members- Returns:
- Set of dimensions that do not exist (non joining) in this cube
-
nonJoiningDimensions
Finds out non joining dimensions for this cube. Equality test for dimensions is done based on the unique name. Object equality can't be used.- Parameters:
otherDims
- Set of dimensions to be tested for existence in this cube- Returns:
- Set of dimensions that do not exist (non joining) in this cube
-
getFact
Returns this cube's fact table, null if the cube is virtual. -
isVirtual
public boolean isVirtual()Returns whether this cube is virtual. We use the fact that virtual cubes do not have fact tables. -
findBaseCubeLevel
Locates the base cube level for a particular virtual level. If not found, return null. This may be converted to a map lookup or cached in some way in the future to increase performance with cubes that have large numbers of hierarchies and levels- Parameters:
level
- virtual level- Returns:
- base cube level if found
-
lookupChild
-
lookupChild
Description copied from interface:OlapElement
Looks up a child element, returning null if it does not exist.- Specified by:
lookupChild
in interfaceOlapElement
- Overrides:
lookupChild
in classCubeBase
-
getMeasuresHierarchy
Returns the measures hierarchy. -
getMeasuresMembers
-
createCalculatedMember
Description copied from interface:Cube
Creates a calculated member in this cube.The XML string must be a
<CalculatedMember/>
element, as defined inMondrian.xml
.- Parameters:
xml
- XML string
-
getBaseCubes
Returns the list of base cubes associated with this cube if this one is a virtual cube, otherwise return just this cube- Returns:
- the list of base cubes
-