Class CacheControlImpl

    • Constructor Detail

      • CacheControlImpl

        public CacheControlImpl​(RolapConnection connection)
        Creates a CacheControlImpl.
        Parameters:
        connection - Connection
    • Method Detail

      • createMemberRegion

        public CacheControl.CellRegion createMemberRegion​(Member member,
                                                          boolean descendants)
        Description copied from interface: CacheControl
        Creates a cell region consisting of a single member.
        Specified by:
        createMemberRegion in interface CacheControl
        Parameters:
        member - the member
        descendants - When true, include descendants of the member in the region.
        Returns:
        the new cell region
      • createMemberRegion

        public CacheControl.CellRegion createMemberRegion​(boolean lowerInclusive,
                                                          Member lowerMember,
                                                          boolean upperInclusive,
                                                          Member upperMember,
                                                          boolean descendants)
        Description copied from interface: CacheControl
        Creates a cell region consisting of a range between two members.

        The members must belong to the same level of the same hierarchy. One of the bounds may be null.

        For example, given

        Member member97Q3; // [Time].[1997].[Q3]
         Member member98Q2; // [Time].[1998].[Q2]
         
        then
        Expression Meaning
        createMemberRegion(true, member97Q3, true, member98Q2, false) The members between 97Q3 and 98Q2, inclusive:
        [Time].[1997].[Q3],
        [Time].[1997].[Q4],
        [Time].[1998].[Q1],
        [Time].[1998].[Q2]
        createMemberRegion(true, member97Q3, false, member98Q2, false) The members between 97Q3 and 98Q2, exclusive:
        [Time].[1997].[Q4],
        [Time].[1998].[Q1]
        createMemberRegion(true, member97Q3, false, member98Q2, false) The members between 97Q3 and 98Q2, including their descendants, and including the lower bound but not the upper bound:
        [Time].[1997].[Q3],
        [Time].[1997].[Q3].[7],
        [Time].[1997].[Q3].[8],
        [Time].[1997].[Q3].[9],
        [Time].[1997].[Q4],
        [Time].[1997].[Q4].[10],
        [Time].[1997].[Q4].[11],
        [Time].[1997].[Q4].[12],
        [Time].[1998].[Q1],
        [Time].[1998].[Q1].[1],
        [Time].[1998].[Q1].[2],
        [Time].[1998].[Q1].[3]
        Specified by:
        createMemberRegion in interface CacheControl
        Parameters:
        lowerInclusive - whether the the range includes the lower bound; ignored if the lower bound is not specified
        lowerMember - lower bound member. If null, takes all preceding members
        upperInclusive - whether the the range includes the upper bound; ignored if the upper bound is not specified
        upperMember - upper bound member. If null, takes all preceding members
        descendants - when true, include descendants of the member in the region
        Returns:
        the new cell region
      • flush

        public void flush​(CacheControl.CellRegion region)
        Description copied from interface: CacheControl
        Atomically flushes all the cells in the cell cache that correspond to measures in a cube and to a given region.
        Specified by:
        flush in interface CacheControl
        Parameters:
        region - a region
      • flushRegionList

        protected void flushRegionList​(List<CacheControl.CellRegion> cellRegionList)
        Flushes a list of cell regions.
        Parameters:
        cellRegionList - List of cell regions
      • trace

        public void trace​(String message)
        Description copied from interface: CacheControl
        Prints a debug message.
        Specified by:
        trace in interface CacheControl
        Parameters:
        message - the message
      • flushSchemaCache

        public void flushSchemaCache()
        Description copied from interface: CacheControl
        Flushes the cache which maps schema URLs to metadata.

        This cache is referenced only when creating a new connection, so existing connections will continue to use the same schema definition.

        Flushing the schema cache will flush all aggregations and segments associated to it as well.

        Specified by:
        flushSchemaCache in interface CacheControl
      • flushSchema

        public void flushSchema​(String catalogUrl,
                                String connectionKey,
                                String jdbcUser,
                                String dataSourceStr)
        Description copied from interface: CacheControl
        Flushes the given Schema instance from the pool. It resolves the schema to flush by using its catalog URL, connection key and JDBC username.

        Flushing the schema cache will flush all aggregations and segments associated to it as well.

        Specified by:
        flushSchema in interface CacheControl
      • flushSchema

        public void flushSchema​(String catalogUrl,
                                DataSource dataSource)
        Description copied from interface: CacheControl
        Flushes the given Schema instance from the pool. It resolves the schema to flush by using its catalog URL and DataSource object.

        Flushing the schema cache will flush all aggregations and segments associated to it as well.

        Specified by:
        flushSchema in interface CacheControl
      • flushSchema

        public void flushSchema​(Schema schema)
        Flushes the given RolapSchema instance from the pool
        Specified by:
        flushSchema in interface CacheControl
        Parameters:
        schema - RolapSchema
      • findMeasures

        public static List<Member> findMeasures​(CacheControl.CellRegion region)
        Returns a list of members of the Measures dimension which are mentioned somewhere in a region specification.
        Parameters:
        region - Cell region
        Returns:
        List of members mentioned in cell region specification
      • createMemberSet

        public CacheControl.MemberSet createMemberSet​(Member member,
                                                      boolean descendants)
        Description copied from interface: CacheControl
        Creates a member set containing either a single member, or a member and its descendants.
        Specified by:
        createMemberSet in interface CacheControl
        Parameters:
        member - a member
        descendants - when true, include descendants in the set
        Returns:
        the set
      • createMemberSet

        public CacheControl.MemberSet createMemberSet​(boolean lowerInclusive,
                                                      Member lowerMember,
                                                      boolean upperInclusive,
                                                      Member upperMember,
                                                      boolean descendants)
        Description copied from interface: CacheControl
        Creates a member set consisting of a range between two members. The members must belong to the same level of the same hierarchy. One of the bounds may be null. (Similar to CacheControl.createMemberRegion(boolean, Member, boolean, Member, boolean), which see for examples.)
        Specified by:
        createMemberSet in interface CacheControl
        Parameters:
        lowerInclusive - whether the the range includes the lower bound; ignored if the lower bound is not specified
        lowerMember - lower bound member. If null, takes all preceding members
        upperInclusive - whether the the range includes the upper bound; ignored if the upper bound is not specified
        upperMember - upper bound member. If null, takes all preceding members
        descendants - when true, include descendants of the member in the region
        Returns:
        the set
      • flush

        public void flush​(CacheControl.MemberSet memberSet)
        Description copied from interface: CacheControl
        Atomically flushes all members in the member cache which belong to a given set.
        Specified by:
        flush in interface CacheControl
        Parameters:
        memberSet - a set of members
      • createAddCommand

        public CacheControl.MemberEditCommand createAddCommand​(Member member)
                                                        throws IllegalArgumentException
        Description copied from interface: CacheControl
        Creates a command to add a member to the cache. The added member and its parent must have the same Dimension and the correct Levels, Null parent means add to the top level of its Dimension.

        The ordinal position of the new member among its siblings is implied by its properties.

        Specified by:
        createAddCommand in interface CacheControl
        Parameters:
        member - the new member
        Returns:
        the command
        Throws:
        IllegalArgumentException - if member null or if member belongs to a parent-child hierarchy