Added Consumer.store_offsets() API#245
Merged
Magnus Edenhill (edenhill) merged 4 commits intoSep 15, 2017
Merged
Conversation
Magnus Edenhill (edenhill)
suggested changes
Sep 14, 2017
Contributor
Magnus Edenhill (edenhill)
left a comment
There was a problem hiding this comment.
Great stuff!
miniscule changes needed
| c_offsets = rd_kafka_topic_partition_list_new(1); | ||
| rd_kafka_topic_partition_list_add( | ||
| c_offsets, cfl_PyUnistr_AsUTF8(m->topic, &uo8), | ||
| m->partition)->offset =m->offset + 1; |
Contributor
There was a problem hiding this comment.
nit: space after =
Contributor
Author
There was a problem hiding this comment.
fixed
|
|
||
| err = rd_kafka_offsets_store(self->rk, c_offsets); | ||
|
|
||
| if (c_offsets) |
Contributor
There was a problem hiding this comment.
this is always true
Contributor
Author
There was a problem hiding this comment.
That's true, fixed!
Guard rd_kafka_offsets_store() inside version check (implicit-function-declaration)
| rd_kafka_version(), RD_KAFKA_VERSION); | ||
| return NULL; | ||
| #endif | ||
| #else |
Contributor
There was a problem hiding this comment.
good catch
Magnus Edenhill (edenhill)
suggested changes
Sep 14, 2017
| "buildtime 0x%x)", | ||
| rd_kafka_version(), RD_KAFKA_VERSION); | ||
| return NULL; | ||
| #endif |
Contributor
There was a problem hiding this comment.
With this #else guard the variables defined above will be unused and produce warnings.
I suggest moving the variable decls down to the #else block.
Avoid declaring unused variables & relavant warnings
Contributor
|
The thread test failure is not your fault, ignore it. |
Contributor
|
Thanks for this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello all,
This PR implements the
Cosumer.store_offsets()API. The signature is similar to the.commit()method.