Package io.debezium.embedded
Class AbstractConnectorTest.SourceRecords
- java.lang.Object
-
- io.debezium.embedded.AbstractConnectorTest.SourceRecords
-
- Enclosing class:
- AbstractConnectorTest
protected class AbstractConnectorTest.SourceRecords extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,List<org.apache.kafka.connect.source.SourceRecord>>ddlRecordsByDbNameprivate List<org.apache.kafka.connect.source.SourceRecord>recordsprivate Map<String,List<org.apache.kafka.connect.source.SourceRecord>>recordsByTopic
-
Constructor Summary
Constructors Modifier Constructor Description protectedSourceRecords()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.apache.kafka.connect.source.SourceRecord record)List<org.apache.kafka.connect.source.SourceRecord>allRecordsInOrder()Set<String>databaseNames()Get the names of the databases that were affected by the DDL statements.List<org.apache.kafka.connect.source.SourceRecord>ddlRecordsForDatabase(String dbName)Get the DDL events for the named database.voidforEach(Consumer<org.apache.kafka.connect.source.SourceRecord> consumer)voidforEachInTopic(String topic, Consumer<org.apache.kafka.connect.source.SourceRecord> consumer)protected StringgetAffectedDatabase(org.apache.kafka.connect.source.SourceRecord record)voidprint()List<org.apache.kafka.connect.source.SourceRecord>recordsForTopic(String topicName)Get the records on the given topic.Set<String>topics()Get the set of topics for which records were received.
-
-
-
Method Detail
-
add
public void add(org.apache.kafka.connect.source.SourceRecord record)
-
getAffectedDatabase
protected String getAffectedDatabase(org.apache.kafka.connect.source.SourceRecord record)
-
ddlRecordsForDatabase
public List<org.apache.kafka.connect.source.SourceRecord> ddlRecordsForDatabase(String dbName)
Get the DDL events for the named database.- Parameters:
dbName- the name of the database; may not be null- Returns:
- the DDL-related events; never null but possibly empty
-
databaseNames
public Set<String> databaseNames()
Get the names of the databases that were affected by the DDL statements.- Returns:
- the set of database names; never null but possibly empty
-
recordsForTopic
public List<org.apache.kafka.connect.source.SourceRecord> recordsForTopic(String topicName)
Get the records on the given topic.- Parameters:
topicName- the name of the topic.- Returns:
- the records for the topic; possibly null if there were no records produced on the topic
-
topics
public Set<String> topics()
Get the set of topics for which records were received.- Returns:
- the names of the topics; never null
-
forEachInTopic
public void forEachInTopic(String topic, Consumer<org.apache.kafka.connect.source.SourceRecord> consumer)
-
forEach
public void forEach(Consumer<org.apache.kafka.connect.source.SourceRecord> consumer)
-
allRecordsInOrder
public List<org.apache.kafka.connect.source.SourceRecord> allRecordsInOrder()
-
print
public void print()
-
-