@ThreadSafe public final class FileDatabaseHistory extends AbstractDatabaseHistory
DatabaseHistory implementation that stores the schema history in a local file.| Modifier and Type | Field and Description |
|---|---|
static Collection<Field> |
ALL_FIELDS |
static Field |
FILE_PATH |
private FunctionalReadWriteLock |
lock |
private Path |
path |
private DocumentReader |
reader |
private AtomicBoolean |
running |
private static Charset |
UTF8 |
private DocumentWriter |
writer |
config, loggerCONFIGURATION_FIELD_PREFIX_STRING, DDL_FILTER, NAME, SKIP_UNPARSEABLE_DDL_STATEMENTS, STORE_ONLY_MONITORED_TABLES_DDL| Constructor and Description |
|---|
FileDatabaseHistory() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Configuration config,
HistoryRecordComparator comparator,
DatabaseHistoryListener listener,
boolean useCatalogBeforeSchema)
Configure this instance.
|
boolean |
exists()
Determines if the DatabaseHistory entity exists
|
protected void |
recoverRecords(Consumer<HistoryRecord> records) |
void |
start()
Start the history.
|
void |
stop()
Stop recording history and release any resources acquired since
#configure(Configuration, HistoryRecordComparator, DatabaseHistoryListener). |
protected void |
storeRecord(HistoryRecord record) |
String |
toString() |
initializeStorage, record, record, recoverpublic static final Field FILE_PATH
public static Collection<Field> ALL_FIELDS
private static final Charset UTF8
private final FunctionalReadWriteLock lock
private final DocumentWriter writer
private final DocumentReader reader
private final AtomicBoolean running
private Path path
public void configure(Configuration config, HistoryRecordComparator comparator, DatabaseHistoryListener listener, boolean useCatalogBeforeSchema)
DatabaseHistoryconfigure in interface DatabaseHistoryconfigure in class AbstractDatabaseHistoryconfig - the configuration for this history storecomparator - the function that should be used to compare history records during
recovery; may be null if the
default comparator is 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 namepublic void start()
DatabaseHistorystart in interface DatabaseHistorystart in class AbstractDatabaseHistoryprotected void storeRecord(HistoryRecord record) throws DatabaseHistoryException
storeRecord in class AbstractDatabaseHistoryDatabaseHistoryExceptionpublic void stop()
DatabaseHistory#configure(Configuration, HistoryRecordComparator, DatabaseHistoryListener).stop in interface DatabaseHistorystop in class AbstractDatabaseHistoryprotected void recoverRecords(Consumer<HistoryRecord> records)
recoverRecords in class AbstractDatabaseHistorypublic boolean exists()
DatabaseHistoryCopyright © 2020 JBoss by Red Hat. All rights reserved.