MCPcopy Create free account
hub / github.com/IBM/sarama / encodeTaggedFields

Method encodeTaggedFields

fetch_response.go:348–372  ·  view source on GitHub ↗
(pe packetEncoder)

Source from the content-addressed store, hash-verified

346}
347
348func (b *FetchResponseBlock) encodeTaggedFields(pe packetEncoder) {
349 var numTaggedFields uint64
350 if b.DivergingEpoch != nil {
351 numTaggedFields++
352 }
353 if b.CurrentLeader != nil {
354 numTaggedFields++
355 }
356
357 pe.putUVarint(numTaggedFields)
358 if b.DivergingEpoch != nil {
359 pe.putUVarint(0)
360 pe.putUVarint(13) // int32 plus int64 plus the struct's empty tagged fields
361 pe.putInt32(b.DivergingEpoch.Epoch)
362 pe.putInt64(b.DivergingEpoch.EndOffset)
363 pe.putEmptyTaggedFieldArray()
364 }
365 if b.CurrentLeader != nil {
366 pe.putUVarint(1)
367 pe.putUVarint(9) // two int32s plus the struct's empty tagged fields
368 pe.putInt32(b.CurrentLeader.LeaderID)
369 pe.putInt32(b.CurrentLeader.LeaderEpoch)
370 pe.putEmptyTaggedFieldArray()
371 }
372}
373
374func (b *FetchResponseBlock) getAbortedTransactions() []*AbortedTransaction {
375 // I can't find any doc that guarantee the field `fetchResponse.AbortedTransactions` is ordered

Callers 1

encodeMethod · 0.95

Calls 4

putUVarintMethod · 0.65
putInt32Method · 0.65
putInt64Method · 0.65

Tested by

no test coverage detected