Package io.debezium.relational
Class HistorizedRelationalDatabaseSchema
java.lang.Object
io.debezium.relational.RelationalDatabaseSchema
io.debezium.relational.HistorizedRelationalDatabaseSchema
- All Implemented Interfaces:
DatabaseSchema<TableId>
,HistorizedDatabaseSchema<TableId>
,AutoCloseable
public abstract class HistorizedRelationalDatabaseSchema
extends RelationalDatabaseSchema
implements HistorizedDatabaseSchema<TableId>
A
DatabaseSchema
or a relational database which has a schema history, that can be recovered to the current
state when restarting a connector.- Author:
- Gunnar Morling
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.debezium.schema.HistorizedDatabaseSchema
HistorizedDatabaseSchema.SchemaChangeEventConsumer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final HistorizedRelationalDatabaseConnectorConfig
private static final org.slf4j.Logger
private boolean
protected final SchemaHistory
Fields inherited from interface io.debezium.schema.DatabaseSchema
NO_CAPTURED_DATA_COLLECTIONS_WARNING
-
Constructor Summary
ModifierConstructorDescriptionprotected
HistorizedRelationalDatabaseSchema
(HistorizedRelationalDatabaseConnectorConfig config, TopicNamingStrategy<TableId> topicNamingStrategy, Tables.TableFilter tableFilter, Tables.ColumnNameFilter columnFilter, TableSchemaBuilder schemaBuilder, boolean tableIdCaseInsensitive, Key.KeyMapper customKeysMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected abstract DdlParser
Returns a new instance of theDdlParser
to be used when recovering the schema from a previously persisted history.void
Configures a storage used to store history, e.g.boolean
Whether this schema is historized (i.e.protected void
record
(SchemaChangeEvent schemaChange, TableChanges tableChanges) Records the given schema change event in the persistent history.void
boolean
boolean
boolean
boolean
boolean
Indicates whether or not table names are guaranteed to be fully present, regardless of whether or not a snapshot has been performed.Methods inherited from class io.debezium.relational.RelationalDatabaseSchema
assureNonEmptySchema, buildAndRegisterSchema, clearSchemas, getTableFilter, refresh, refreshSchema, removeSchema, schemaFor, tableFor, tableIds, tables
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.debezium.schema.DatabaseSchema
assureNonEmptySchema, schemaFor
Methods inherited from interface io.debezium.schema.HistorizedDatabaseSchema
applySchemaChange, recover
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
schemaHistory
-
historizedConnectorConfig
-
recoveredTables
private boolean recoveredTables
-
-
Constructor Details
-
HistorizedRelationalDatabaseSchema
protected HistorizedRelationalDatabaseSchema(HistorizedRelationalDatabaseConnectorConfig config, TopicNamingStrategy<TableId> topicNamingStrategy, Tables.TableFilter tableFilter, Tables.ColumnNameFilter columnFilter, TableSchemaBuilder schemaBuilder, boolean tableIdCaseInsensitive, Key.KeyMapper customKeysMapper)
-
-
Method Details
-
recover
- Specified by:
recover
in interfaceHistorizedDatabaseSchema<TableId>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classRelationalDatabaseSchema
-
initializeStorage
public void initializeStorage()Configures a storage used to store history, e.g. in Kafka case it creates topic with required parameters.- Specified by:
initializeStorage
in interfaceHistorizedDatabaseSchema<TableId>
-
getDdlParser
Returns a new instance of theDdlParser
to be used when recovering the schema from a previously persisted history. -
record
Records the given schema change event in the persistent history.- Parameters:
schemaChange
- The schema change, must not benull
tableChanges
- A logical representation of the change, may benull
if a specific implementation solely relies on storing DDL statements in the history
-
tableInformationComplete
public boolean tableInformationComplete()Description copied from interface:DatabaseSchema
Indicates whether or not table names are guaranteed to be fully present, regardless of whether or not a snapshot has been performed.- Specified by:
tableInformationComplete
in interfaceDatabaseSchema<TableId>
- Overrides:
tableInformationComplete
in classRelationalDatabaseSchema
- Returns:
- boolean indicating if table names are present
-
storeOnlyCapturedTables
public boolean storeOnlyCapturedTables()- Specified by:
storeOnlyCapturedTables
in interfaceHistorizedDatabaseSchema<TableId>
-
storeOnlyCapturedDatabases
public boolean storeOnlyCapturedDatabases()- Specified by:
storeOnlyCapturedDatabases
in interfaceHistorizedDatabaseSchema<TableId>
-
skipUnparseableDdlStatements
public boolean skipUnparseableDdlStatements()- Specified by:
skipUnparseableDdlStatements
in interfaceHistorizedDatabaseSchema<TableId>
-
ddlFilter
- Specified by:
ddlFilter
in interfaceHistorizedDatabaseSchema<TableId>
-
isHistorized
public boolean isHistorized()Description copied from interface:DatabaseSchema
Whether this schema is historized (i.e. a history of all schema changes is kept which is recovered upon connector restart) or not.- Specified by:
isHistorized
in interfaceDatabaseSchema<TableId>
- Overrides:
isHistorized
in classRelationalDatabaseSchema
-
skipSchemaChangeEvent
-