DBZ-1886 Misc. clean-up

This commit is contained in:
Gunnar Morling 2020-04-20 17:45:28 +02:00
parent 75f19239d1
commit 1a5dd5db98
3 changed files with 10 additions and 7 deletions

View File

@ -72,6 +72,7 @@ Horia Chiorean
Ian Axelrod
Igor Gabaydulin
Ilia Bogdanov
Ivan Klass
Ivan Kovbas
Ivan Lorenz
Ivan Luzyanin

View File

@ -82,8 +82,8 @@ public interface DatabaseHistory {
* {@link #recover(Map, Map, Tables, DdlParser) recovery}; may be null if the
* {@link HistoryRecordComparator#INSTANCE default comparator} is to be used
* @param listener TODO
* @param useCatalogBeforeSchema 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
* @param useCatalogBeforeSchema 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
*/
void configure(Configuration config, HistoryRecordComparator comparator, DatabaseHistoryListener listener, boolean useCatalogBeforeSchema);
@ -128,15 +128,14 @@ public interface DatabaseHistory {
void stop();
/**
* Determines if the DatabaseHistory entity exists
* @return
* Determines if the database history entity exists; i.e. the storage must have
* been initialized and the history must have been populated.
*/
boolean exists();
/**
* Determines if the underlying storage exists.
* Note: storage may exists while history entities not yet written, see {@link #exists()}
* @return
* Determines if the underlying storage exists (e.g. a Kafka topic, file or similar).
* Note: storage may exist while history entities not yet written, see {@link #exists()}
*/
boolean storageExists();

View File

@ -22,6 +22,7 @@
import org.junit.Test;
import io.debezium.config.Configuration;
import io.debezium.doc.FixFor;
import io.debezium.kafka.KafkaCluster;
import io.debezium.relational.Tables;
import io.debezium.relational.ddl.DdlParserSql2003;
@ -298,6 +299,7 @@ public void testExists() {
}
@Test
@FixFor("DBZ-1886")
public void differentiateStorageExistsFromHistoryExists() {
Configuration config = Configuration.create()
.with(KafkaDatabaseHistory.BOOTSTRAP_SERVERS, kafka.brokerList())
@ -326,5 +328,6 @@ public void differentiateStorageExistsFromHistoryExists() {
"CREATE TABLE products ( productId INTEGER NOT NULL PRIMARY KEY, desc VARCHAR(255) NOT NULL); \n";
history.record(source, position, "db1", ddl);
assertTrue(history.exists());
assertTrue(history.storageExists());
}
}