chia7712 commented on code in PR #23477:
URL: https://github.com/apache/kafka/pull/23477#discussion_r4030642150
##########
clients/src/main/java/org/apache/kafka/common/record/internal/RecordBatch.java:
##########
@@ -249,6 +249,26 @@ public interface RecordBatch extends Iterable<Record> {
*/
CloseableIterator<Record> streamingIterator(BufferSupplier
decompressionBufferSupplier, int maxRecordBodySize);
+ /**
+ * Return an iterator which skips parsing key, value and headers, so the
returned {@link Record}s expose only the
+ * offset, timestamp, sequence and sizes. Use it when the key and value
are not needed to avoid allocating them.
+ * Only compressed batches of magic v2 and above benefit: uncompressed
batches slice the underlying buffer without
+ * copying, and older message formats fall back to a full decode. Callers
should ensure that the iterator is closed.
+ *
+ * @param bufferSupplier The supplier of ByteBuffer(s) used for
decompression if supported.
+ * @return The closeable iterator
+ */
+ CloseableIterator<Record> skipKeyValueIterator(BufferSupplier
bufferSupplier);
Review Comment:
We don't need this variant, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]