Class NoCacheMemberReader
- java.lang.Object
-
- mondrian.rolap.NoCacheMemberReader
-
- All Implemented Interfaces:
MemberSource
- Direct Known Subclasses:
RolapCubeHierarchy.NoCacheRolapCubeHierarchyMemberReader
public class NoCacheMemberReader extends Object
NoCacheMemberReader
implementsMemberReader
but without doing any kind of caching and avoiding to read all members.- Since:
- 06 October, 2007
- Author:
- jlopez, lcanals
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(RolapMember m1, RolapMember m2, boolean siblingsAreEqual)
RolapMember
desubstitute(RolapMember member)
List<RolapMember>
getChildrenFromCache(RolapMember member, MemberChildrenConstraint constraint)
RolapMember
getDefaultMember()
RolapHierarchy
getHierarchy()
Returns the hierarchy that this source is reading for.RolapMember
getLeadMember(RolapMember member, int n)
int
getLevelMemberCount(RolapLevel level)
List<RolapMember>
getLevelMembersFromCache(RolapLevel level, TupleConstraint constraint)
RolapMember
getMember(Object key)
RolapMember
getMember(Object key, boolean mustCheckCacheStatus)
TupleReader.MemberBuilder
getMemberBuilder()
RolapMember
getMemberByKey(RolapLevel level, List<Comparable> keyValues)
void
getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)
Returns all members which are a child of one of the members inparentMembers
, sorted by ordinal.Map<? extends Member,Access>
getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint constraint)
void
getMemberChildren(RolapMember parentMember, List<RolapMember> children)
Writes all childrenparentMember
tochildren
.Map<? extends Member,Access>
getMemberChildren(RolapMember parentMember, List<RolapMember> children, MemberChildrenConstraint constraint)
int
getMemberCount()
Returns an estimate of number of members in this hierarchy.RolapMember
getMemberParent(RolapMember member)
void
getMemberRange(RolapLevel level, RolapMember startMember, RolapMember endMember, List<RolapMember> list)
List<RolapMember>
getMembers()
Returns all members of this hierarchy, sorted by ordinal.List<RolapMember>
getMembersInLevel(RolapLevel level)
List<RolapMember>
getMembersInLevel(RolapLevel level, TupleConstraint constraint)
List<RolapMember>
getRootMembers()
Returns all members of this hierarchy which do not have a parent, sorted by ordinal.boolean
isMutable()
RolapMember
lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
Finds a member based upon its unique name.Object
makeKey(RolapMember parent, Object key)
void
putChildren(RolapLevel level, TupleConstraint constraint, List<RolapMember> children)
void
putChildren(RolapMember member, MemberChildrenConstraint constraint, List<RolapMember> children)
Object
putMember(Object key, RolapMember value)
protected void
readMemberChildren(List<RolapMember> members, List<RolapMember> result, MemberChildrenConstraint constraint)
Reads the children ofmember
intoresult
.RolapMember
removeMember(Object key)
RolapMember
removeMemberAndDescendants(Object key)
boolean
setCache(mondrian.rolap.MemberCache cache)
Sets the cache which thisMemberSource
will write to.RolapMember
substitute(RolapMember member)
-
-
-
Method Detail
-
isMutable
public boolean isMutable()
-
removeMember
public RolapMember removeMember(Object key)
-
removeMemberAndDescendants
public RolapMember removeMemberAndDescendants(Object key)
-
getHierarchy
public RolapHierarchy getHierarchy()
Description copied from interface:MemberSource
Returns the hierarchy that this source is reading for.- Specified by:
getHierarchy
in interfaceMemberSource
-
setCache
public boolean setCache(mondrian.rolap.MemberCache cache)
Description copied from interface:MemberSource
Sets the cache which thisMemberSource
will write to.Cache-writeback is optional (for example,
SqlMemberSource
supports it, andArrayMemberSource
does not), and the return value from this method indicates whether this object supports it.If this method returns
true
, theMemberSource.getMembers()
,MemberSource.getRootMembers()
andMemberSource.getMemberChildren(mondrian.rolap.RolapMember, java.util.List<mondrian.rolap.RolapMember>)
methods must write to the cache, in addition to returning members as a return value.- Specified by:
setCache
in interfaceMemberSource
- Parameters:
cache
- TheMemberCache
which the caller would like thisMemberSource
to write to.- Returns:
- Whether this
MemberSource
supports cache-writeback.
-
makeKey
public Object makeKey(RolapMember parent, Object key)
-
getMember
public RolapMember getMember(Object key)
-
getMember
public RolapMember getMember(Object key, boolean mustCheckCacheStatus)
-
putMember
public Object putMember(Object key, RolapMember value)
-
getMembers
public List<RolapMember> getMembers()
Description copied from interface:MemberSource
Returns all members of this hierarchy, sorted by ordinal.If this object
supports cache-writeaback
, also writes these members to the cache.- Specified by:
getMembers
in interfaceMemberSource
-
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 interfaceMemberSource
- Returns:
List
ofRolapMember
s
-
getMembersInLevel
public List<RolapMember> getMembersInLevel(RolapLevel level)
-
getMembersInLevel
public List<RolapMember> getMembersInLevel(RolapLevel level, TupleConstraint constraint)
-
getMemberByKey
public RolapMember getMemberByKey(RolapLevel level, List<Comparable> keyValues)
-
getMemberChildren
public void getMemberChildren(RolapMember parentMember, List<RolapMember> children)
Description copied from interface:MemberSource
Writes all childrenparentMember
tochildren
.If this object
supports cache-writeback
, also writes these members to the cache.- Specified by:
getMemberChildren
in interfaceMemberSource
-
getMemberChildren
public Map<? extends Member,Access> getMemberChildren(RolapMember parentMember, List<RolapMember> children, MemberChildrenConstraint constraint)
-
getMemberChildren
public void getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)
Description copied from interface:MemberSource
Returns all members which are a child of one of the members inparentMembers
, sorted by ordinal.If this object
supports cache-writeaback
, also writes these members to the cache.- Specified by:
getMemberChildren
in interfaceMemberSource
-
getMemberChildren
public Map<? extends Member,Access> getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint constraint)
-
lookupMember
public RolapMember lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
Description copied from interface:MemberSource
Finds a member based upon its unique name.- Specified by:
lookupMember
in interfaceMemberSource
-
getChildrenFromCache
public List<RolapMember> getChildrenFromCache(RolapMember member, MemberChildrenConstraint constraint)
-
getLevelMembersFromCache
public List<RolapMember> getLevelMembersFromCache(RolapLevel level, TupleConstraint constraint)
-
putChildren
public void putChildren(RolapMember member, MemberChildrenConstraint constraint, List<RolapMember> children)
-
putChildren
public void putChildren(RolapLevel level, TupleConstraint constraint, List<RolapMember> children)
-
getLeadMember
public RolapMember getLeadMember(RolapMember member, int n)
-
getMemberRange
public void getMemberRange(RolapLevel level, RolapMember startMember, RolapMember endMember, List<RolapMember> list)
-
getMemberCount
public int getMemberCount()
Description copied from interface:MemberSource
Returns an estimate of number of members in this hierarchy.- Specified by:
getMemberCount
in interfaceMemberSource
-
compare
public int compare(RolapMember m1, RolapMember m2, boolean siblingsAreEqual)
-
getMemberBuilder
public TupleReader.MemberBuilder getMemberBuilder()
-
getDefaultMember
public RolapMember getDefaultMember()
-
getLevelMemberCount
public int getLevelMemberCount(RolapLevel level)
-
desubstitute
public RolapMember desubstitute(RolapMember member)
-
substitute
public RolapMember substitute(RolapMember member)
-
getMemberParent
public RolapMember getMemberParent(RolapMember member)
-
readMemberChildren
protected void readMemberChildren(List<RolapMember> members, List<RolapMember> result, MemberChildrenConstraint constraint)
Reads the children ofmember
intoresult
.- Parameters:
result
- Children are written here, in ordermembers
- Members whose children to readconstraint
- restricts the returned members if possible (optional optimization)
-
-