mondrian.rolap.cache
public interface SegmentCacheIndex
Not thread-safe.
Modifier and Type | Method and Description |
---|---|
void |
add(SegmentHeader header,
boolean loading,
SegmentBuilder.SegmentConverter converter)
Adds a header to the index.
|
List<List<SegmentHeader>> |
findRollupCandidates(String schemaName,
ByteString schemaChecksum,
String cubeName,
String measureName,
String rolapStarFactTableName,
BitKey constrainedColsBitKey,
Map<String,Comparable> coordinates,
List<String> compoundPredicates)
Returns a list of segments that can be rolled up to satisfy a given
cell request.
|
SegmentBuilder.SegmentConverter |
getConverter(String schemaName,
ByteString schemaChecksum,
String cubeName,
String rolapStarFactTableName,
String measureName,
List<String> compoundPredicates)
Returns a converter that can convert the given header to internal
format.
|
Future<SegmentBody> |
getFuture(SegmentHeader header)
Returns a future slot for a segment body, if a segment is currently
loading, otherwise null.
|
List<SegmentHeader> |
intersectRegion(String schemaName,
ByteString schemaChecksum,
String cubeName,
String measureName,
String rolapStarFactTableName,
SegmentColumn[] region)
Finds a list of headers that intersect a given region.
|
void |
loadFailed(SegmentHeader header,
Throwable throwable)
Notifies the segment index that a segment failed to load, and removes the
segment from the index.
|
void |
loadSucceeded(SegmentHeader header,
SegmentBody body)
Changes the state of a header from loading to loaded.
|
List<SegmentHeader> |
locate(String schemaName,
ByteString schemaChecksum,
String cubeName,
String measureName,
String rolapStarFactTableName,
BitKey constrainedColsBitKey,
Map<String,Comparable> coordinates,
List<String> compoundPredicates)
Identifies the segment headers that contain a given cell.
|
void |
printCacheState(PrintWriter pw)
Prints the state of the cache to the given writer.
|
void |
remove(SegmentHeader header)
Removes a header from the index.
|
void |
setConverter(String schemaName,
ByteString schemaChecksum,
String cubeName,
String rolapStarFactTableName,
String measureName,
List<String> compoundPredicates,
SegmentBuilder.SegmentConverter converter)
Sets a converter that can convert headers in for a given measure to
internal format.
|
List<SegmentHeader> locate(String schemaName, ByteString schemaChecksum, String cubeName, String measureName, String rolapStarFactTableName, BitKey constrainedColsBitKey, Map<String,Comparable> coordinates, List<String> compoundPredicates)
schemaName
- Schema nameschemaChecksum
- Schema checksumcubeName
- Cube namemeasureName
- Measure namerolapStarFactTableName
- Fact table tableconstrainedColsBitKey
- Bit keycoordinates
- CoordinatescompoundPredicates
- Compound predicatesList<List<SegmentHeader>> findRollupCandidates(String schemaName, ByteString schemaChecksum, String cubeName, String measureName, String rolapStarFactTableName, BitKey constrainedColsBitKey, Map<String,Comparable> coordinates, List<String> compoundPredicates)
schemaName
- Schema nameschemaChecksum
- Schema checksumcubeName
- Cube namemeasureName
- Measure namerolapStarFactTableName
- Fact table tableconstrainedColsBitKey
- Bit keycoordinates
- CoordinatescompoundPredicates
- Compound predicatesList<SegmentHeader> intersectRegion(String schemaName, ByteString schemaChecksum, String cubeName, String measureName, String rolapStarFactTableName, SegmentColumn[] region)
This method is used to find out which headers need to be trimmed or removed during a flush.
schemaName
- Schema nameschemaChecksum
- Schema checksumcubeName
- Cube namemeasureName
- Measure namerolapStarFactTableName
- Fact table tableregion
- Regionvoid add(SegmentHeader header, boolean loading, SegmentBuilder.SegmentConverter converter)
If loading
is true, there must follow a call to
loadSucceeded(mondrian.spi.SegmentHeader, mondrian.spi.SegmentBody)
or loadFailed(mondrian.spi.SegmentHeader, java.lang.Throwable)
.
header
- Segment headerloading
- Whether segment is pending a load from SQLconverter
- Segment convertervoid loadSucceeded(SegmentHeader header, SegmentBody body)
The segment must have previously been added by calling add(mondrian.spi.SegmentHeader, boolean, mondrian.rolap.agg.SegmentBuilder.SegmentConverter)
with a not-null value of the bodyFuture
parameter;
neither loadSucceeded
nor loadFailed(mondrian.spi.SegmentHeader, java.lang.Throwable)
must have been
called.
Informs anyone waiting on the future supplied with
add(mondrian.spi.SegmentHeader, boolean, mondrian.rolap.agg.SegmentBuilder.SegmentConverter)
.
header
- Segment headerbody
- Segment bodyvoid loadFailed(SegmentHeader header, Throwable throwable)
The segment must have previously been added using add(mondrian.spi.SegmentHeader, boolean, mondrian.rolap.agg.SegmentBuilder.SegmentConverter)
with a not-null value of the bodyFuture
parameter;
neither loadSucceeded(mondrian.spi.SegmentHeader, mondrian.spi.SegmentBody)
nor loadFailed
must have been
called.
Informs anyone waiting on the future supplied with
add(mondrian.spi.SegmentHeader, boolean, mondrian.rolap.agg.SegmentBuilder.SegmentConverter)
.
header
- Headerthrowable
- Error messagevoid remove(SegmentHeader header)
header
- Segment headervoid printCacheState(PrintWriter pw)
pw
- Print writerFuture<SegmentBody> getFuture(SegmentHeader header)
header
- Segment headerSegmentBuilder.SegmentConverter getConverter(String schemaName, ByteString schemaChecksum, String cubeName, String rolapStarFactTableName, String measureName, List<String> compoundPredicates)
schemaName
- Schema nameschemaChecksum
- Schema checksumcubeName
- Cube namerolapStarFactTableName
- Fact tablemeasureName
- Measure namecompoundPredicates
- Compound predicatesvoid setConverter(String schemaName, ByteString schemaChecksum, String cubeName, String rolapStarFactTableName, String measureName, List<String> compoundPredicates, SegmentBuilder.SegmentConverter converter)
schemaName
- Schema nameschemaChecksum
- Schema checksumcubeName
- Cube namerolapStarFactTableName
- Fact tablemeasureName
- Measure namecompoundPredicates
- Compound predicatesconverter
- Converter to store