MCPcopy
hub / github.com/segmentio/kafka-go / newRecordBatch

Function newRecordBatch

recordbatch.go:66–77  ·  view source on GitHub ↗
(codec CompressionCodec, msgs ...Message)

Source from the content-addressed store, hash-verified

64}
65
66func newRecordBatch(codec CompressionCodec, msgs ...Message) (r *recordBatch, err error) {
67 r = &recordBatch{
68 codec: codec,
69 msgs: msgs,
70 }
71 if r.codec == nil {
72 r.size = recordBatchSize(r.msgs...)
73 } else {
74 r.compressed, r.attributes, r.size, err = compressRecordBatch(r.codec, r.msgs...)
75 }
76 return
77}
78
79func (r *recordBatch) writeTo(wb *writeBuffer) {
80 wb.writeInt32(r.size)

Callers 1

Calls 2

recordBatchSizeFunction · 0.85
compressRecordBatchFunction · 0.85

Tested by

no test coverage detected