Package org.apache.kafka.tools.api
Interface RecordReader
- All Superinterfaces:
- AutoCloseable,- Closeable,- Configurable
Typical implementations of this interface convert data from an `InputStream` received via `readRecords` into a
 iterator of `ProducerRecord` instance. Note that implementations must have a public nullary constructor.
 This is used by the `kafka.tools.ConsoleProducer`.
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidclose()Closes this reader.default voidConfigure this class with the given key-value pairsIterator<ProducerRecord<byte[],byte[]>> readRecords(InputStream inputStream) read byte array from input stream and then generate an iterator of producer record
- 
Method Details- 
configureDescription copied from interface:ConfigurableConfigure this class with the given key-value pairs- Specified by:
- configurein interface- Configurable
 
- 
readRecordsread byte array from input stream and then generate an iterator of producer record- Parameters:
- inputStream-- InputStreamof messages. the implementation does not need to close the input stream.
- Returns:
- an iterator of producer record. It should implement following rules. 1) the hasNext() method must be idempotent. 2) the convert error should be thrown by next() method.
 
- 
closedefault void close()Closes this reader. This method is invoked if the iterator from readRecords either has no more records or throws exception.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
-