Class RolapCube

  • All Implemented Interfaces:
    Annotated, Cube, OlapElement

    public class RolapCube
    extends CubeBase
    RolapCube implements Cube for a ROLAP database.
    Since:
    10 August, 2001
    Author:
    jhyde
    • Method Detail

      • getAnnotationMap

        public Map<String,​Annotation> 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()
      • getNamedSets

        public NamedSet[] getNamedSets()
        Returns the named sets of this cube.
      • getSchemaReader

        public SchemaReader 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(Role)
      • getSchemaReader

        public SchemaReader getSchemaReader​(Role role)
        Description copied from interface: Cube
        Returns a SchemaReader for which this cube is the context for lookup up members. If role 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

        public RolapStar getStar()
        Returns this cube's underlying star schema.
      • getUsages

        public HierarchyUsage[] getUsages​(Hierarchy hierarchy)
        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.
      • shouldIgnoreUnrelatedDimensions

        public 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.
        Parameters:
        baseCubeName - name of the base cube for which we want to check this property
        Returns:
        boolean
      • getHierarchies

        public List<RolapHierarchy> 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

        public Member[] getMembersForQuery​(String query,
                                           List<Member> calcMembers)
        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 from this".
      • getTimeHierarchy

        public RolapHierarchy getTimeHierarchy​(String funName)
        Returns the time hierarchy for this cube. If there is no time hierarchy, throws.
      • nonJoiningDimensions

        public Set<Dimension> nonJoiningDimensions​(Member[] tuple)
        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

        public Set<Dimension> nonJoiningDimensions​(Set<Dimension> otherDims)
        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
      • isVirtual

        public boolean isVirtual()
        Returns whether this cube is virtual. We use the fact that virtual cubes do not have fact tables.
      • findBaseCubeLevel

        public RolapCubeLevel findBaseCubeLevel​(RolapLevel level)
        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
      • getMeasuresHierarchy

        public Hierarchy getMeasuresHierarchy()
        Returns the the measures hierarchy.
      • createCalculatedMember

        public Member createCalculatedMember​(String xml)
        Description copied from interface: Cube
        Creates a calculated member in this cube.

        The XML string must be a <CalculatedMember/> element, as defined in Mondrian.xml.

        Parameters:
        xml - XML string
      • getBaseCubes

        public List<RolapCube> 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