|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SegmentCache
SPI definition of the segments cache.
Lookups are performed using SegmentHeaders and
SegmentBodys. Both are immutable and fully serializable.
There are two ways to declare a SegmentCache implementation in
Mondrian. The first one (and the one which will be used by default)
is to set the MondrianProperties.SegmentCache property. The
second one is to use the Java Services API. You will need to create
a jar file, accessible through the same class loader as Mondrian,
and add a file called /META-INF/services/mondrian.spi.SegmentCache
which contains the name of the segment cache implementation
to use. If more than one SegmentCache Java service is found, the first
one found is used. This is a non-deterministic choice as there are
no guarantees as to which will appear first. This later mean of discovery
is overridden by defining the MondrianProperties.SegmentCache
property.
Implementations are expected to be thread-safe. It is the responsibility of the cache implementation to maintain a consistent state.
Implementations must provide a default empty constructor.
Segment caches are instantiated as a singleton but can be
hot swapped by modifying MondrianProperties.SegmentCache.
MondrianProperties.SegmentCache| Method Summary | |
|---|---|
Future<Boolean> |
contains(SegmentHeader header)
Checks if the cache contains a SegmentBody corresponding
to the supplied SegmentHeader. |
Future<Boolean> |
flush(SegmentHeader.ConstrainedColumn[] region)
Flushes a dimensionality region from the cache. |
Future<SegmentBody> |
get(SegmentHeader header)
Returns a future SegmentBody object once the cache has returned any results, or null of no segment corresponding to the header could be found. |
Future<List<SegmentHeader>> |
getSegmentHeaders()
Returns a list of all segments present in the cache. |
Future<Boolean> |
put(SegmentHeader header,
SegmentBody body)
Stores a segment data in the cache. |
Future<Boolean> |
remove(SegmentHeader header)
Removes a segment from the cache. |
void |
tearDown()
Tear down and clean up the cache. |
| Method Detail |
|---|
Future<SegmentBody> get(SegmentHeader header)
header - The header of the segment to find.
Consider this as a key.
null
if no corresponding segment could be found in cache.Future<Boolean> contains(SegmentHeader header)
SegmentBody corresponding
to the supplied SegmentHeader.
header - A header to lookup in the cache.
Future<List<SegmentHeader>> getSegmentHeaders()
Future<Boolean> put(SegmentHeader header,
SegmentBody body)
header - The header of the segment.body - The segment body to cache.
Future<Boolean> remove(SegmentHeader header)
header - The header of the segment we want to remove.
Future<Boolean> flush(SegmentHeader.ConstrainedColumn[] region)
region - The region to flush.
void tearDown()
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||