|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.rolap.cache.MemorySegmentCache
public class MemorySegmentCache
Implementation of SegmentCache that stores segments
in memory.
Segments are held via soft references, so the garbage collector can remove them if it sees fit.
Not thread safe.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface mondrian.spi.SegmentCache |
|---|
SegmentCache.SegmentCacheInjector, SegmentCache.SegmentCacheListener |
| Constructor Summary | |
|---|---|
MemorySegmentCache()
|
|
| Method Summary | |
|---|---|
void |
addListener(SegmentCache.SegmentCacheListener listener)
Adds a listener to this segment cache implementation. |
boolean |
contains(SegmentHeader header)
Checks if the cache contains a SegmentBody corresponding
to the supplied SegmentHeader. |
void |
fireSegmentCacheEvent(SegmentCache.SegmentCacheListener.SegmentCacheEvent evt)
|
SegmentBody |
get(SegmentHeader header)
Returns a SegmentBody once the cache has returned any results, or null if no segment corresponding to the header could be found. |
List<SegmentHeader> |
getSegmentHeaders()
Returns a list of all segments present in the cache. |
boolean |
put(SegmentHeader header,
SegmentBody body)
Stores a segment data in the cache. |
boolean |
remove(SegmentHeader header)
Removes a segment from the cache. |
void |
removeListener(SegmentCache.SegmentCacheListener listener)
Unregisters a listener from this segment cache implementation. |
boolean |
supportsRichIndex()
Tells Mondrian whether this segment cache uses the SegmentHeader
objects as an index, thus preserving them in a serialized state, or if
it uses its identification number only. |
void |
tearDown()
Tear down and clean up the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MemorySegmentCache()
| Method Detail |
|---|
public SegmentBody get(SegmentHeader header)
SegmentCacheCache implementations are at liberty to 'forget' segments. Therefore
it is allowable for this method to return null at any time, even if
SegmentCache.contains(SegmentHeader) for this segment previously returned
true.
get in interface SegmentCacheheader - The header of the segment to find.
Consider this as a key.
null
if no corresponding segment could be found in cache.public boolean contains(SegmentHeader header)
SegmentCacheSegmentBody corresponding
to the supplied SegmentHeader.
contains in interface SegmentCacheheader - A header to lookup in the cache.
public List<SegmentHeader> getSegmentHeaders()
SegmentCache
getSegmentHeaders in interface SegmentCache
public boolean put(SegmentHeader header,
SegmentBody body)
SegmentCache
put in interface SegmentCacheheader - The header of the segment.body - The segment body to cache.
public boolean remove(SegmentHeader header)
SegmentCache
remove in interface SegmentCacheheader - The header of the segment we want to remove.
public void tearDown()
SegmentCache
tearDown in interface SegmentCachepublic void addListener(SegmentCache.SegmentCacheListener listener)
SegmentCacheSegmentCache.SegmentCacheListener.SegmentCacheEvent instances.
addListener in interface SegmentCachelistener - The listener to attach to this cache.public void removeListener(SegmentCache.SegmentCacheListener listener)
SegmentCache
removeListener in interface SegmentCachelistener - The listener to remove.public boolean supportsRichIndex()
SegmentCacheSegmentHeader
objects as an index, thus preserving them in a serialized state, or if
it uses its identification number only.
Not using a rich index prevents Mondrian from doing partial cache invalidation.
It is assumed that this method returns fairly quickly, and for a given cache always returns the same value.
supportsRichIndex in interface SegmentCachepublic void fireSegmentCacheEvent(SegmentCache.SegmentCacheListener.SegmentCacheEvent evt)
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||