Package mondrian.rolap
Class CacheControlImpl
java.lang.Object
mondrian.rolap.CacheControlImpl
- All Implemented Interfaces:
CacheControl
Implementation of
CacheControl API.- Since:
- Sep 27, 2006
- Author:
- jhyde
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefault implementation ofCacheControlImpl.MemberSetVisitor.Nested classes/interfaces inherited from interface mondrian.olap.CacheControl
CacheControl.CellRegion, CacheControl.MemberEditCommand, CacheControl.MemberSet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAddCommand(Member member) Creates a command to add a member to the cache.createCompoundCommand(List<CacheControl.MemberEditCommand> commandList) Builds a compound command which is executed atomically.createCompoundCommand(CacheControl.MemberEditCommand... commands) Builds a compound command which is executed atomically.createCrossjoinRegion(CacheControl.CellRegion... regions) Forms the cartesian product of two or more cell regions.Creates a command to delete a set of members from the member cache.createDeleteCommand(Member member) Creates a command to delete a member and its descendants from the member cache.createMeasuresRegion(Cube cube) Creates a region consisting of all measures in a given cube.createMemberRegion(boolean lowerInclusive, Member lowerMember, boolean upperInclusive, Member upperMember, boolean descendants) Creates a cell region consisting of a range between two members.createMemberRegion(Member member, boolean descendants) Creates a cell region consisting of a single member.createMemberSet(boolean lowerInclusive, Member lowerMember, boolean upperInclusive, Member upperMember, boolean descendants) Creates a member set consisting of a range between two members.createMemberSet(Member member, boolean descendants) Creates a member set containing either a single member, or a member and its descendants.createMoveCommand(Member member, Member loc) Creates a command to Move a member (with its descendants) to a new location, that is to a new parent.createSetPropertyCommand(CacheControl.MemberSet members, Map<String, Object> propertyValues) Creates a command to several properties changes over a set of members.createSetPropertyCommand(Member member, String name, Object value) Creates a command to change one property of a member.createUnionRegion(CacheControl.CellRegion... regions) Forms the union of two or more cell regions.createUnionSet(CacheControl.MemberSet... args) Forms the union of two or more member sets.voidExecutes a command that edits the member cache.filter(Level level, CacheControl.MemberSet baseSet) Filters a member set, keeping all members at a given Level.static SegmentColumn[]findMeasures(CacheControl.CellRegion region) Returns a list of members of the Measures dimension which are mentioned somewhere in a region specification.voidflush(CacheControl.CellRegion region) Atomically flushes all the cells in the cell cache that correspond to measures in a cube and to a given region.voidflush(CacheControl.MemberSet memberSet) Atomically flushes all members in the member cache which belong to a given set.protected voidflushNonUnion(CacheControl.CellRegion region) protected voidflushRegionList(List<CacheControl.CellRegion> cellRegionList) Flushes a list of cell regions.voidflushSchema(String catalogUrl, String connectionKey, String jdbcUser, String dataSourceStr) Flushes the given Schema instance from the pool.voidflushSchema(String catalogUrl, DataSource dataSource) Flushes the given Schema instance from the pool.voidflushSchema(Schema schema) Flushes the given RolapSchema instance from the poolvoidFlushes the cache which maps schema URLs to metadata.getStarList(CacheControl.CellRegion region) booleanTells if tracing is enabled.voidprintCacheState(PrintWriter pw, CacheControl.CellRegion region) Prints the state of the cell cache as it pertains to a given region.voidPrints the state of the member cache as it pertains to a given member set.voidPrints a debug message.
-
Constructor Details
-
CacheControlImpl
Creates a CacheControlImpl.- Parameters:
connection- Connection
-
-
Method Details
-
createMemberRegion
Description copied from interface:CacheControlCreates a cell region consisting of a single member.- Specified by:
createMemberRegionin interfaceCacheControl- Parameters:
member- the memberdescendants- When true, include descendants of the member in the region.- Returns:
- the new cell region
-
createMemberRegion
public CacheControl.CellRegion createMemberRegion(boolean lowerInclusive, Member lowerMember, boolean upperInclusive, Member upperMember, boolean descendants) Description copied from interface:CacheControlCreates a cell region consisting of a range between two members.The members must belong to the same level of the same hierarchy. One of the bounds may be null.
For example, given
thenMember member97Q3; // [Time].[1997].[Q3] Member member98Q2; // [Time].[1998].[Q2]
Expression Meaning createMemberRegion(true, member97Q3, true, member98Q2, false)The members between 97Q3 and 98Q2, inclusive:
[Time].[1997].[Q3],
[Time].[1997].[Q4],
[Time].[1998].[Q1],
[Time].[1998].[Q2]createMemberRegion(true, member97Q3, false, member98Q2, false)The members between 97Q3 and 98Q2, exclusive:
[Time].[1997].[Q4],
[Time].[1998].[Q1]createMemberRegion(true, member97Q3, false, member98Q2, false)The members between 97Q3 and 98Q2, including their descendants, and including the lower bound but not the upper bound:
[Time].[1997].[Q3],
[Time].[1997].[Q3].[7],
[Time].[1997].[Q3].[8],
[Time].[1997].[Q3].[9],
[Time].[1997].[Q4],
[Time].[1997].[Q4].[10],
[Time].[1997].[Q4].[11],
[Time].[1997].[Q4].[12],
[Time].[1998].[Q1],
[Time].[1998].[Q1].[1],
[Time].[1998].[Q1].[2],
[Time].[1998].[Q1].[3]- Specified by:
createMemberRegionin interfaceCacheControl- Parameters:
lowerInclusive- whether the the range includes the lower bound; ignored if the lower bound is not specifiedlowerMember- lower bound member. If null, takes all preceding membersupperInclusive- whether the the range includes the upper bound; ignored if the upper bound is not specifiedupperMember- upper bound member. If null, takes all preceding membersdescendants- when true, include descendants of the member in the region- Returns:
- the new cell region
-
createCrossjoinRegion
Description copied from interface:CacheControlForms the cartesian product of two or more cell regions.- Specified by:
createCrossjoinRegionin interfaceCacheControl- Parameters:
regions- the operands- Returns:
- the cartesian product of the operands
-
createUnionRegion
Description copied from interface:CacheControlForms the union of two or more cell regions. The regions must have the same dimensionality.- Specified by:
createUnionRegionin interfaceCacheControl- Parameters:
regions- the operands- Returns:
- the cartesian product of the operands
-
createMeasuresRegion
Description copied from interface:CacheControlCreates a region consisting of all measures in a given cube.- Specified by:
createMeasuresRegionin interfaceCacheControl- Parameters:
cube- a cube- Returns:
- the region
-
flush
Description copied from interface:CacheControlAtomically flushes all the cells in the cell cache that correspond to measures in a cube and to a given region.- Specified by:
flushin interfaceCacheControl- Parameters:
region- a region
-
flushRegionList
Flushes a list of cell regions.- Parameters:
cellRegionList- List of cell regions
-
trace
Description copied from interface:CacheControlPrints a debug message.- Specified by:
tracein interfaceCacheControl- Parameters:
message- the message
-
isTraceEnabled
public boolean isTraceEnabled()Description copied from interface:CacheControlTells if tracing is enabled.- Specified by:
isTraceEnabledin interfaceCacheControl
-
flushSchemaCache
public void flushSchemaCache()Description copied from interface:CacheControlFlushes the cache which maps schema URLs to metadata.This cache is referenced only when creating a new connection, so existing connections will continue to use the same schema definition.
Flushing the schema cache will flush all aggregations and segments associated to it as well.
- Specified by:
flushSchemaCachein interfaceCacheControl
-
flushSchema
public void flushSchema(String catalogUrl, String connectionKey, String jdbcUser, String dataSourceStr) Description copied from interface:CacheControlFlushes the given Schema instance from the pool. It resolves the schema to flush by using its catalog URL, connection key and JDBC username.Flushing the schema cache will flush all aggregations and segments associated to it as well.
- Specified by:
flushSchemain interfaceCacheControl
-
flushSchema
Description copied from interface:CacheControlFlushes the given Schema instance from the pool. It resolves the schema to flush by using its catalog URL and DataSource object.Flushing the schema cache will flush all aggregations and segments associated to it as well.
- Specified by:
flushSchemain interfaceCacheControl
-
flushSchema
Flushes the given RolapSchema instance from the pool- Specified by:
flushSchemain interfaceCacheControl- Parameters:
schema- RolapSchema
-
flushNonUnion
-
findMeasures
Returns a list of members of the Measures dimension which are mentioned somewhere in a region specification.- Parameters:
region- Cell region- Returns:
- List of members mentioned in cell region specification
-
findAxisValues
-
getStarList
-
printCacheState
Description copied from interface:CacheControlPrints the state of the cell cache as it pertains to a given region.- Specified by:
printCacheStatein interfaceCacheControl- Parameters:
pw- the output targetregion- the CellRegion of interest
-
createMemberSet
Description copied from interface:CacheControlCreates a member set containing either a single member, or a member and its descendants.- Specified by:
createMemberSetin interfaceCacheControl- Parameters:
member- a memberdescendants- when true, include descendants in the set- Returns:
- the set
-
createMemberSet
public CacheControl.MemberSet createMemberSet(boolean lowerInclusive, Member lowerMember, boolean upperInclusive, Member upperMember, boolean descendants) Description copied from interface:CacheControlCreates a member set consisting of a range between two members. The members must belong to the same level of the same hierarchy. One of the bounds may be null. (Similar toCacheControl.createMemberRegion(boolean, Member, boolean, Member, boolean), which see for examples.)- Specified by:
createMemberSetin interfaceCacheControl- Parameters:
lowerInclusive- whether the the range includes the lower bound; ignored if the lower bound is not specifiedlowerMember- lower bound member. If null, takes all preceding membersupperInclusive- whether the the range includes the upper bound; ignored if the upper bound is not specifiedupperMember- upper bound member. If null, takes all preceding membersdescendants- when true, include descendants of the member in the region- Returns:
- the set
-
createUnionSet
Description copied from interface:CacheControlForms the union of two or more member sets.- Specified by:
createUnionSetin interfaceCacheControl- Parameters:
args- the operands- Returns:
- the union of the operands
-
filter
Description copied from interface:CacheControlFilters a member set, keeping all members at a given Level.- Specified by:
filterin interfaceCacheControl- Parameters:
level- LevelbaseSet- Member set- Returns:
- Member set with members not at the given level removed
-
flush
Description copied from interface:CacheControlAtomically flushes all members in the member cache which belong to a given set.- Specified by:
flushin interfaceCacheControl- Parameters:
memberSet- a set of members
-
printCacheState
Description copied from interface:CacheControlPrints the state of the member cache as it pertains to a given member set.- Specified by:
printCacheStatein interfaceCacheControl- Parameters:
pw- the output targetset- the MemberSet of interest
-
createCompoundCommand
public CacheControl.MemberEditCommand createCompoundCommand(List<CacheControl.MemberEditCommand> commandList) Description copied from interface:CacheControlBuilds a compound command which is executed atomically.- Specified by:
createCompoundCommandin interfaceCacheControl- Parameters:
commandList- a list of the component commands- Returns:
- the compound command
-
createCompoundCommand
public CacheControl.MemberEditCommand createCompoundCommand(CacheControl.MemberEditCommand... commands) Description copied from interface:CacheControlBuilds a compound command which is executed atomically.- Specified by:
createCompoundCommandin interfaceCacheControl- Parameters:
commands- the component commands- Returns:
- the compound command
-
createDeleteCommand
Description copied from interface:CacheControlCreates a command to delete a member and its descendants from the member cache.- Specified by:
createDeleteCommandin interfaceCacheControl- Parameters:
member- the member- Returns:
- the command
-
createDeleteCommand
Description copied from interface:CacheControlCreates a command to delete a set of members from the member cache.- Specified by:
createDeleteCommandin interfaceCacheControl- Parameters:
s- the set- Returns:
- the command
-
createAddCommand
public CacheControl.MemberEditCommand createAddCommand(Member member) throws IllegalArgumentException Description copied from interface:CacheControlCreates a command to add a member to the cache. The added member and its parent must have the same Dimension and the correct Levels, Null parent means add to the top level of its Dimension.The ordinal position of the new member among its siblings is implied by its properties.
- Specified by:
createAddCommandin interfaceCacheControl- Parameters:
member- the new member- Returns:
- the command
- Throws:
IllegalArgumentException- if member null or if member belongs to a parent-child hierarchy
-
createMoveCommand
public CacheControl.MemberEditCommand createMoveCommand(Member member, Member loc) throws IllegalArgumentException Description copied from interface:CacheControlCreates a command to Move a member (with its descendants) to a new location, that is to a new parent.- Specified by:
createMoveCommandin interfaceCacheControl- Parameters:
member- the member movedloc- the new parent- Returns:
- the command
- Throws:
IllegalArgumentException- if member is null, or loc is null, or member belongs to a parent-child hierarchy, or if loc is incompatible with member
-
createSetPropertyCommand
public CacheControl.MemberEditCommand createSetPropertyCommand(Member member, String name, Object value) throws IllegalArgumentException Description copied from interface:CacheControlCreates a command to change one property of a member.- Specified by:
createSetPropertyCommandin interfaceCacheControl- Parameters:
member- the membername- the property namevalue- the property value- Returns:
- the command
- Throws:
IllegalArgumentException- if the property is invalid for the member
-
createSetPropertyCommand
public CacheControl.MemberEditCommand createSetPropertyCommand(CacheControl.MemberSet members, Map<String, Object> propertyValues) throws IllegalArgumentExceptionDescription copied from interface:CacheControlCreates a command to several properties changes over a set of members. All members must belong to the same Level.- Specified by:
createSetPropertyCommandin interfaceCacheControl- Parameters:
members- the set of memberspropertyValues- Collection of property-value pairs- Returns:
- the command
- Throws:
IllegalArgumentException- for an invalid property, or if all members in the set do not belong to the same Level.
-
execute
Description copied from interface:CacheControlExecutes a command that edits the member cache.- Specified by:
executein interfaceCacheControl- Parameters:
cmd- the command
-