feat(storage): Handle large read ranges in bidi read. by bajajneha27 · Pull Request #15152 · googleapis/google-cloud-cpp · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

feat(storage): Handle large read ranges in bidi read. #15152

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bajajneha27
Copy link
Contributor

@bajajneha27 bajajneha27 commented May 20, 2025

This change is Reviewable

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label May 20, 2025
@@ -77,7 +79,9 @@ class ObjectDescriptorImpl
return CopyActiveRanges(std::unique_lock<std::mutex>(mu_));
}

auto CurrentStream(std::unique_lock<std::mutex>) const { return stream_; }
auto CurrentStream(std::unique_lock<std::mutex>) const {
return streams_[active_stream_];
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this is always streams_.back(), and therefore that active_stream_ is redundant.

@@ -105,6 +109,8 @@ class ObjectDescriptorImpl

std::unordered_map<std::int64_t, std::shared_ptr<ReadRange>> active_ranges_;
Options options_;
std::vector<std::shared_ptr<OpenStream>> streams_ = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Is stream_ (line 104) dead now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it is. Removed it now.

@@ -200,7 +224,7 @@ void ObjectDescriptorImpl::Resume(google::rpc::Status const& proto_status) {
void ObjectDescriptorImpl::OnResume(StatusOr<OpenStreamResult> result) {
if (!result) return OnFinish(std::move(result).status());
std::unique_lock<std::mutex> lk(mu_);
stream_ = std::move(result->stream);
streams_[0] = std::move(result->stream);
Copy link
Contributor

Choose a reason for hiding this comment

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

I know nothing about this code, but it looks a little weird that this isn't assigning the "active stream".

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 for reviewing the PR @devbww
I was trying this code as a POC and yes you're right, I should update the active_stream_ here.
This is still WIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.