Package mondrian.olap

Class RoleImpl.CachingHierarchyAccess

  • All Implemented Interfaces:
    Role.HierarchyAccess
    Enclosing class:
    RoleImpl

    static class RoleImpl.CachingHierarchyAccess
    extends RoleImpl.DelegatingHierarchyAccess
    Implementation of Role.HierarchyAccess that caches the access of each member and level.

    This reduces the number of calls to the underlying HierarchyAccess, which is particularly useful for a union role which is based on many roles.

    Caching uses two WeakHashMap objects, so should release resources if memory is scarce. However, it may use up memory and cause segments etc. to be removed from the cache when GC is triggered. For this reason, you should only use this wrapper for a HierarchyAccess which would otherwise have poor performance; currently used for union roles with 5 or more member roles.