This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.
Current state: Discarded in favor of KIP-456: Helper classes to make it simpler to write test logic with TopologyTestDriver
Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
When using the TopologyTestDriver, one examines the output on a topic with the readOutput method. This method returns one record at a time, until no more records can be found, at which point in returns null.
Many times, the usage pattern around readOutput will involve writing a loop to extract a number of records from the topic, building up a list of records, until it returns null.
It would be helpful to offer an iterable signature of readOutput, which returns either an iterator or list over the records that are currently available in the topic. This would effectively remove the loop that a user needs to write for him/herself each time.
This KIP would propose to add methods which return an Iterable of the output records as byte arrays and with key/value deserializers:
Compatibility, Deprecation, and Migration Plan
- As these are new methods there should be no impact on existing users
- Use of Iterator as return type: Iterable can be used in foreach loop directly and can return an Iterator if needed.
- Return List of ProducerRecord: No real reason against it but was not favored so far. Might be added by KIP-456: Helper classes to make it simpler to write test logic with TopologyTestDriver anyway.