-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The wiki of the offset API has been updated again #400
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,15 @@ package sarama | |
|
||
type OffsetFetchRequest struct { | ||
ConsumerGroup string | ||
Version int16 | ||
partitions map[string][]int32 | ||
} | ||
|
||
func (r *OffsetFetchRequest) encode(pe packetEncoder) (err error) { | ||
if r.Version < 0 || r.Version > 1 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not r.version != 1, you don't have decimal version do you ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually it should be > 2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what you mean? Based on my reading of the protocol guide (and Jun's comment in JIRA) the version can be 0 or 1, so if it is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind then, that looks good |
||
return PacketEncodingError{"invalid or unsupported OffsetFetchRequest version field"} | ||
} | ||
|
||
if err = pe.putString(r.ConsumerGroup); err != nil { | ||
return err | ||
} | ||
|
@@ -28,7 +33,7 @@ func (r *OffsetFetchRequest) key() int16 { | |
} | ||
|
||
func (r *OffsetFetchRequest) version() int16 { | ||
return 0 | ||
return r.Version | ||
} | ||
|
||
func (r *OffsetFetchRequest) AddPartition(topic string, partitionID int32) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any idea what this used for? Couldn't find anything useful in the wiki.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://cwiki.apache.org/confluence/display/KAFKA/Kafka+0.9+Consumer+Rewrite+Design