Package mondrian.spi
Class SegmentHeader
java.lang.Object
mondrian.spi.SegmentHeader
- All Implemented Interfaces:
Serializable
SegmentHeaders are the key objects used to retrieve the segments
from the segment cache.
The segment header objects are immutable and fully serializable.
The headers have each an ID which is a SHA-256 checksum of the
following properties, concatenated. See
getUniqueID()
- Schema Name
- Cube Name
- Measure Name
- For each column:
- Column table name
- Column physical name
- For each predicate value:
- The equivalent of
String.valueof([value object])
- Author:
- LBoudreau
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSegmentHeader
(String schemaName, ByteString schemaChecksum, String cubeName, String measureName, List<SegmentColumn> constrainedColumns, List<String> compoundPredicates, String rolapStarFactTableName, BitKey constrainedColsBitKey, List<SegmentColumn> excludedRegions) Creates a segment header. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canConstrain
(SegmentColumn[] region) Checks if this header can be constrained by a given region.clone
(SegmentColumn[] overrideValues) Creates a clone of this header by replacing some of the constrained columns in the process.constrain
(SegmentColumn[] region) Applies a set of exclusions to this segment header and returns a new segment header representing the original one to which a region has been excluded.boolean
int
getArity()
Returns the arity of this SegmentHeader.getConstrainedColumn
(String columnExpression) Returns the constrained column object, if any, corresponding to a column name and a table name.Returns a list of constrained columns which define this segment header.Returns a human readable description of this segment header.getExcludedRegion
(String columnExpression) Returns a unique identifier for this header.int
hashCode()
toString()
-
Field Details
-
compoundPredicates
-
measureName
-
cubeName
-
schemaName
-
rolapStarFactTableName
-
constrainedColsBitKey
-
schemaChecksum
-
-
Constructor Details
-
SegmentHeader
public SegmentHeader(String schemaName, ByteString schemaChecksum, String cubeName, String measureName, List<SegmentColumn> constrainedColumns, List<String> compoundPredicates, String rolapStarFactTableName, BitKey constrainedColsBitKey, List<SegmentColumn> excludedRegions) Creates a segment header.- Parameters:
schemaName
- The name of the schema which this header belongs to.schemaChecksum
- Schema checksumcubeName
- The name of the cube this segment belongs to.measureName
- The name of the measure which defines this header.constrainedColumns
- An array of constrained columns objects which define the predicated of this segment header.compoundPredicates
- Compound predicates (Must not be null, but typically empty.)rolapStarFactTableName
- Star fact table nameconstrainedColsBitKey
- Constrained columns bit keyexcludedRegions
- Excluded regions. (Must not be null, but typically
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
clone
Creates a clone of this header by replacing some of the constrained columns in the process.- Parameters:
overrideValues
- A list of constrained columns to either replace or add to the original header.- Returns:
- A clone of the header with the columns replaced.
-
canConstrain
Checks if this header can be constrained by a given region.It will return false if the region covers one of the axis in its entirety.
It will return false if the region sits outside of the bounds of this header. This means that when performing a flush operation, the header must be scrapped altogether.
-
constrain
Applies a set of exclusions to this segment header and returns a new segment header representing the original one to which a region has been excluded.- Parameters:
region
- Region- Returns:
- Header with constraint applied
-
toString
-
getArity
public int getArity()Returns the arity of this SegmentHeader.- Returns:
- The arity as an integer number.
-
getExcludedRegions
-
getConstrainedColumns
Returns a list of constrained columns which define this segment header. The caller should consider this list immutable.- Returns:
- List of ConstrainedColumns
-
getConstrainedColumn
Returns the constrained column object, if any, corresponding to a column name and a table name.- Parameters:
columnExpression
- The column name we want.- Returns:
- A Constrained column, or null.
-
getExcludedRegion
-
getConstrainedColumnsBitKey
-
getUniqueID
Returns a unique identifier for this header. The identifier can be used for storage and will be the same across segments which have the same schema name, cube name, measure name, and for each constrained column, the same column name, table name, and predicate values.- Returns:
- A unique identification string.
-
getDescription
Returns a human readable description of this segment header.- Returns:
- A string describing the header.
-