Package io.debezium.relational.history
Class MemoryDatabaseHistory
- java.lang.Object
-
- io.debezium.relational.history.AbstractDatabaseHistory
-
- io.debezium.relational.history.MemoryDatabaseHistory
-
- All Implemented Interfaces:
DatabaseHistory
@ThreadSafe public final class MemoryDatabaseHistory extends AbstractDatabaseHistory
ADatabaseHistory
implementation that stores the schema history in a local file.- Author:
- Randall Hauch
-
-
Field Summary
Fields Modifier and Type Field Description private FunctionalReadWriteLock
lock
private List<HistoryRecord>
records
-
Fields inherited from class io.debezium.relational.history.AbstractDatabaseHistory
config, INTERNAL_PREFER_DDL, logger
-
Fields 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 Constructor Description MemoryDatabaseHistory()
Create an instance that keeps the history in memory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists()
Determines if the database history entity exists; i.e.protected void
recoverRecords(Consumer<HistoryRecord> records)
boolean
storageExists()
Determines if the underlying storage exists (e.g.protected void
storeRecord(HistoryRecord record)
String
toString()
-
Methods inherited from class io.debezium.relational.history.AbstractDatabaseHistory
configure, initializeStorage, record, record, recover, skipUnparseableDdlStatements, start, stop, storeOnlyCapturedTables
-
-
-
-
Field Detail
-
records
private final List<HistoryRecord> records
-
lock
private final FunctionalReadWriteLock lock
-
-
Method Detail
-
storeRecord
protected void storeRecord(HistoryRecord record)
- Specified by:
storeRecord
in classAbstractDatabaseHistory
-
recoverRecords
protected void recoverRecords(Consumer<HistoryRecord> records)
- Specified by:
recoverRecords
in classAbstractDatabaseHistory
-
storageExists
public boolean storageExists()
Description copied from interface:DatabaseHistory
Determines 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:DatabaseHistory
Determines if the database history entity exists; i.e. the storage must have been initialized and the history must have been populated.
-
-