Skip to content

Commit

Permalink
breaking: rename BatchMaxBytes to ProducerBatchMaxBytes
Browse files Browse the repository at this point in the history
Similar to the prior two commits, this one was even more ambiguous: did
the BatchMaxBytes refer to the max bytes we would want per partition
while fetching? The new name is clearer.
  • Loading branch information
twmb committed Sep 1, 2021
1 parent 9a76213 commit 6272a3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/kgo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ func ProducerBatchCompression(preference ...CompressionCodec) ProducerOpt {
return producerOpt{func(cfg *cfg) { cfg.compression = preference }}
}

// BatchMaxBytes upper bounds the size of a record batch, overriding the
// default 1MB.
// ProducerBatchMaxBytes upper bounds the size of a record batch, overriding
// the default 1MB.
//
// This corresponds to Kafka's max.message.bytes, which defaults to 1,000,012
// bytes (just over 1MB).
Expand All @@ -832,10 +832,10 @@ func ProducerBatchCompression(preference ...CompressionCodec) ProducerOpt {
// If a single record encodes larger than this number (before compression), it
// will will not be written and a callback will have the appropriate error.
//
// Note that this is the maximum size of a record batch before compression.
// If a batch compresses poorly and actually grows the batch, the uncompressed
// Note that this is the maximum size of a record batch before compression. If
// a batch compresses poorly and actually grows the batch, the uncompressed
// form will be used.
func BatchMaxBytes(v int32) ProducerOpt {
func ProducerBatchMaxBytes(v int32) ProducerOpt {
return producerOpt{func(cfg *cfg) { cfg.maxRecordBatchBytes = v }}
}

Expand Down

0 comments on commit 6272a3b

Please sign in to comment.