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

Issue 16 : API for list scope and list stream #20

Merged

Conversation

anju-c-das
Copy link
Contributor

Change log description
Add new API to get list of scope and list of stream for python client.

Purpose of the change
Fixes #19

What the code does
The code has two new APi's list_scope and list_stream which when called will return the list of scope and list of stream respectively.

How to verify it
Test cases should pass.

anju_das and others added 19 commits January 9, 2024 17:19
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
Signed-off-by: anju_das <[email protected]>
@anju-c-das anju-c-das marked this pull request as ready for review February 1, 2024 09:48
@anju-c-das anju-c-das changed the title Issue 16 : New API for list scope and list stream Issue 16 : API for list scope and list stream Feb 1, 2024
@@ -57,6 +58,23 @@ def test_tags(self):
tags = stream_manager.get_stream_tags(scope, "testStream1")
self.assertEqual(["t4", "t5"], tags)

# test for list_scope api
scope_list = stream_manager.list_scope()
self.assertTrue(len(scope_list) > 0, "The list is empty")
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of scope_list > 0, can we update the assert to length equal to 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we checked offline, it can't be updated with length equal to 1, as it retains all the scope that exist in standalone run too.
So it may or may not be always 1.

tests/pravega_client_test.py Show resolved Hide resolved
tests/pravega_client_test.py Outdated Show resolved Hide resolved
src/stream_manager.rs Outdated Show resolved Hide resolved
src/stream_manager.rs Outdated Show resolved Hide resolved
src/stream_manager.rs Outdated Show resolved Hide resolved
Ok(scoped_stream) => {
stream_vector_act.push(scoped_stream.stream.name)
},
Err(e) => {
Copy link
Member

Choose a reason for hiding this comment

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

Same here.
It may be useful to have a private method so as to not duplicate so much

Copy link
Contributor

@Bhupender-Y Bhupender-Y left a comment

Choose a reason for hiding this comment

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

LGTM.

Signed-off-by: anju_das <[email protected]>
Copy link
Contributor

@ShwethaSNayak ShwethaSNayak left a comment

Choose a reason for hiding this comment

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

LGTM

@ShwethaSNayak ShwethaSNayak merged commit 3a825a5 into pravega:master Feb 6, 2024
2 checks passed
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.

Add new API for list scope and list stream for python client
5 participants