Interface SchemaTemplate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
accept(Visitor visitor)
java.util.Optional<Table>
findTableByName(java.lang.String tableName)
Retrieves aTable
by looking up its name.Schema
generateSchema(java.lang.String databaseId, java.lang.String schemaName)
Creates aSchema
instance using the specified.java.util.BitSet
getIndexEntriesAsBitset(java.util.Optional<java.util.Set<java.lang.String>> readableIndexNames)
Returns aBitSet
whose bits are set for each of passed index names.java.util.Set<java.lang.String>
getIndexes()
com.google.common.collect.Multimap<java.lang.String,java.lang.String>
getTableIndexMapping()
java.util.Set<? extends Table>
getTables()
Returns theTable
s inside the schema template.int
getVersion()
Returns the version of the schema template.boolean
isEnableLongRows()
Returnstrue
if long rows are permitted in tables of this template, elsefalse
.boolean
isStoreRowVersions()
Returnstrue
if each row is stored along with an monotonically increasing version.<T extends SchemaTemplate>
Tunwrap(java.lang.Class<T> iface)
-
-
-
Method Detail
-
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
@Nonnull java.util.Set<? extends Table> getTables() throws RelationalException
Returns theTable
s inside the schema template.- Returns:
- The
Table
s inside the schema template. - Throws:
RelationalException
- if it is a NoOpSchemaTemplate
-
findTableByName
@Nonnull java.util.Optional<Table> findTableByName(@Nonnull java.lang.String tableName) throws RelationalException
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<java.lang.String,java.lang.String> getTableIndexMapping() throws RelationalException
- Throws:
RelationalException
-
getIndexes
@Nonnull java.util.Set<java.lang.String> getIndexes() throws RelationalException
- Throws:
RelationalException
-
getIndexEntriesAsBitset
@Nonnull java.util.BitSet getIndexEntriesAsBitset(@Nonnull java.util.Optional<java.util.Set<java.lang.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
@Nonnull Schema generateSchema(@Nonnull java.lang.String databaseId, @Nonnull java.lang.String schemaName)
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
.
-
unwrap
@Nonnull <T extends SchemaTemplate> T unwrap(@Nonnull java.lang.Class<T> iface) throws RelationalException
- Throws:
RelationalException
-
-