Package io.debezium.relational.history
Class FileDatabaseHistory
java.lang.Object
io.debezium.relational.history.AbstractDatabaseHistory
io.debezium.relational.history.FileDatabaseHistory
- All Implemented Interfaces:
DatabaseHistory
A
DatabaseHistory implementation that stores the schema history in a local file.- Author:
- Randall Hauch
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Collection<Field>static final Fieldprivate final FunctionalReadWriteLockprivate Pathprivate final DocumentReaderprivate final AtomicBooleanprivate static final Charsetprivate final DocumentWriterFields inherited from class io.debezium.relational.history.AbstractDatabaseHistory
config, INTERNAL_PREFER_DDL, loggerFields inherited from interface io.debezium.relational.history.DatabaseHistory
CONFIGURATION_FIELD_PREFIX_STRING, DDL_FILTER, NAME, SKIP_UNPARSEABLE_DDL_STATEMENTS, STORE_ONLY_CAPTURED_TABLES_DDL, STORE_ONLY_MONITORED_TABLES_DDL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration config, HistoryRecordComparator comparator, DatabaseHistoryListener listener, boolean useCatalogBeforeSchema) Configure this instance.booleanexists()Determines if the database history entity exists; i.e.protected voidrecoverRecords(Consumer<HistoryRecord> records) voidstart()Start the history.voidstop()Stop recording history and release any resources acquired since#configure(Configuration, HistoryRecordComparator, DatabaseHistoryListener).booleanDetermines if the underlying storage exists (e.g.protected voidstoreRecord(HistoryRecord record) toString()Methods inherited from class io.debezium.relational.history.AbstractDatabaseHistory
initializeStorage, record, record, recover, skipUnparseableDdlStatements, storeOnlyCapturedTablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.debezium.relational.history.DatabaseHistory
recover, recover
-
Field Details
-
FILE_PATH
-
ALL_FIELDS
-
UTF8
-
lock
-
writer
-
reader
-
running
-
path
-
-
Constructor Details
-
FileDatabaseHistory
public FileDatabaseHistory()
-
-
Method Details
-
configure
public void configure(Configuration config, HistoryRecordComparator comparator, DatabaseHistoryListener listener, boolean useCatalogBeforeSchema) Description copied from interface:DatabaseHistoryConfigure this instance.- Specified by:
configurein interfaceDatabaseHistory- Overrides:
configurein classAbstractDatabaseHistory- Parameters:
config- the configuration for this history storecomparator- the function that should be used to compare history records duringrecovery; may be null if thedefault comparatoris to be usedlistener- TODOuseCatalogBeforeSchema- true if the parsed string for a table contains only 2 items and the first should be used as the catalog and the second as the table name, or false if the first should be used as the schema and the second as the table name
-
start
public void start()Description copied from interface:DatabaseHistoryStart the history.- Specified by:
startin interfaceDatabaseHistory- Overrides:
startin classAbstractDatabaseHistory
-
storeRecord
- Specified by:
storeRecordin classAbstractDatabaseHistory- Throws:
DatabaseHistoryException
-
stop
public void stop()Description copied from interface:DatabaseHistoryStop recording history and release any resources acquired since#configure(Configuration, HistoryRecordComparator, DatabaseHistoryListener).- Specified by:
stopin interfaceDatabaseHistory- Overrides:
stopin classAbstractDatabaseHistory
-
recoverRecords
- Specified by:
recoverRecordsin classAbstractDatabaseHistory
-
storageExists
public boolean storageExists()Description copied from interface:DatabaseHistoryDetermines if the underlying storage exists (e.g. a Kafka topic, file or similar). Note: storage may exist while history entities not yet written, seeDatabaseHistory.exists() -
exists
public boolean exists()Description copied from interface:DatabaseHistoryDetermines if the database history entity exists; i.e. the storage must have been initialized and the history must have been populated. -
toString
-