Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Create admin client #44

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
merged 9 commits into from
Jan 11, 2018
Merged

Create admin client #44

merged 9 commits into from
Jan 11, 2018

Conversation

ashsingh21
Copy link
Member

I dont why the other branch showing ' branch upto date' so created this one. Also for the integrations test please look for my comment in the previous branch.

timeout=timeout,
)
return self._send_request(request)

Choose a reason for hiding this comment

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

Please check it with flake8. I am pretty sure it will complain about empty lines

Arguments:
new_topics (list of NewTopic): A list containing new
topics to be created
validate_only (bool): True if we just want to validate the request

Choose a reason for hiding this comment

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

There are no validate_only param for the method

""" Create topics on the cluster

Arguments:
new_topics (list of NewTopic): A list containing new

Choose a reason for hiding this comment

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

Please rename it to topics as param.

topics to be created
validate_only (bool): True if we just want to validate the request
timeout (int): timeout in seconds
max_retry (int): num of times we want to retry to send a create

Choose a reason for hiding this comment

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

There are no max_retry any more.

)])


class TestTopicAdmin():

Choose a reason for hiding this comment

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

Can we have a unit test for delete topics?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure.

response = admin.create_topics(topics=[topic], timeout=1)
self.assertTrue(
response[0].topic_error_codes[0][1] == 0 or
response[0].topic_error_codes[0][1] == 7

Choose a reason for hiding this comment

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

Why is code 7 good? Can we add a comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ecanzonieri 7 is RequestTimedOut but we can safely assume the topic is created or will be created eventually.
for more information see this https://cwiki.apache.org/confluence/display/KAFKA/KIP-4+-+Command+line+and+centralized+administrative+operations

Choose a reason for hiding this comment

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

Can we add a comment in the code?

assert response == topic_response


def delete_topics(

Choose a reason for hiding this comment

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

test_

@ashsingh21 ashsingh21 merged commit 754ee63 into Yelp:master Jan 11, 2018
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.

3 participants