Interface SchemaTemplate
- All Superinterfaces:
Metadata
A Relational schema template metadata.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
findTableByName
(String tableName) Retrieves aTable
by looking up its name.generateSchema
(String databaseId, String schemaName) Creates aSchema
instance using the specified.getIndexEntriesAsBitset
(Optional<Set<String>> readableIndexNames) Returns aBitSet
whose bits are set for each of passed index names.Returns theTable
s inside the schema template.int
Returns the version of the schema template.boolean
Returnstrue
if long rows are permitted in tables of this template, elsefalse
.boolean
Returnstrue
if each row is stored along with an monotonically increasing version.<T extends SchemaTemplate>
T
-
Method Details
-
getVersion
int getVersion()Returns the version of the schema template.- Returns:
- The version of the schema template.
-
isEnableLongRows
boolean isEnableLongRows()Returnstrue
if long rows are permitted in tables of this template, elsefalse
.- Returns:
true
if long rows are permitted in tables of this template, elsefalse
.
-
isStoreRowVersions
boolean isStoreRowVersions()Returnstrue
if each row is stored along with an monotonically increasing version. This is required to make use of therow_version()
function within queries and indexes.- Returns:
true
if each row is stored along with a monotonically increasingrow_version()
.
-
getTables
Returns theTable
s inside the schema template.- Returns:
- The
Table
s inside the schema template. - Throws:
RelationalException
- if it is a NoOpSchemaTemplate
-
findTableByName
Retrieves aTable
by looking up its name.- Parameters:
tableName
- The name of theTable
.- Returns:
- An
Optional
containing theTable
if it is found, otherwiseEmpty
. - Throws:
RelationalException
-
getTableIndexMapping
@Nonnull com.google.common.collect.Multimap<String,String> getTableIndexMapping() throws RelationalException- Throws:
RelationalException
-
getIndexes
- Throws:
RelationalException
-
getIndexEntriesAsBitset
@Nonnull BitSet getIndexEntriesAsBitset(@Nonnull Optional<Set<String>> readableIndexNames) throws RelationalException Returns aBitSet
whose bits are set for each of passed index names.
Example for a given schema templatest
with indexesi1, i2, i3, i4
whose order are as-defined, callingst.getIndexEntriesAsBitset(Optiona.of(Set.of("i2", "i3"))
returns a bitset of0110
.- Parameters:
readableIndexNames
- The readable index names, providing anOptional.empty()
returns a bitset with bits set to1
.- Returns:
- a bit set whose bits are set for each of the passed readable index names.
- Throws:
RelationalException
- If a readable index is not found.
-
generateSchema
Creates aSchema
instance using the specified.- Parameters:
databaseId
- The ID of the database.schemaName
- The name of theSchema
.- Returns:
- A new
Schema
instance with the specified name, database Id, version containing the same set ofTable
s inthis
SchemaTemplate
.
-
accept
-
unwrap
- Throws:
RelationalException
-