chore: refactor BlobReadChannel to plumb the sparse object metadata included in a read media response for both json and grpc#1845
Merged
BenWhitehead merged 2 commits intomainfrom Jan 20, 2023
Conversation
1c9d74d to
6eddc2c
Compare
…ncluded in a read media response for both json and grpc Publicly exposing this is gated on how/when we are able to expose StorageReadChannel.
6eddc2c to
b9a2fd2
Compare
| if (xGoogGenHeader != null) { | ||
| StorageObject clone = apiaryReadRequest.getObject().clone(); | ||
| ifNonNull(xGoogGenHeader, Long::valueOf, clone::setGeneration); | ||
| ifNonNull(xGoogGenHeader, Long::valueOf, g -> this.xGoogGeneration = g); |
Contributor
There was a problem hiding this comment.
you mentioned yesterday you were going to add a comment for this line
| return ensureResponseIteratorOpen().hasNext(); | ||
| } catch (RuntimeException e) { | ||
| if (!result.isDone()) { | ||
| result.setException(StorageException.coalesce(e)); |
Contributor
There was a problem hiding this comment.
why do we set the exception on the result only if the result is not complete? What case is this covering?
Collaborator
Author
There was a problem hiding this comment.
A call to hasNext()/next() could error any time. More often than not, as long as the object exists, this code will not run, but when the object doesn't exist this ensures we communicate that to the result as well as any call to read
| return ensureResponseIteratorOpen().next(); | ||
| } catch (RuntimeException e) { | ||
| if (!result.isDone()) { | ||
| result.setException(StorageException.coalesce(e)); |
Contributor
There was a problem hiding this comment.
same question as above.
Collaborator
Author
There was a problem hiding this comment.
same answer as above
b0e0d26 to
0a4a6db
Compare
sydney-munro
approved these changes
Jan 20, 2023
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.
Publicly exposing this is gated on how/when we are able to expose StorageReadChannel.