Package io.debezium.relational
Class HistorizedRelationalDatabaseSchema
- java.lang.Object
-
- io.debezium.relational.RelationalDatabaseSchema
-
- io.debezium.relational.HistorizedRelationalDatabaseSchema
-
- All Implemented Interfaces:
DatabaseSchema<TableId>,HistorizedDatabaseSchema<TableId>
public abstract class HistorizedRelationalDatabaseSchema extends RelationalDatabaseSchema implements HistorizedDatabaseSchema<TableId>
ADatabaseSchemaor 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
Fields Modifier and Type Field Description protected DatabaseHistorydatabaseHistoryprivate booleanrecoveredTables-
Fields inherited from interface io.debezium.schema.DatabaseSchema
NO_CAPTURED_DATA_COLLECTIONS_WARNING
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHistorizedRelationalDatabaseSchema(HistorizedRelationalDatabaseConnectorConfig config, TopicSelector<TableId> topicSelector, Tables.TableFilter tableFilter, Tables.ColumnNameFilter columnFilter, TableSchemaBuilder schemaBuilder, boolean tableIdCaseInsensitive, Key.KeyMapper customKeysMapper)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract DdlParsergetDdlParser()Returns a new instance of theDdlParserto be used when recovering the schema from a previously persisted history.voidinitializeStorage()Configures a storage used to store history, e.g.booleanisHistorized()Whether this schema is historized (i.e.protected voidrecord(SchemaChangeEvent schemaChange, TableChanges tableChanges)Records the given schema change event in the persistent history.voidrecover(Offsets<?,?> offsets)booleanskipUnparseableDdlStatements()booleanstoreOnlyCapturedTables()booleantableInformationComplete()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 Detail
-
databaseHistory
protected final DatabaseHistory databaseHistory
-
recoveredTables
private boolean recoveredTables
-
-
Constructor Detail
-
HistorizedRelationalDatabaseSchema
protected HistorizedRelationalDatabaseSchema(HistorizedRelationalDatabaseConnectorConfig config, TopicSelector<TableId> topicSelector, Tables.TableFilter tableFilter, Tables.ColumnNameFilter columnFilter, TableSchemaBuilder schemaBuilder, boolean tableIdCaseInsensitive, Key.KeyMapper customKeysMapper)
-
-
Method Detail
-
recover
public void recover(Offsets<?,?> offsets)
- Specified by:
recoverin interfaceHistorizedDatabaseSchema<TableId>
-
close
public void close()
- Specified by:
closein interfaceDatabaseSchema<TableId>- 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
protected abstract DdlParser getDdlParser()
Returns a new instance of theDdlParserto be used when recovering the schema from a previously persisted history.
-
record
protected void record(SchemaChangeEvent schemaChange, TableChanges tableChanges)
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
-
-