(pe packetEncoder)
| 346 | } |
| 347 | |
| 348 | func (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 | |
| 374 | func (b *FetchResponseBlock) getAbortedTransactions() []*AbortedTransaction { |
| 375 | // I can't find any doc that guarantee the field `fetchResponse.AbortedTransactions` is ordered |
no test coverage detected