public class MemberCacheHelper extends Object
Constructor and Description |
---|
MemberCacheHelper(RolapHierarchy rolapHierarchy)
Creates a MemberCacheHelper.
|
Modifier and Type | Method and Description |
---|---|
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
getMember(Object) or
putMember(Object, RolapMember) the
RolapMember with a given parent and key. |
void |
putChildren(RolapLevel level,
TupleConstraint constraint,
List<RolapMember> members)
|
void |
putChildren(RolapMember member,
MemberChildrenConstraint constraint,
List<RolapMember> children)
|
void |
putLevelMembersInCache(RolapLevel level,
TupleConstraint constraint,
List<RolapMember> members)
Deprecated.
|
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) |
public MemberCacheHelper(RolapHierarchy rolapHierarchy)
rolapHierarchy
- Hierarchypublic RolapMember getMember(Object key, boolean mustCheckCacheStatus)
RolapMember
with a given key.key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
mustCheckCacheStatus
- If true
, do not check cache statuspublic Object putMember(Object key, RolapMember value)
RolapMember
with a given key and returns the
previous member if any.key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
value
- new memberpublic Object makeKey(RolapMember parent, Object key)
getMember(Object)
or
putMember(Object, RolapMember)
the
RolapMember
with a given parent and key.parent
- Parent memberkey
- Key of member within parentpublic RolapMember getMember(Object key)
RolapMember
with a given key.key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
public void checkCacheStatus()
@Deprecated public void putLevelMembersInCache(RolapLevel level, TupleConstraint constraint, List<RolapMember> members)
putChildren(RolapLevel, TupleConstraint, List)
public void putChildren(RolapLevel level, TupleConstraint constraint, List<RolapMember> members)
level
- the parent levelconstraint
- the condition that was used when the members were
fetched. May be null for all members (no constraint)members
- list of childrenpublic List<RolapMember> getChildrenFromCache(RolapMember member, MemberChildrenConstraint constraint)
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.
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)
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)
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.
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()
removeMember(Object)
and
removeMemberAndDescendants(Object)
methods.
REVIEW: remove isMutable and move removeMember and removeMemberAndDescendants to new interface MutableMemberCache
public RolapMember removeMember(Object key)
RolapMember
with a given key from the cache.
Returns the previous member with that key, or null.
Optional operation: see isMutable()
.key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
public RolapMember removeMemberAndDescendants(Object key)
RolapMember
and all its descendants.
Returns the previous member with that key, or null.
Optional operation: see isMutable()
.key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
Copyright © 2019 Hitachi Vantara. All rights reserved.