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

An async writable channel implementation that can send the bytes to multiple Readable channels #2898

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

Arun-LinkedIn
Copy link
Contributor

@Arun-LinkedIn Arun-LinkedIn commented Sep 20, 2024

This can be used to write uploaded bytes to multiple readers. This is inspired from POC by @justinlin-linkedin here - #2890!

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 72.93233% with 36 lines in your changes missing coverage. Please review.

Project coverage is 67.35%. Comparing base (52ba813) to head (6642c1f).
Report is 105 commits behind head on master.

Files with missing lines Patch % Lines
...ithub/ambry/commons/PipedAsyncWritableChannel.java 72.93% 19 Missing and 17 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2898      +/-   ##
============================================
+ Coverage     64.24%   67.35%   +3.11%     
- Complexity    10398    11441    +1043     
============================================
  Files           840      863      +23     
  Lines         71755    73289    +1534     
  Branches       8611     8815     +204     
============================================
+ Hits          46099    49364    +3265     
+ Misses        23004    21297    -1707     
+ Partials       2652     2628      -24     

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

Comment on lines +299 to +301
if (exception == null) {
totalBytesRead.getAndAdd(result);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

only need to add once for primary.

Copy link
Contributor Author

@Arun-LinkedIn Arun-LinkedIn Sep 24, 2024

Choose a reason for hiding this comment

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

I was wondering if totalBytesRead for primary and secondary may not match in case we close secondary early. Due to that, I was thinking to increment it for both. What do you say?

Copy link
Contributor

@SophieGuo410 SophieGuo410 left a comment

Choose a reason for hiding this comment

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

Overall lgtm! Left some minor comments.

Copy link
Collaborator

@justinlin-linkedin justinlin-linkedin left a comment

Choose a reason for hiding this comment

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

LGTM.

@Arun-LinkedIn Arun-LinkedIn merged commit c39ab49 into linkedin:master Sep 25, 2024
5 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.

4 participants