mondrian.rolap
Class RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader

java.lang.Object
  extended by mondrian.rolap.SmartMemberReader
      extended by mondrian.rolap.RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader
All Implemented Interfaces:
MemberReader, MemberSource, RolapCubeHierarchy.RolapCubeHierarchyMemberReader
Enclosing class:
RolapCubeHierarchy

public class RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader
extends SmartMemberReader
implements RolapCubeHierarchy.RolapCubeHierarchyMemberReader

member reader wrapper - uses existing member reader, but wraps and caches all intermediate members

Synchronization. Most synchronization takes place within SmartMemberReader. All synchronization is done on the cacheHelper object.

 

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.rolap.SmartMemberReader
SmartMemberReader.SiblingIterator
 
Field Summary
protected  RolapCubeHierarchy.RolapCubeSqlMemberSource cubeSource
          cubeSource is passed as our member builder
protected  MemberCacheHelper rolapCubeCacheHelper
          this cache caches RolapCubeMembers that are light wrappers around shared and non-shared Hierarchy RolapMembers.
 
Fields inherited from class mondrian.rolap.SmartMemberReader
cacheHelper, rootMembers, source
 
Constructor Summary
RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader()
           
 
Method Summary
protected  void checkCacheStatus()
           
 TupleReader.MemberBuilder getMemberBuilder()
           
 void getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint constraint)
          Populates a list of the children of a given set of Members, optionally applying a constraint.
 int getMemberCount()
          Returns an estimate of number of members in this hierarchy.
 List<RolapMember> getMembersInLevel(RolapLevel level, int startOrdinal, int endOrdinal, TupleConstraint constraint)
          Returns the members in the given Level, optionally between a range of ordinals and applying a constraint.
 MemberCacheHelper getRolapCubeMemberCacheHelper()
           
 List<RolapMember> getRootMembers()
          Returns all members of this hierarchy which do not have a parent, sorted by ordinal.
 RolapCubeMember lookupCubeMember(RolapCubeMember parent, RolapMember member, RolapCubeLevel level)
           
protected  void readMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint constraint)
          Reads the children of member into cache, and also into result.
 
Methods inherited from class mondrian.rolap.SmartMemberReader
compare, desubstitute, getDefaultMember, getHierarchy, getLeadMember, getLevelMemberCount, getMemberCache, getMemberChildren, getMemberChildren, getMemberChildren, getMemberParent, getMemberRange, getMembers, getMembersInLevel, isSorted, lookupMember, setCache, substitute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mondrian.rolap.MemberReader
compare, desubstitute, getDefaultMember, getLeadMember, getLevelMemberCount, getMemberChildren, getMemberParent, getMemberRange, getMembersInLevel, substitute
 
Methods inherited from interface mondrian.rolap.MemberSource
getHierarchy, getMemberChildren, getMemberChildren, getMembers, lookupMember, setCache
 

Field Detail

cubeSource

protected final RolapCubeHierarchy.RolapCubeSqlMemberSource cubeSource
cubeSource is passed as our member builder


rolapCubeCacheHelper

protected MemberCacheHelper rolapCubeCacheHelper
this cache caches RolapCubeMembers that are light wrappers around shared and non-shared Hierarchy RolapMembers. The inherited cacheHelper object contains non-shared hierarchy RolapMembers. non-shared hierarchy RolapMembers are created when a member lookup involves the Cube's fact table.

Constructor Detail

RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader

public RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader()
Method Detail

getMemberBuilder

public TupleReader.MemberBuilder getMemberBuilder()
Specified by:
getMemberBuilder in interface MemberReader
Overrides:
getMemberBuilder in class SmartMemberReader

getRolapCubeMemberCacheHelper

public MemberCacheHelper getRolapCubeMemberCacheHelper()
Specified by:
getRolapCubeMemberCacheHelper in interface RolapCubeHierarchy.RolapCubeHierarchyMemberReader

getRootMembers

public List<RolapMember> getRootMembers()
Description copied from interface: MemberSource
Returns all members of this hierarchy which do not have a parent, sorted by ordinal.

If this object supports cache-writeback, also writes these members to the cache.

Specified by:
getRootMembers in interface MemberSource
Overrides:
getRootMembers in class SmartMemberReader
Returns:
List of RolapMembers

readMemberChildren

protected void readMemberChildren(List<RolapMember> parentMembers,
                                  List<RolapMember> children,
                                  MemberChildrenConstraint constraint)
Description copied from class: SmartMemberReader
Reads the children of member into cache, and also into result.

Overrides:
readMemberChildren in class SmartMemberReader
Parameters:
parentMembers - Members whose children to read
children - Children are written here, in order
constraint - restricts the returned members if possible (optional optimization)

getMemberChildren

public void getMemberChildren(List<RolapMember> parentMembers,
                              List<RolapMember> children,
                              MemberChildrenConstraint constraint)
Description copied from interface: MemberReader
Populates a list of the children of a given set of Members, optionally applying a constraint.

Specified by:
getMemberChildren in interface MemberReader
Overrides:
getMemberChildren in class SmartMemberReader
Parameters:
parentMembers - List of members whose children to find
children - List to populate with members
constraint - Constraint

getMembersInLevel

public List<RolapMember> getMembersInLevel(RolapLevel level,
                                           int startOrdinal,
                                           int endOrdinal,
                                           TupleConstraint constraint)
Description copied from interface: MemberReader
Returns the members in the given Level, optionally between a range of ordinals and applying a constraint.

Specified by:
getMembersInLevel in interface MemberReader
Overrides:
getMembersInLevel in class SmartMemberReader
Parameters:
level - Level
startOrdinal - Ordinal of first member to retrieve
endOrdinal - Ordinal of last member to upper bound
constraint - Constraint
Returns:
list of members

lookupCubeMember

public RolapCubeMember lookupCubeMember(RolapCubeMember parent,
                                        RolapMember member,
                                        RolapCubeLevel level)
Specified by:
lookupCubeMember in interface RolapCubeHierarchy.RolapCubeHierarchyMemberReader

getMemberCount

public int getMemberCount()
Description copied from interface: MemberSource
Returns an estimate of number of members in this hierarchy.

Specified by:
getMemberCount in interface MemberSource
Overrides:
getMemberCount in class SmartMemberReader

checkCacheStatus

protected void checkCacheStatus()
Overrides:
checkCacheStatus in class SmartMemberReader

SourceForge.net_Logo