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

Expose Reader streamcut to read from given Stream Cut #22

Merged
merged 5 commits into from
Feb 24, 2024

Conversation

ShwethaSNayak
Copy link
Contributor

@ShwethaSNayak ShwethaSNayak commented Feb 19, 2024

Change log description
If Client application crashes and if user wants to continue read from the stream where it left off, currently, there is no method to obtain StreamCuts from the ReaderGroup.
StreamCuts are set of segment/offset pairs for a single stream that represent a consistent position in the stream.

Purpose of the change
Closes #23

What the code does
Exposed get_streamcut() API to return the Stream cut object.

How to verify it
All the testcase should pass

#[cfg(feature = "python_binding")]
#[pyclass]
#[derive(Clone)]
pub(crate) struct ReaderStreamCut {
Copy link
Member

Choose a reason for hiding this comment

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

This is a confusing name. StreamCuts are for the whole stream and not specific to a reader. We can call this StreamCut and alias the StreamCut that is being imported to something else

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if count == 2 :
break
self.assertEqual(count, 2, "Two events are expected")
time.sleep(3)
Copy link
Member

Choose a reason for hiding this comment

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

We should not depend on time, especially not in a hard coded way like this. Maybe we could have a #[cfg(test)] method which forces the update

Signed-off-by: Shwetha N <[email protected]>
Signed-off-by: Shwetha N <[email protected]>
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

Attention: Patch coverage is 23.91304% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 83.50%. Comparing base (f0446dd) to head (0fbf14a).
Report is 1 commits behind head on master.

Files Patch % Lines
src/stream_reader_group.rs 8.00% 23 Missing ⚠️
src/stream_manager.rs 42.10% 11 Missing ⚠️
src/stream_reader.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   86.02%   83.50%   -2.52%     
==========================================
  Files           8        8              
  Lines         880      970      +90     
==========================================
+ Hits          757      810      +53     
- Misses        123      160      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tkaitchuck tkaitchuck merged commit 14a02ff into pravega:master Feb 24, 2024
2 of 4 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.

Expose StreamCut API to start reading from certain position in stream
2 participants