Package mondrian.rolap
Class RolapSchema
java.lang.Object
mondrian.rolap.RolapSchema
A
RolapSchema
is a collection of RolapCube
s and shared RolapDimension
s. It is shared
betweeen RolapConnection
s. It caches MemberReader
s, etc.- Since:
- 26 July, 2001
- Author:
- jhyde
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionRolapSchema
(SchemaKey key, ByteString md5Bytes, String catalogUrl, String catalogStr, Util.PropertyList connectInfo, DataSource dataSource) Create RolapSchema given the MD5 hash, catalog name and string (content) and the connectInfo object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds a cube to the cube name map.static boolean
cacheContains
(RolapSchema rolapSchema) static String
calcMemberFqName
(MondrianDef.CalculatedMember xmlCalcMember) createCube
(String xml) Creates a cube by parsing an XML string.createDimension
(Cube cube, String xml) Creates a dimension in the given cube by parsing an XML string.boolean
protected void
Performs a sweep of the JDBC tables caches and the segment data.protected void
finalize()
protected void
Clears the cache of JDBC tables for the aggs.protected void
Returns a list of annotations.Returns the checksum of this schema.Cube[]
getCubes()
Returns a list of all cubes in this schema.getCubesWithStar
(RolapStar star) Returns this schema's SQL dialect.Returns this schema's function table.getId()
Returns this schema instance unique ID.Connection for purposes of parsing and validation.getKey()
Returns this schema instance unique key.protected org.apache.logging.log4j.Logger
getName()
Returns the name of this schema.getNamedSet
(String name) getNamedSet
(org.olap4j.mdx.IdentifierSegment segment) Returns this schema's parameters.static List<RolapSchema>
Returns when this schema was last loaded.Creates aSchemaReader
without any access control.Returns a list of shared dimensions in this schema.getStars()
Returns a list of warnings and errors that occurred while loading this schema.int
hashCode()
protected void
Deprecated.API changed to also pass Mondrian connection propertiesprotected void
load
(String catalogUrl, String catalogStr, Util.PropertyList connectInfo) Method called by all constructors to load the catalog into DOM and build application mdx and sql objects.protected RolapCube
lookupCube
(String cubeName) Finds a cube called 'cube' in the current catalog, or return null if no cube exists.lookupCube
(String cube, boolean failIfNotFound) Finds a cube calledcube
in this schema; if no cube exists,failIfNotFound
controls whether to raise an error or returnnull
.lookupRole
(String role) Finds a role with a given name in the current catalog, or returnsnull
if no such role exists.protected MondrianDef.CalculatedMember
lookupXmlCalculatedMember
(String calcMemberName, String cubeName) Returns an xmlCalculatedMember called 'calcMemberName' in the cube called 'cubeName' or return null if no calculatedMember or xmlCube by those name exists.boolean
removeCube
(String cubeName) Removes a cube.void
setDataSourceChangeListener
(DataSourceChangeListener dataSourceChangeListener)
-
Constructor Details
-
RolapSchema
public RolapSchema(SchemaKey key, ByteString md5Bytes, String catalogUrl, String catalogStr, Util.PropertyList connectInfo, DataSource dataSource) Create RolapSchema given the MD5 hash, catalog name and string (content) and the connectInfo object.- Parameters:
md5Bytes
- may be nullcatalogUrl
- URL of catalogcatalogStr
- may be nullconnectInfo
- Connection properties
-
-
Method Details
-
flushSegments
protected void flushSegments() -
flushJdbcSchema
protected void flushJdbcSchema()Clears the cache of JDBC tables for the aggs. -
finalCleanUp
protected void finalCleanUp()Performs a sweep of the JDBC tables caches and the segment data. Only called internally when a schema and it's data must be refreshed. -
finalize
protected void finalize() -
equals
-
hashCode
public int hashCode() -
getLogger
protected org.apache.logging.log4j.Logger getLogger() -
load
Deprecated.API changed to also pass Mondrian connection properties- Parameters:
catalogUrl
- URL of catalogcatalogStr
- Text of catalog, or null
-
load
Method called by all constructors to load the catalog into DOM and build application mdx and sql objects.- Parameters:
catalogUrl
- URL of catalogcatalogStr
- Text of catalog, or nullconnectInfo
- Mondrian connection properties
-
getSchemaLoadDate
Description copied from interface:Schema
Returns when this schema was last loaded.- Specified by:
getSchemaLoadDate
in interfaceSchema
- Returns:
- Date and time when this schema was last loaded
-
getWarnings
Description copied from interface:Schema
Returns a list of warnings and errors that occurred while loading this schema.- Specified by:
getWarnings
in interfaceSchema
- Returns:
- list of warnings
-
getDefaultRole
-
getXMLSchema
-
getName
Description copied from interface:Schema
Returns the name of this schema. -
getId
Returns this schema instance unique ID. -
getKey
Returns this schema instance unique key.- Returns:
- a
SchemaKey
.
-
getAnnotationMap
Description copied from interface:Annotated
Returns a list of annotations.The map may be empty, never null.
- Specified by:
getAnnotationMap
in interfaceAnnotated
- Returns:
- Map from annotation name to annotations.
-
getDialect
Returns this schema's SQL dialect.NOTE: This method is not cheap. The implementation gets a connection from the connection pool.
- Returns:
- dialect
-
createDimension
Description copied from interface:Schema
Creates a dimension in the given cube by parsing an XML string. The XML string must be either a <Dimension> or a <DimensionUsage>. Returns the dimension created.- Specified by:
createDimension
in interfaceSchema
-
createCube
Description copied from interface:Schema
Creates a cube by parsing an XML string. Returns the cube created.- Specified by:
createCube
in interfaceSchema
-
getRolapSchemas
-
cacheContains
-
lookupCube
Description copied from interface:Schema
Finds a cube calledcube
in this schema; if no cube exists,failIfNotFound
controls whether to raise an error or returnnull
.- Specified by:
lookupCube
in interfaceSchema
-
lookupCube
Finds a cube called 'cube' in the current catalog, or return null if no cube exists. -
lookupXmlCalculatedMember
protected MondrianDef.CalculatedMember lookupXmlCalculatedMember(String calcMemberName, String cubeName) Returns an xmlCalculatedMember called 'calcMemberName' in the cube called 'cubeName' or return null if no calculatedMember or xmlCube by those name exists. -
calcMemberFqName
-
getCubesWithStar
-
addCube
Adds a cube to the cube name map.- See Also:
-
removeCube
Description copied from interface:Schema
Removes a cube.- Specified by:
removeCube
in interfaceSchema
- Returns:
- Whether cube was removed
-
getCubes
Description copied from interface:Schema
Returns a list of all cubes in this schema. -
getCubeList
-
getNamedSet
-
getNamedSet
-
lookupRole
Description copied from interface:Schema
Finds a role with a given name in the current catalog, or returnsnull
if no such role exists.- Specified by:
lookupRole
in interfaceSchema
-
roleNames
-
getFunTable
Description copied from interface:Schema
Returns this schema's function table.- Specified by:
getFunTable
in interfaceSchema
-
getParameters
Description copied from interface:Schema
Returns this schema's parameters.- Specified by:
getParameters
in interfaceSchema
-
getSchemaReader
Description copied from interface:Schema
Creates aSchemaReader
without any access control.- Specified by:
getSchemaReader
in interfaceSchema
-
getChecksum
Returns the checksum of this schema. Returnsnull
ifRolapConnectionProperties.UseContentChecksum
is set to false.- Returns:
- MD5 checksum of this schema
-
getInternalConnection
Connection for purposes of parsing and validation. Careful! It won't have the correct locale or access-control profile. -
getRolapStarRegistry
-
getStar
-
getStar
-
getStars
-
getDataSourceChangeListener
- Returns:
- Returns the dataSourceChangeListener.
-
setDataSourceChangeListener
- Parameters:
dataSourceChangeListener
- The dataSourceChangeListener to set.
-