-
Notifications
You must be signed in to change notification settings - Fork 90
chore: refactor BlobReadChannel to plumb the sparse object metadata included in a read media response for both json and grpc #1845
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
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we set the exception on the result only if the result is not complete? What case is this covering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same answer as above
b0e0d26 to
0a4a6db
Compare
Publicly exposing this is gated on how/when we are able to expose StorageReadChannel.