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 256: Enable stream tag API on the RUST client. #270

Merged
merged 13 commits into from
Jun 28, 2021
Merged

Conversation

shrids
Copy link
Contributor

@shrids shrids commented Jun 1, 2021

Change log description

  • Enable Stream Tag API on the RUST client.

Purpose of the change
Fixes #256

What the code does

  • Update the Controller proto file with the latest version of the Controller.
  • Enable Tag related APIs on the RUST client.
    The following APIs have been enabled.
    /**
     * API to fetch the Stream Configuration of a Stream.
     */
    async fn get_stream_configuration(&self, stream: &ScopedStream) -> ResultRetry<StreamConfiguration>;

    /**
     * API to fetch the Tags for a Stream.
     */
    async fn get_stream_tags(&self, stream: &ScopedStream) -> ResultRetry<Option<Vec<String>>>;

    /**
     * API to list streams associated with the given tag under a given scope and continuation token.
     * Use the pravega_controller_client::paginator::list_streams_for_tag to paginate over all the streams.
     */
    async fn list_streams_for_tag(
        &self,
        scope: &Scope,
        tag: &str,
        token: &CToken,
    ) -> ResultRetry<Option<(Vec<ScopedStream>, CToken)>>;
  • Enable CLI option to create Stream with tags and list streams with a tag under a given scope.
osboxes@osboxes:~$ ./controller-cli list-streams-for-tag --help
controller-cli-list-streams-for-tag 0.2.0
List Streams for a tag, under a scope

USAGE:
    controller-cli list-streams-for-tag <scope-name> <tag>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <scope-name>    Scope Name
    <tag>           Tag Name

How to verify it
All the existing and newly added tests should pass.
Integration tests have been created to run against the latest version of Pravega.

Signed-off-by: Sandeep <[email protected]>
Signed-off-by: Sandeep <[email protected]>
@shrids shrids marked this pull request as ready for review June 22, 2021 12:40
@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2021

Codecov Report

Merging #270 (4bc7ea6) into master (530b080) will increase coverage by 2.74%.
The diff coverage is 2.94%.

@@            Coverage Diff             @@
##           master     #270      +/-   ##
==========================================
+ Coverage   73.83%   76.58%   +2.74%     
==========================================
  Files          44       44              
  Lines       10450    11066     +616     
==========================================
+ Hits         7716     8475     +759     
+ Misses       2734     2591     -143     
Impacted Files Coverage Δ
controller-client/src/mock_controller.rs 40.17% <0.00%> (-4.82%) ⬇️
controller-client/src/lib.rs 57.00% <0.59%> (+49.05%) ⬆️
controller-client/src/model_helper.rs 55.03% <5.88%> (+48.67%) ⬆️
shared/src/lib.rs 80.98% <100.00%> (+4.79%) ⬆️
src/segment/selector.rs 82.87% <100.00%> (+0.11%) ⬆️
src/util/mod.rs 96.96% <100.00%> (+0.09%) ⬆️
src/lib.rs 88.60% <0.00%> (ø)
src/segment/reader.rs 68.78% <0.00%> (ø)
retry/src/retry_result.rs 85.71% <0.00%> (+7.14%) ⬆️
... and 2 more

@shrids
Copy link
Contributor Author

shrids commented Jun 23, 2021

@tkaitchuck @Tristan1900 The Pravega PR for Stream tags has been merged. Could you review this changeset ?

///
/// The below snippets show case the example uses.
/// Sample 1:
///```ignore
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be no_run. Or maybe this trick because we still want to know if it doesn't compile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, I have improved the snippet to enable compilation check.

controller-client/src/paginator.rs Outdated Show resolved Hide resolved
@Tristan1900 Tristan1900 merged commit 1d73528 into master Jun 28, 2021
@Tristan1900 Tristan1900 deleted the stream-tag branch June 28, 2021 16:13
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.

Enable Stream tag APIs on the RUST client.
4 participants