Uh oh!
There was an error while loading. Please reload this page.
Add restartableInputStream, first commit - #2682
Conversation
garrettjonesgoogle
commented
Dec 6, 2017
@vam-google , could you review this? |
vam-google
left a comment
There was a problem hiding this comment.
Please also address all the codacy-bot comments (unused imports & stuff).
| @@ -0,0 +1,48 @@ | |||
| /* | |||
| * Copyright 2015 Google Inc. All Rights Reserved. | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| throw new IOExpection(); | ||
| } | ||
| } | ||
| } No newline at end of file |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| import java.io.InputStream; | ||
| /** | ||
| * |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| */ | ||
| public class RestartableInputStream { | ||
| InputStream inputStream; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| this.inputStream.mark(Integer.MAX_VALUE); | ||
| } | ||
| catch (IOException e) { | ||
| throw new IOExpection(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| package com.google.cloud.storage; | ||
| import com.google.api.client.http.AbstractInputStreamContent; | ||
| import sun.nio.ch.IOUtil; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| public RestartableInputStream(InputStream inputStream) { | ||
| this.inputStream = inputStream; | ||
| this.inputStream.mark(Integer.MAX_VALUE); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| public void restart() { | ||
| try { | ||
| this.inputStream.reset(); | ||
| this.inputStream.mark(Integer.MAX_VALUE); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| @Override | ||
| public StorageObject create(StorageObject storageObject, final RestartableInputStream content, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| import java.io.InputStream; | ||
| import java.io.OutputStream; | ||
| public final class RetryableInputStreamContent extends AbstractInputStreamContent { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
garrettjonesgoogle
commented
Dec 21, 2017
@hzyi-google could you address @vam-google 's comments? |
yihanzhen
commented
Dec 21, 2017
A lot of changes need to be made for this, so abandoning. With submit a different PR when finished. |
🤖 I have created a release *beep* *boop* --- <details><summary>2.40.0</summary> ## [2.40.0](googleapis/sdk-platform-java@v2.39.0...v2.40.0) (2024-05-02) ### Features * [common-protos] add `Weight` to common types for Shopping APIs to be used for accounts bundle ([#2699](googleapis/sdk-platform-java#2699)) ([90a28ef](googleapis/sdk-platform-java@90a28ef)) * add a CLI tool to validate generation configuration ([#2691](googleapis/sdk-platform-java#2691)) ([f52f8cc](googleapis/sdk-platform-java@f52f8cc)) * Parser to consume the api-versioning value from proto ([#2630](googleapis/sdk-platform-java#2630)) ([c112b37](googleapis/sdk-platform-java@c112b37)) * Update Gapic generator and Gax to emit api-versioning via header ([#2671](googleapis/sdk-platform-java#2671)) ([cb5ada0](googleapis/sdk-platform-java@cb5ada0)) ### Bug Fixes * change folder prefix for adding headers ([#2688](googleapis/sdk-platform-java#2688)) ([ab5ba1d](googleapis/sdk-platform-java@ab5ba1d)) * Log HttpJson's async thread pool core size ([#2697](googleapis/sdk-platform-java#2697)) ([31038d1](googleapis/sdk-platform-java@31038d1)) * replace `cfg = "host"` with `cfg = "exec"` ([#2637](googleapis/sdk-platform-java#2637)) ([fd12e0f](googleapis/sdk-platform-java@fd12e0f)) * Return resolved endpoint from StubSettings' Builder ([#2715](googleapis/sdk-platform-java#2715)) ([6139a73](googleapis/sdk-platform-java@6139a73)) ### Dependencies * Make opentelemetry-api an optional dependency. ([#2681](googleapis/sdk-platform-java#2681)) ([2239c8c](googleapis/sdk-platform-java@2239c8c)) * update dependency absl-py to v2.1.0 ([#2659](googleapis/sdk-platform-java#2659)) ([b2b7738](googleapis/sdk-platform-java@b2b7738)) * update dependency gitpython to v3.1.43 ([#2656](googleapis/sdk-platform-java#2656)) ([6d273ad](googleapis/sdk-platform-java@6d273ad)) * update dependency lxml to v5.2.1 ([#2661](googleapis/sdk-platform-java#2661)) ([7a34168](googleapis/sdk-platform-java@7a34168)) * update dependency net.bytebuddy:byte-buddy to v1.14.14 ([#2703](googleapis/sdk-platform-java#2703)) ([72b0441](googleapis/sdk-platform-java@72b0441)) * update dependency typing to v3.10.0.0 ([#2663](googleapis/sdk-platform-java#2663)) ([4c64e98](googleapis/sdk-platform-java@4c64e98)) * update gapic-showcase to v0.33.0 ([#2653](googleapis/sdk-platform-java#2653)) ([5c12155](googleapis/sdk-platform-java@5c12155)) ### Documentation * Add contributing guidelines to PR and issue templates ([#2682](googleapis/sdk-platform-java#2682)) ([82f5ce8](googleapis/sdk-platform-java@82f5ce8)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
…v3.56.1 (#2682) Co-authored-by: Jin Seop Kim <jinseop@google.com>
…v3.56.1 (#2682) Co-authored-by: Jin Seop Kim <jinseop@google.com>
…s#2682) * textproxy: Allow testproxy to build its own proto registry Change-Id: Ie930064363d92d61daad498e8380dd87ab6722dd * testproxy: Remove manual dependency resolution from ResultSetSerializer We now require the clients to provide FileDescriptorSet with files in dependency order Change-Id: I240cfe8f4d499ba7053dfab1f119972de1810fce --------- Co-authored-by: Mattie Fu <mattiefu@google.com>
PTAL -
@garrettjonesgoogle Not finished yet, just to make sure the idea aligns with #2620