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
FieldsFields inherited from interface io.debezium.schema.DatabaseSchema
NO_CAPTURED_DATA_COLLECTIONS_WARNING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHistorizedRelationalDatabaseSchema(HistorizedRelationalDatabaseConnectorConfig config, TopicNamingStrategy<TableId> topicNamingStrategy, Tables.TableFilter tableFilter, Tables.ColumnNameFilter columnFilter, TableSchemaBuilder schemaBuilder, boolean tableIdCaseInsensitive, Key.KeyMapper customKeysMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected abstract DdlParserReturns a new instance of theDdlParserto be used when recovering the schema from a previously persisted history.voidConfigures a storage used to store history, e.g.booleanWhether this schema is historized (i.e.protected voidrecord(SchemaChangeEvent schemaChange, TableChanges tableChanges) Records the given schema change event in the persistent history.voidbooleanbooleanbooleanIndicates 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, tablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.schema.DatabaseSchema
assureNonEmptySchema, schemaForMethods inherited from interface io.debezium.schema.HistorizedDatabaseSchema
applySchemaChange, recover
-
Field Details
-
schemaHistory
-
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:
recoverin interfaceHistorizedDatabaseSchema<TableId>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein 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:
initializeStoragein interfaceHistorizedDatabaseSchema<TableId>
-
getDdlParser
Returns a new instance of theDdlParserto 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 benulltableChanges- A logical representation of the change, may benullif a specific implementation solely relies on storing DDL statements in the history
-
tableInformationComplete
public boolean tableInformationComplete()Description copied from interface:DatabaseSchemaIndicates whether or not table names are guaranteed to be fully present, regardless of whether or not a snapshot has been performed.- Specified by:
tableInformationCompletein interfaceDatabaseSchema<TableId>- Overrides:
tableInformationCompletein classRelationalDatabaseSchema- Returns:
- boolean indicating if table names are present
-
storeOnlyCapturedTables
public boolean storeOnlyCapturedTables()- Specified by:
storeOnlyCapturedTablesin interfaceHistorizedDatabaseSchema<TableId>
-
skipUnparseableDdlStatements
public boolean skipUnparseableDdlStatements() -
isHistorized
public boolean isHistorized()Description copied from interface:DatabaseSchemaWhether this schema is historized (i.e. a history of all schema changes is kept which is recovered upon connector restart) or not.- Specified by:
isHistorizedin interfaceDatabaseSchema<TableId>- Overrides:
isHistorizedin classRelationalDatabaseSchema
-