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

Method decode

fetch_request.go:37–62  ·  view source on GitHub ↗
(pd packetDecoder, version int16)

Source from the content-addressed store, hash-verified

35}
36
37func (b *fetchRequestBlock) decode(pd packetDecoder, version int16) (err error) {
38 b.Version = version
39 if b.Version >= 9 {
40 if b.currentLeaderEpoch, err = pd.getInt32(); err != nil {
41 return err
42 }
43 }
44 if b.fetchOffset, err = pd.getInt64(); err != nil {
45 return err
46 }
47 if b.Version >= 12 {
48 if b.lastFetchedEpoch, err = pd.getInt32(); err != nil {
49 return err
50 }
51 }
52 if b.Version >= 5 {
53 if b.logStartOffset, err = pd.getInt64(); err != nil {
54 return err
55 }
56 }
57 if b.maxBytes, err = pd.getInt32(); err != nil {
58 return err
59 }
60 _, err = pd.getEmptyTaggedFieldArray()
61 return err
62}
63
64// FetchRequest (API key 1) will fetch Kafka messages. Version 3 introduced the MaxBytes field. See
65// https://issues.apache.org/jira/browse/KAFKA-2063 for a discussion of the issues leading up to that. The KIP is at

Callers 1

decodeMethod · 0.95

Calls 3

getInt32Method · 0.65
getInt64Method · 0.65

Tested by

no test coverage detected