-
Notifications
You must be signed in to change notification settings - Fork 915
AvroConsumer for handling schema registry #80
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
Merged
edenhill
merged 8 commits into
confluentinc:master
from
roopahc:schema_registry_producer
Nov 28, 2016
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
550688d
AvroProducer for handling schema registry
5b88a9e
Implemented revie feedback
f8ec601
Feedback
4bac7cd
Implemented review comments
21c0b64
Implemented review comments
badd3bb
Implemented review comments
9797fef
Consumer client for handling avro schemas
95a9dbb
Merge branch 'schema_registry_producer' of github.com:roopahc/conflue…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,6 +332,23 @@ static PyObject *Message_timestamp (Message *self, PyObject *ignore) { | |
self->timestamp); | ||
} | ||
|
||
static PyObject *Message_set_value (Message *self, PyObject *new_val) { | ||
if (self->value) | ||
Py_DECREF(self->value); | ||
self->value = new_val; | ||
Py_INCREF(self->value); | ||
|
||
Py_RETURN_NONE; | ||
} | ||
|
||
static PyObject *Message_set_key (Message *self, PyObject *new_key) { | ||
if (self->key) | ||
Py_DECREF(self->key); | ||
self->key = new_key; | ||
Py_INCREF(self->key); | ||
|
||
Py_RETURN_NONE; | ||
} | ||
|
||
static PyMethodDef Message_methods[] = { | ||
{ "error", (PyCFunction)Message_error, METH_NOARGS, | ||
|
@@ -391,6 +408,20 @@ static PyMethodDef Message_methods[] = { | |
" :rtype: (int, int)\n" | ||
"\n" | ||
}, | ||
{ "set_value", (PyCFunction)Message_set_value, METH_O, | ||
" Set the field 'Message.value' with new value.\n" | ||
" :param: object value: Message.value.\n" | ||
" :returns: None.\n" | ||
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. Missing docstring saying what the method actually does |
||
" :rtype: None\n" | ||
"\n" | ||
}, | ||
{ "set_key", (PyCFunction)Message_set_key, METH_O, | ||
" Set the field 'Message.key' with new value.\n" | ||
" :param: object value: Message.key.\n" | ||
" :returns: None.\n" | ||
" :rtype: None\n" | ||
"\n" | ||
}, | ||
{ NULL } | ||
}; | ||
|
||
|
@@ -1217,7 +1248,7 @@ rd_kafka_conf_t *common_conf_setup (rd_kafka_type_t ktype, | |
Py_DECREF(ks); | ||
return NULL; | ||
} | ||
|
||
if (h->stats_cb) { | ||
Py_DECREF(h->stats_cb); | ||
h->stats_cb = NULL; | ||
|
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.
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.
Document param and type, see an example here:
https://github.com/confluentinc/confluent-kafka-python/blob/master/confluent_kafka/src/confluent_kafka.c#L741