Class AbstractConnectorTest.SourceRecords

    • Field Detail

      • records

        private final List<org.apache.kafka.connect.source.SourceRecord> records
      • recordsByTopic

        private final Map<String,​List<org.apache.kafka.connect.source.SourceRecord>> recordsByTopic
      • ddlRecordsByDbName

        private final Map<String,​List<org.apache.kafka.connect.source.SourceRecord>> ddlRecordsByDbName
    • Constructor Detail

      • SourceRecords

        protected SourceRecords()
    • 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()