|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.rolap.MemberCacheHelper
public class MemberCacheHelper
Encapsulation of member caching.
Field Summary | |
---|---|
(package private) DataSourceChangeListener |
changeListener
|
(package private) SmartCache<Object,RolapMember> |
mapKeyToMember
a cache for alle members to ensure uniqueness |
(package private) SmartMemberListCache<RolapLevel,List<RolapMember>> |
mapLevelToMembers
maps a level to its members |
(package private) SmartMemberListCache<RolapMember,List<RolapMember>> |
mapMemberToChildren
maps a parent member to a list of its children |
(package private) RolapHierarchy |
rolapHierarchy
|
Constructor Summary | |
---|---|
MemberCacheHelper(RolapHierarchy rolapHierarchy)
Creates a MemberCacheHelper. |
Method Summary | |
---|---|
void |
checkCacheStatus()
|
void |
flushCache()
|
DataSourceChangeListener |
getChangeListener()
|
List<RolapMember> |
getChildrenFromCache(RolapMember member,
MemberChildrenConstraint constraint)
Returns the children of member if they are currently in the
cache, otherwise returns null. |
List<RolapMember> |
getLevelMembersFromCache(RolapLevel level,
TupleConstraint constraint)
Returns the members of level if they are currently in the
cache, otherwise returns null. |
RolapMember |
getMember(Object key)
Retrieves the RolapMember with a given key. |
RolapMember |
getMember(Object key,
boolean mustCheckCacheStatus)
Retrieves the RolapMember with a given key. |
boolean |
isMutable()
Returns whether the cache supports removing selected items. |
Object |
makeKey(RolapMember parent,
Object key)
Creates a key with which to MemberCache.getMember(Object) or
MemberCache.putMember(Object, RolapMember) the
RolapMember with a given parent and key. |
void |
putChildren(RolapMember member,
MemberChildrenConstraint constraint,
List<RolapMember> children)
Registers that the children of member are
children (a list of RolapMember s). |
void |
putLevelMembersInCache(RolapLevel level,
TupleConstraint constraint,
List<RolapMember> members)
??? |
Object |
putMember(Object key,
RolapMember value)
Replaces the RolapMember with a given key and returns the
previous member if any. |
RolapMember |
removeMember(Object key)
Removes the RolapMember with a given key from the cache. |
RolapMember |
removeMemberAndDescendants(Object key)
Removes the designated RolapMember and all its descendants. |
void |
setChangeListener(DataSourceChangeListener listener)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final SmartMemberListCache<RolapMember,List<RolapMember>> mapMemberToChildren
SmartCache<Object,RolapMember> mapKeyToMember
RolapHierarchy rolapHierarchy
DataSourceChangeListener changeListener
final SmartMemberListCache<RolapLevel,List<RolapMember>> mapLevelToMembers
Constructor Detail |
---|
public MemberCacheHelper(RolapHierarchy rolapHierarchy)
rolapHierarchy
- HierarchyMethod Detail |
---|
public RolapMember getMember(Object key, boolean mustCheckCacheStatus)
MemberCache
RolapMember
with a given key.
getMember
in interface MemberCache
key
- cache key, created by MemberCache.makeKey(mondrian.rolap.RolapMember, java.lang.Object)
mustCheckCacheStatus
- If true
, do not check cache status
public Object putMember(Object key, RolapMember value)
MemberCache
RolapMember
with a given key and returns the
previous member if any.
putMember
in interface MemberCache
key
- cache key, created by MemberCache.makeKey(mondrian.rolap.RolapMember, java.lang.Object)
value
- new member
public Object makeKey(RolapMember parent, Object key)
MemberCache
MemberCache.getMember(Object)
or
MemberCache.putMember(Object, RolapMember)
the
RolapMember
with a given parent and key.
makeKey
in interface MemberCache
parent
- Parent memberkey
- Key of member within parent
public RolapMember getMember(Object key)
MemberCache
RolapMember
with a given key.
getMember
in interface MemberCache
key
- cache key, created by MemberCache.makeKey(mondrian.rolap.RolapMember, java.lang.Object)
public void checkCacheStatus()
public void putLevelMembersInCache(RolapLevel level, TupleConstraint constraint, List<RolapMember> members)
level
- constraint
- members
- public List<RolapMember> getChildrenFromCache(RolapMember member, MemberChildrenConstraint constraint)
MemberCache
member
if they are currently in the
cache, otherwise returns null.
The children may be garbage collected as soon as the returned list may be garbage collected.
getChildrenFromCache
in interface MemberCache
member
- the parent memberconstraint
- the condition that was used when the members were
fetched. May be null for all members (no constraint)
public void putChildren(RolapMember member, MemberChildrenConstraint constraint, List<RolapMember> children)
MemberCache
member
are
children
(a list of RolapMember
s).
putChildren
in interface MemberCache
member
- the parent memberconstraint
- the condition that was used when the members were
fetched. May be null for all members (no constraint)children
- list of childrenpublic List<RolapMember> getLevelMembersFromCache(RolapLevel level, TupleConstraint constraint)
MemberCache
level
if they are currently in the
cache, otherwise returns null.
The members may be garbage collected as soon as the returned list may be garbage collected.
getLevelMembersFromCache
in interface MemberCache
level
- the level whose members should be fetchedconstraint
- the condition that was used when the members were
fetched. May be null for all members (no constraint)
public void flushCache()
public DataSourceChangeListener getChangeListener()
public void setChangeListener(DataSourceChangeListener listener)
public boolean isMutable()
MemberCache
MemberCache.removeMember(Object)
and
MemberCache.removeMemberAndDescendants(Object)
methods.
REVIEW: remove isMutable and move removeMember and removeMemberAndDescendants to new interface MutableMemberCache
isMutable
in interface MemberCache
public RolapMember removeMember(Object key)
MemberCache
RolapMember
with a given key from the cache.
Returns the previous member with that key, or null.
Optional operation: see MemberCache.isMutable()
.
removeMember
in interface MemberCache
key
- cache key, created by MemberCache.makeKey(mondrian.rolap.RolapMember, java.lang.Object)
public RolapMember removeMemberAndDescendants(Object key)
MemberCache
RolapMember
and all its descendants.
Returns the previous member with that key, or null.
Optional operation: see MemberCache.isMutable()
.
removeMemberAndDescendants
in interface MemberCache
key
- cache key, created by MemberCache.makeKey(mondrian.rolap.RolapMember, java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |