public abstract class RelationalDatabaseSchema extends Object implements DatabaseSchema<TableId>
DatabaseSchema of a relational database such as Postgres. Provides information about the physical structure
of the database (the "database schema") as well as the structure of corresponding CDC messages (the "event schema").| Modifier and Type | Class and Description |
|---|---|
private static class |
RelationalDatabaseSchema.SchemasByTableId
A map of schemas by table id.
|
| Modifier and Type | Field and Description |
|---|---|
private Tables.ColumnNameFilter |
columnFilter |
private ColumnMappers |
columnMappers |
private Key.KeyMapper |
customKeysMapper |
private static org.slf4j.Logger |
LOG |
private TableSchemaBuilder |
schemaBuilder |
private String |
schemaPrefix |
private RelationalDatabaseSchema.SchemasByTableId |
schemasByTableId |
private Tables.TableFilter |
tableFilter |
private Tables |
tables |
private TopicSelector<TableId> |
topicSelector |
| Modifier | Constructor and Description |
|---|---|
protected |
RelationalDatabaseSchema(RelationalDatabaseConnectorConfig config,
TopicSelector<TableId> topicSelector,
Tables.TableFilter tableFilter,
Tables.ColumnNameFilter columnFilter,
TableSchemaBuilder schemaBuilder,
boolean tableIdCaseInsensitive,
Key.KeyMapper customKeysMapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
assureNonEmptySchema() |
protected void |
buildAndRegisterSchema(Table table)
Builds up the CDC event schema for the given table and stores it in this schema.
|
protected void |
clearSchemas() |
void |
close() |
private String |
getEnvelopeSchemaName(Table table) |
private static String |
getSchemaPrefix(String serverName) |
protected Tables.TableFilter |
getTableFilter() |
protected void |
removeSchema(TableId id) |
TableSchema |
schemaFor(TableId id)
Get the
Schema information for the table with the given identifier, if that table exists and
is included by the filter configuration. |
Table |
tableFor(TableId id)
Get the
Table meta-data for the table with the given identifier, if that table exists and is
included by the filter configuration |
Set<TableId> |
tableIds()
Returns the set of table ids included in the current filter configuration.
|
boolean |
tableInformationComplete()
Indicates whether or not table names are guaranteed to be fully present, regardless of whether or not a
snapshot has been performed.
|
protected Tables |
tables() |
private static final org.slf4j.Logger LOG
private final TopicSelector<TableId> topicSelector
private final TableSchemaBuilder schemaBuilder
private final Tables.TableFilter tableFilter
private final Tables.ColumnNameFilter columnFilter
private final ColumnMappers columnMappers
private final Key.KeyMapper customKeysMapper
private final String schemaPrefix
private final RelationalDatabaseSchema.SchemasByTableId schemasByTableId
private final Tables tables
protected RelationalDatabaseSchema(RelationalDatabaseConnectorConfig config, TopicSelector<TableId> topicSelector, Tables.TableFilter tableFilter, Tables.ColumnNameFilter columnFilter, TableSchemaBuilder schemaBuilder, boolean tableIdCaseInsensitive, Key.KeyMapper customKeysMapper)
public void close()
close in interface DatabaseSchema<TableId>public Set<TableId> tableIds()
public void assureNonEmptySchema()
assureNonEmptySchema in interface DatabaseSchema<TableId>public TableSchema schemaFor(TableId id)
Schema information for the table with the given identifier, if that table exists and
is included by the filter configuration.
Note that the Schema will not contain any columns that have been filtered out.
schemaFor in interface DatabaseSchema<TableId>id - the table identifier; may be nullpublic Table tableFor(TableId id)
Table meta-data for the table with the given identifier, if that table exists and is
included by the filter configurationid - the table identifier; may be nullprotected Tables tables()
protected void clearSchemas()
protected void buildAndRegisterSchema(Table table)
protected void removeSchema(TableId id)
protected Tables.TableFilter getTableFilter()
public boolean tableInformationComplete()
DatabaseSchematableInformationComplete in interface DatabaseSchema<TableId>Copyright © 2020 JBoss by Red Hat. All rights reserved.