ezhou413 commented on code in PR #23483:
URL: https://github.com/apache/kafka/pull/23483#discussion_r4319430811
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/ChunkedByteBufferOutputStream.java:
##########
@@ -325,8 +361,9 @@ void throwIfInsufficientRemaining(int requiredBytes) {
ensureNotDeallocated();
// A single write can be split across several chunks, so the required
bytes needn't be
// contiguous: only the total free space matters. Advancing here would
waste the tail of the
- // current chunk, so writes advance lazily and this only validates.
- // TODO: review with KAFKA-20579, but growth support should belong in
advanceToNextChunk, not here.
+ // current chunk, so writes advance lazily and this only validates.
Automatic growth lives in
+ // advanceToNextChunk; this method only checks the currently attached
chunks (the accumulator
+ // uses it to decide when to attach extension chunks up front).
Review Comment:
Updated
##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/ChunkedRecordAccumulatorTest.java:
##########
@@ -23,11 +23,14 @@
import org.apache.kafka.common.Node;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.compress.Compression;
+import org.apache.kafka.common.errors.RecordBatchTooLargeException;
import org.apache.kafka.common.errors.TimeoutException;
import org.apache.kafka.common.metrics.KafkaMetric;
import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.record.TimestampType;
+import org.apache.kafka.common.record.internal.CompressionRatioEstimator;
Review Comment:
Added
--
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]