GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(gax): add RewindableStreamBuffer in prep for chunk upload recovery by whowes · Pull Request #14423 · googleapis/google-cloud-java Conversation
|
| public abstract byte[] getPayload(); | ||
|
|
||
| /** The number of bytes within {@link #getPayload()} to upload. */ | ||
| public abstract int getPayloadLength(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do we have to expose getPayloadLength in the request? I think we can do the slicing in RewindableStreamBuffer and getPayload should always return the byte[] that we can upload directly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This works - done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * offset or beyond the current buffer window | ||
| * @throws IOException if reading from the stream fails | ||
| */ | ||
| void realignTo(long committedOffset) throws IOException { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is this method used in this PR?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No, it's used in recovery (not implemented until #14424). This PR just introduces the buffer and wires it up.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
074e557 to
c69d6b1
Compare
c69d6b1 to
7431c49
Compare
7431c49 to
1ba5e07
Compare
95a562e to
4c0fd44
Compare
| * @throws IOException if reading from the stream fails | ||
| */ | ||
| void fill(long targetOffset) throws IOException { | ||
| this.bufferBaseOffset = targetOffset; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks like this offset is always calculated from the info within the buffer and passed into here in follow up PR. I think we can get rid of this parameter and let RewindableStreamBuffer manage the targetOffset.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Introduce RewindableStreamBuffer managing a single-chunk buffer over an InputStream, supporting forward compaction and topping up upon recovery realignment without mark()/reset(). Enforces boundaries by throwing IllegalStateException when a server offset is below the base offset or beyond the current buffer window.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.