MCPcopy
hub / github.com/IBM/sarama / SetLastOffsetDelta

Method SetLastOffsetDelta

fetch_response.go:735–743  ·  view source on GitHub ↗
(topic string, partition int32, offset int32)

Source from the content-addressed store, hash-verified

733}
734
735func (r *FetchResponse) SetLastOffsetDelta(topic string, partition int32, offset int32) {
736 frb := r.getOrCreateBlock(topic, partition)
737 if len(frb.RecordsSet) == 0 {
738 records := newDefaultRecords(&RecordBatch{Version: 2})
739 frb.RecordsSet = []*Records{&records}
740 }
741 batch := frb.RecordsSet[0].RecordBatch
742 batch.LastOffsetDelta = offset
743}
744
745func (r *FetchResponse) SetLastStableOffset(topic string, partition int32, offset int64) {
746 frb := r.getOrCreateBlock(topic, partition)

Callers 3

TestConsumerExtraOffsetsFunction · 0.95
TestConsumerTimestampsFunction · 0.95

Calls 2

getOrCreateBlockMethod · 0.95
newDefaultRecordsFunction · 0.85

Tested by 3

TestConsumerExtraOffsetsFunction · 0.76
TestConsumerTimestampsFunction · 0.76