chore: refactor GrpcStorageImpl#read* methods to use more specific channels#1474
Merged
BenWhitehead merged 2 commits intofeat/grpc-storagefrom Jun 28, 2022
Merged
chore: refactor GrpcStorageImpl#read* methods to use more specific channels#1474BenWhitehead merged 2 commits intofeat/grpc-storagefrom
BenWhitehead merged 2 commits intofeat/grpc-storagefrom
Conversation
…annels Update readAllBytes and downloadTo methods to use unbuffered read channel, instead of reader Update *ReadableByteChannelSessions to take a ReadObjectRequest instead of Object Update Hasher#validate to be lazy with regard to the ByteBuffer, this ensures no new byte buffer is created if it isn't needed in the case of noop. Add StorageArbitraries.Objects#name() Move StorageArbitraries.bucketName() -> StorageArbitraries.Buckets#name() Add StorageArbitraries.alnum() and cleanup usages in Buckets.name()
frankyn
reviewed
Jun 27, 2022
google-cloud-storage/src/main/java/com/google/cloud/storage/StorageV2ProtoUtils.java
Show resolved
Hide resolved
| String userProject = (String) optionsMap.get(StorageRpc.Option.USER_PROJECT); | ||
| if (userProject != null) { | ||
| // TODO: user project | ||
| // ReadObjectRequest does not have a user_project field |
Contributor
There was a problem hiding this comment.
IIUC, we need to use gRPC Metadata for this now per cl/448634966
I see: https://g3doc.corp.google.com/net/grpc/g3doc/java/life_of_a_stream_java.md?cl=head#clientinterceptor
Looks like we need to use a client side interceptor but couldn't figure out where to attach it. Maybe you'll have better luck.
Collaborator
Author
There was a problem hiding this comment.
I've added an item to the tracker to implement this in a separate PR
|
|
||
| final Map<StorageRpc.Option, ?> optionsMap = StorageImpl.optionMap(options); | ||
|
|
||
| // TODO: handle StorageRpc.Option.RETURN_RAW_INPUT_STREAM impacts |
Contributor
There was a problem hiding this comment.
gRPC will always provide compressed data; maybe we can decompress data for the user to match up with the existing JSON API experience
Collaborator
Author
There was a problem hiding this comment.
I've added an item to the tracker to implement this in a separate PR
frankyn
approved these changes
Jun 28, 2022
gcf-owl-bot bot
added a commit
that referenced
this pull request
Jun 29, 2022
Source-Link: googleapis/synthtool@7a220e2 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Jun 30, 2022
Source-Link: googleapis/synthtool@7a220e2 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update readAllBytes and downloadTo methods to use unbuffered read channel, instead of reader
Update *ReadableByteChannelSessions to take a ReadObjectRequest instead of Object
Update Hasher#validate to be lazy with regard to the ByteBuffer, this ensures no new byte buffer is created if it isn't needed in the case of noop.
Add StorageArbitraries.Objects#name()
Move StorageArbitraries.bucketName() -> StorageArbitraries.Buckets#name()
Add StorageArbitraries.alnum() and cleanup usages in Buckets.name()