Skip to content
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

Update built-in partitioner options to include murmur2 #396

Merged
merged 3 commits into from
Jun 12, 2018
Merged

Update built-in partitioner options to include murmur2 #396

merged 3 commits into from
Jun 12, 2018

Conversation

rnpridgeon
Copy link
Contributor

Referenced in #231

@rnpridgeon
Copy link
Contributor Author

Travis failure due to the lingering 0.11.4 version in .travis.yml

@rnpridgeon rnpridgeon requested a review from edenhill June 7, 2018 01:39
@edenhill
Copy link
Contributor

edenhill commented Jun 7, 2018

There's no need for this anymore since librdkafka's partitioners can be configured directly in librdkafka through string properties, search for "partitioner" here: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md

We should rather remove this code from the Python client

@rnpridgeon
Copy link
Contributor Author

Makes sense, hadn't considered the fall through to librdkafka. Update inbound

Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove all the partitioner functionality, just grep for partitioner and you'll find a horde of unused stuff.

@@ -168,3 +168,26 @@ def handle_dr(err, msg):
p.produce('mytopic', "\xc2\xc2", on_delivery=handle_dr)

p.flush()


def test_set_partioner_murmur2():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partitioner

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still partioner

"""
with pytest.raises(KafkaException) as e:
Producer({'partitioner': 'murmur'})
assert e == 'unknown builtin partitioner: murmur' in e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you certain this works, referencing the exception from with the block?
I think it needs to go in the outer block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would fail otherwise no? I have tested it without checking for the raised exception at all and it raised the appropriate exception

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the assert is never reached since Producer() raises an exception

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rnpridgeon
Copy link
Contributor Author

@edenhill, I think I got it all this go around

Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -168,3 +168,26 @@ def handle_dr(err, msg):
p.produce('mytopic', "\xc2\xc2", on_delivery=handle_dr)

p.flush()


def test_set_partioner_murmur2():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still partioner

@edenhill
Copy link
Contributor

Dont forget retarget for master before merging

@rnpridgeon rnpridgeon changed the base branch from adminapi to master June 11, 2018 22:26
@rnpridgeon rnpridgeon merged commit 42ef727 into confluentinc:master Jun 12, 2018
gnkoshelev added a commit to gnkoshelev/confluent-kafka-python that referenced this pull request Sep 12, 2024
Custom partitioner was removed a long time ago having predefined set of partitioners from librdkafka (confluentinc#396) but 'known bug' note still exists. That note is misleading regarding the use of the 'partitioner' configuration property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants