diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 763cb2b16c..0338a59b9e 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "0ceff8ac3db27c98da38ea2b431d41cbc1856941" + "sha": "8ae01e9c8514b4e32a326b31033fc1925c678ebf" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "16ec872dd898d7de6e1822badfac32484b5d9031" + "sha": "4679e7e415221f03ff2a71e3ffad75b9ec41d87e" } } ] diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 2b6cdbc976..7c8816a7d7 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -4,7 +4,7 @@ name: auto-release jobs: approve: runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-v') + if: contains(github.head_ref, 'release-please') steps: - uses: actions/github-script@v3 with: @@ -16,8 +16,8 @@ jobs: return; } - // only approve PRs like "chore: release " - if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + // only approve PRs like "chore(master): release " + if ( !context.payload.pull_request.title.startsWith("chore(master): release") ) { return; } diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6830220756..def8b3a2c8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,7 +54,11 @@ jobs: with: java-version: 8 - run: java -version - - run: .kokoro/linkage-monitor.sh + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor lint: runs-on: ubuntu-latest steps: diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 6748cfe34f..238abf9950 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -115,8 +115,8 @@ bash .kokoro/coerce_logs.sh if [[ "${ENABLE_BUILD_COP}" == "true" ]] then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop - ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-bigquerystorage + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-bigquerystorage fi echo "exiting with ${RETURN_CODE}" diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh deleted file mode 100755 index 759ab4e2c2..0000000000 --- a/.kokoro/linkage-monitor.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail -# Display commands being run. -set -x - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java version -java -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true - -# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR -JAR=linkage-monitor-latest-all-deps.jar -curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" - -# Fails if there's new linkage errors compared with baseline -java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index 61428ab36b..9342d04754 100644 --- a/.kokoro/release/publish_javadoc.cfg +++ b/.kokoro/release/publish_javadoc.cfg @@ -7,10 +7,10 @@ env_vars: { value: "docs-staging" } +# cloud-rad staging env_vars: { key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" - # Production will be at: docs-staging-v2 + value: "docs-staging-v2-staging" } env_vars: { @@ -26,4 +26,4 @@ before_action { keyname: "docuploader_service_account" } } -} +} \ No newline at end of file diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index 75231842ed..df7a85ee32 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -71,7 +71,7 @@ python3 -m docuploader create-metadata \ --version ${VERSION} \ --language java -# upload docs +# upload docs to staging bucket python3 -m docuploader upload . \ --credentials ${CREDENTIALS} \ --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 0000000000..edee101b4f --- /dev/null +++ b/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigquerystorage/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 0000000000..c8bbddc75c --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-bigquerystorage +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx- diff --git a/CHANGELOG.md b/CHANGELOG.md index 39647cc126..5f2cc95d43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [1.9.0](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.8.5...v1.9.0) (2021-02-17) + + +### Features + +* generate sample code in the Java microgenerator ([#821](https://www.github.com/googleapis/java-bigquerystorage/issues/821)) ([3ab9a30](https://www.github.com/googleapis/java-bigquerystorage/commit/3ab9a309441a681e8adec88f8b8af1298a89cd74)) + + +### Bug Fixes + +* add dataflow trace id support ([#827](https://www.github.com/googleapis/java-bigquerystorage/issues/827)) ([8d22c58](https://www.github.com/googleapis/java-bigquerystorage/commit/8d22c586ed8a265558b84619297f5bd5b5ec4cb4)) +* shutdown stuck when there is error on the flush path ([#831](https://www.github.com/googleapis/java-bigquerystorage/issues/831)) ([c2fd750](https://www.github.com/googleapis/java-bigquerystorage/commit/c2fd750e1309fb7b6eb862dea1ad8546dcd78bef)) +* update repo name ([#818](https://www.github.com/googleapis/java-bigquerystorage/issues/818)) ([ba4b1a2](https://www.github.com/googleapis/java-bigquerystorage/commit/ba4b1a2d8eaa8f5408e476a3b570cb508aa94f57)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigquery to v1.127.0 ([#825](https://www.github.com/googleapis/java-bigquerystorage/issues/825)) ([36322fb](https://www.github.com/googleapis/java-bigquerystorage/commit/36322fb1f3d3d286cf8fc6b66f5aa1b97e754d72)) +* update dependency com.google.cloud:google-cloud-bigquery to v1.127.1 ([#828](https://www.github.com/googleapis/java-bigquerystorage/issues/828)) ([c24a6ae](https://www.github.com/googleapis/java-bigquerystorage/commit/c24a6ae3d5a091b5276036d1d7f01e2777bbfd82)) +* update dependency com.google.cloud:google-cloud-bigquery to v1.127.2 ([#830](https://www.github.com/googleapis/java-bigquerystorage/issues/830)) ([94c7848](https://www.github.com/googleapis/java-bigquerystorage/commit/94c78485baa383cd41ee7001206d5bc19f7746bf)) +* update dependency junit:junit to v4.13.2 ([#829](https://www.github.com/googleapis/java-bigquerystorage/issues/829)) ([c2e429a](https://www.github.com/googleapis/java-bigquerystorage/commit/c2e429a591131cd2c89982c746f860a8fd0c7aef)) + ### [1.8.5](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.8.4...v1.8.5) (2021-01-17) diff --git a/LICENSE b/LICENSE index d645695673..261eeb9e9f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index 4bd2ede5dc..2599c3983e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 16.3.0 + 16.4.0 pom import @@ -38,25 +38,25 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquerystorage - 1.8.4 + 1.8.5 ``` If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:16.3.0') +implementation platform('com.google.cloud:libraries-bom:16.4.0') compile 'com.google.cloud:google-cloud-bigquerystorage' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquerystorage:1.8.4' +compile 'com.google.cloud:google-cloud-bigquerystorage:1.8.5' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.8.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "1.8.5" ``` ## Authentication diff --git a/google-cloud-bigquerystorage-bom/pom.xml b/google-cloud-bigquerystorage-bom/pom.xml index 46c9c35614..8b3438b457 100644 --- a/google-cloud-bigquerystorage-bom/pom.xml +++ b/google-cloud-bigquerystorage-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage-bom - 1.8.5 + 1.9.0 pom com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 Google Cloud bigquerystorage BOM @@ -42,11 +42,11 @@ sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots + https://google.oss.sonatype.org/content/repositories/snapshots sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + https://google.oss.sonatype.org/service/local/staging/deploy/maven2/ @@ -63,48 +63,48 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.108.5 + 0.109.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.108.5 + 0.109.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.108.5 + 0.109.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.8.5 + 1.9.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.108.5 + 0.109.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.108.5 + 0.109.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.108.5 + 0.109.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.8.5 + 1.9.0 com.google.cloud google-cloud-bigquerystorage - 1.8.5 + 1.9.0 diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index 2cd9bc4966..edf42984f1 100644 --- a/google-cloud-bigquerystorage/pom.xml +++ b/google-cloud-bigquerystorage/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage - 1.8.5 + 1.9.0 jar BigQuery Storage https://github.com/googleapis/java-bigquerystorage @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 google-cloud-bigquerystorage diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClient.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClient.java index f4ec3cfd1c..d34aaf2a27 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClient.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClient.java @@ -35,6 +35,16 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   ReadSession readSession = ReadSession.newBuilder().build();
+ *   int maxStreamCount = 940837515;
+ *   ReadSession response =
+ *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+ * }
+ * }
+ * *

Note: close() needs to be called on the BaseBigQueryReadClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -156,6 +166,18 @@ public BigQueryReadStub getStub() { *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ReadSession readSession = ReadSession.newBuilder().build();
+   *   int maxStreamCount = 940837515;
+   *   ReadSession response =
+   *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+   * }
+   * }
+ * * @param parent Required. The request project that owns the session, in the form of * `projects/{project_id}`. * @param readSession Required. Session to be created. @@ -197,6 +219,18 @@ public final ReadSession createReadSession( *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   ReadSession readSession = ReadSession.newBuilder().build();
+   *   int maxStreamCount = 940837515;
+   *   ReadSession response =
+   *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+   * }
+   * }
+ * * @param parent Required. The request project that owns the session, in the form of * `projects/{project_id}`. * @param readSession Required. Session to be created. @@ -238,6 +272,20 @@ public final ReadSession createReadSession( *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   CreateReadSessionRequest request =
+   *       CreateReadSessionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setReadSession(ReadSession.newBuilder().build())
+   *           .setMaxStreamCount(940837515)
+   *           .build();
+   *   ReadSession response = baseBigQueryReadClient.createReadSession(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -265,6 +313,21 @@ public final ReadSession createReadSession(CreateReadSessionRequest request) { * clean-up by the caller. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   CreateReadSessionRequest request =
+   *       CreateReadSessionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setReadSession(ReadSession.newBuilder().build())
+   *           .setMaxStreamCount(940837515)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigQueryReadClient.createReadSessionCallable().futureCall(request);
+   *   // Do something.
+   *   ReadSession response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createReadSessionCallable() { return stub.createReadSessionCallable(); @@ -280,6 +343,22 @@ public final UnaryCallable createReadSess * stream. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   ReadRowsRequest request =
+   *       ReadRowsRequest.newBuilder()
+   *           .setReadStream(
+   *               ReadStreamName.of("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]").toString())
+   *           .setOffset(-1019779949)
+   *           .build();
+   *   ServerStream stream =
+   *       baseBigQueryReadClient.readRowsCallable().call(request);
+   *   for (ReadRowsResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
*/ public final ServerStreamingCallable readRowsCallable() { return stub.readRowsCallable(); @@ -298,6 +377,20 @@ public final ServerStreamingCallable readRows * original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read * to completion. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   SplitReadStreamRequest request =
+   *       SplitReadStreamRequest.newBuilder()
+   *           .setName(
+   *               ReadStreamName.of("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]").toString())
+   *           .setFraction(-1653751294)
+   *           .build();
+   *   SplitReadStreamResponse response = baseBigQueryReadClient.splitReadStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -319,6 +412,21 @@ public final SplitReadStreamResponse splitReadStream(SplitReadStreamRequest requ * to completion. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   SplitReadStreamRequest request =
+   *       SplitReadStreamRequest.newBuilder()
+   *           .setName(
+   *               ReadStreamName.of("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]").toString())
+   *           .setFraction(-1653751294)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigQueryReadClient.splitReadStreamCallable().futureCall(request);
+   *   // Do something.
+   *   SplitReadStreamResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable splitReadStreamCallable() { diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/package-info.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/package-info.java index 6530a3c320..b641a52330 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/package-info.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/package-info.java @@ -24,6 +24,16 @@ *

The Read API can be used to read data from BigQuery. * *

Sample for BaseBigQueryReadClient: + * + *

{@code
+ * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   ReadSession readSession = ReadSession.newBuilder().build();
+ *   int maxStreamCount = 940837515;
+ *   ReadSession response =
+ *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.bigquery.storage.v1; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java index f33cd79ea0..8304ae5cee 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java @@ -66,18 +66,18 @@ *

For example, to set the total timeout of createReadSession to 30 seconds: * *

{@code
- * BigQueryReadStubSettings.Builder bigQueryReadSettingsBuilder =
+ * BigQueryReadStubSettings.Builder baseBigQueryReadSettingsBuilder =
  *     BigQueryReadStubSettings.newBuilder();
- * bigQueryReadSettingsBuilder
+ * baseBigQueryReadSettingsBuilder
  *     .createReadSessionSettings()
  *     .setRetrySettings(
- *         bigQueryReadSettingsBuilder
+ *         baseBigQueryReadSettingsBuilder
  *             .createReadSessionSettings()
  *             .getRetrySettings()
  *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * BigQueryReadStubSettings bigQueryReadSettings = bigQueryReadSettingsBuilder.build();
+ * BigQueryReadStubSettings baseBigQueryReadSettings = baseBigQueryReadSettingsBuilder.build();
  * }
*/ @Generated("by gapic-generator-java") diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java index 2b2b70d216..302a43dd74 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java @@ -186,14 +186,17 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createReadSessionCallable() { return createReadSessionCallable; } + @Override public ServerStreamingCallable readRowsCallable() { return readRowsCallable; } + @Override public UnaryCallable splitReadStreamCallable() { return splitReadStreamCallable; } diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/BigQueryWriteClient.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/BigQueryWriteClient.java index f5e2114ade..85b829740b 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/BigQueryWriteClient.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/BigQueryWriteClient.java @@ -35,6 +35,14 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+ *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+ *   Stream.WriteStream writeStream = Stream.WriteStream.newBuilder().build();
+ *   Stream.WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+ * }
+ * }
+ * *

Note: close() needs to be called on the BigQueryWriteClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -139,6 +147,16 @@ public BigQueryWriteStub getStub() { /** * Creates a write stream to the given table. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+   *   Stream.WriteStream writeStream = Stream.WriteStream.newBuilder().build();
+   *   Stream.WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+   * }
+   * }
+ * * @param parent Required. Reference to the table to which the stream belongs, in the format of * `projects/{project}/datasets/{dataset}/tables/{table}`. * @param writeStream Required. Stream to be created. @@ -158,6 +176,16 @@ public final Stream.WriteStream createWriteStream( /** * Creates a write stream to the given table. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString();
+   *   Stream.WriteStream writeStream = Stream.WriteStream.newBuilder().build();
+   *   Stream.WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+   * }
+   * }
+ * * @param parent Required. Reference to the table to which the stream belongs, in the format of * `projects/{project}/datasets/{dataset}/tables/{table}`. * @param writeStream Required. Stream to be created. @@ -176,6 +204,18 @@ public final Stream.WriteStream createWriteStream(String parent, Stream.WriteStr /** * Creates a write stream to the given table. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.CreateWriteStreamRequest request =
+   *       Storage.CreateWriteStreamRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
+   *           .build();
+   *   Stream.WriteStream response = bigQueryWriteClient.createWriteStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -188,6 +228,19 @@ public final Stream.WriteStream createWriteStream(Storage.CreateWriteStreamReque * Creates a write stream to the given table. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.CreateWriteStreamRequest request =
+   *       Storage.CreateWriteStreamRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.createWriteStreamCallable().futureCall(request);
+   *   // Do something.
+   *   Stream.WriteStream response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createWriteStreamCallable() { @@ -214,6 +267,24 @@ public final Stream.WriteStream createWriteStream(Storage.CreateWriteStreamReque * the stream is committed. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   BidiStream bidiStream =
+   *       bigQueryWriteClient.appendRowsCallable().call();
+   *   Storage.AppendRowsRequest request =
+   *       Storage.AppendRowsRequest.newBuilder()
+   *           .setWriteStream(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setOffset(Int64Value.newBuilder().build())
+   *           .setIgnoreUnknownFields(true)
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (Storage.AppendRowsResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
*/ public final BidiStreamingCallable appendRowsCallable() { @@ -224,6 +295,15 @@ public final Stream.WriteStream createWriteStream(Storage.CreateWriteStreamReque /** * Gets a write stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
+   *   Stream.WriteStream response = bigQueryWriteClient.getWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to get, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -240,6 +320,15 @@ public final Stream.WriteStream getWriteStream(WriteStreamName name) { /** * Gets a write stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
+   *   Stream.WriteStream response = bigQueryWriteClient.getWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to get, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -254,6 +343,19 @@ public final Stream.WriteStream getWriteStream(String name) { /** * Gets a write stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.GetWriteStreamRequest request =
+   *       Storage.GetWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   Stream.WriteStream response = bigQueryWriteClient.getWriteStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -266,6 +368,20 @@ public final Stream.WriteStream getWriteStream(Storage.GetWriteStreamRequest req * Gets a write stream. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.GetWriteStreamRequest request =
+   *       Storage.GetWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.getWriteStreamCallable().futureCall(request);
+   *   // Do something.
+   *   Stream.WriteStream response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getWriteStreamCallable() { @@ -276,6 +392,15 @@ public final Stream.WriteStream getWriteStream(Storage.GetWriteStreamRequest req /** * Finalize a write stream so that no new data can be appended to the stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
+   *   Storage.FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to finalize, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -292,6 +417,15 @@ public final Storage.FinalizeWriteStreamResponse finalizeWriteStream(WriteStream /** * Finalize a write stream so that no new data can be appended to the stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
+   *   Storage.FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to finalize, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -306,6 +440,20 @@ public final Storage.FinalizeWriteStreamResponse finalizeWriteStream(String name /** * Finalize a write stream so that no new data can be appended to the stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.FinalizeWriteStreamRequest request =
+   *       Storage.FinalizeWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   Storage.FinalizeWriteStreamResponse response =
+   *       bigQueryWriteClient.finalizeWriteStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -319,6 +467,20 @@ public final Storage.FinalizeWriteStreamResponse finalizeWriteStream( * Finalize a write stream so that no new data can be appended to the stream. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.FinalizeWriteStreamRequest request =
+   *       Storage.FinalizeWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.finalizeWriteStreamCallable().futureCall(request);
+   *   // Do something.
+   *   Storage.FinalizeWriteStreamResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< Storage.FinalizeWriteStreamRequest, Storage.FinalizeWriteStreamResponse> @@ -332,6 +494,16 @@ public final Storage.FinalizeWriteStreamResponse finalizeWriteStream( * must be finalized before commit and cannot be committed multiple times. Once a stream is * committed, data in the stream becomes available for read operations. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+   *   Storage.BatchCommitWriteStreamsResponse response =
+   *       bigQueryWriteClient.batchCommitWriteStreams(parent);
+   * }
+   * }
+ * * @param parent Required. Parent table that all the streams should belong to, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -350,6 +522,16 @@ public final Storage.BatchCommitWriteStreamsResponse batchCommitWriteStreams(Tab * must be finalized before commit and cannot be committed multiple times. Once a stream is * committed, data in the stream becomes available for read operations. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString();
+   *   Storage.BatchCommitWriteStreamsResponse response =
+   *       bigQueryWriteClient.batchCommitWriteStreams(parent);
+   * }
+   * }
+ * * @param parent Required. Parent table that all the streams should belong to, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -366,6 +548,20 @@ public final Storage.BatchCommitWriteStreamsResponse batchCommitWriteStreams(Str * must be finalized before commit and cannot be committed multiple times. Once a stream is * committed, data in the stream becomes available for read operations. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.BatchCommitWriteStreamsRequest request =
+   *       Storage.BatchCommitWriteStreamsRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
+   *           .addAllWriteStreams(new ArrayList())
+   *           .build();
+   *   Storage.BatchCommitWriteStreamsResponse response =
+   *       bigQueryWriteClient.batchCommitWriteStreams(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -381,6 +577,20 @@ public final Storage.BatchCommitWriteStreamsResponse batchCommitWriteStreams( * committed, data in the stream becomes available for read operations. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.BatchCommitWriteStreamsRequest request =
+   *       Storage.BatchCommitWriteStreamsRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
+   *           .addAllWriteStreams(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.batchCommitWriteStreamsCallable().futureCall(request);
+   *   // Do something.
+   *   Storage.BatchCommitWriteStreamsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< Storage.BatchCommitWriteStreamsRequest, Storage.BatchCommitWriteStreamsResponse> @@ -395,6 +605,16 @@ public final Storage.BatchCommitWriteStreamsResponse batchCommitWriteStreams( * flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in * the request. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   WriteStreamName writeStream =
+   *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
+   *   Storage.FlushRowsResponse response = bigQueryWriteClient.flushRows(writeStream);
+   * }
+   * }
+ * * @param writeStream Required. The stream that is the target of the flush operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -413,6 +633,16 @@ public final Storage.FlushRowsResponse flushRows(WriteStreamName writeStream) { * flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in * the request. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String writeStream =
+   *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
+   *   Storage.FlushRowsResponse response = bigQueryWriteClient.flushRows(writeStream);
+   * }
+   * }
+ * * @param writeStream Required. The stream that is the target of the flush operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -429,6 +659,20 @@ public final Storage.FlushRowsResponse flushRows(String writeStream) { * flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in * the request. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.FlushRowsRequest request =
+   *       Storage.FlushRowsRequest.newBuilder()
+   *           .setWriteStream(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setOffset(-1019779949)
+   *           .build();
+   *   Storage.FlushRowsResponse response = bigQueryWriteClient.flushRows(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -444,6 +688,21 @@ public final Storage.FlushRowsResponse flushRows(Storage.FlushRowsRequest reques * the request. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   Storage.FlushRowsRequest request =
+   *       Storage.FlushRowsRequest.newBuilder()
+   *           .setWriteStream(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setOffset(-1019779949)
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.flushRowsCallable().futureCall(request);
+   *   // Do something.
+   *   Storage.FlushRowsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable flushRowsCallable() { diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/package-info.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/package-info.java index 561987d3b3..d551efac3d 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/package-info.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/package-info.java @@ -24,6 +24,14 @@ *

The Write API can be used to write data to BigQuery. * *

Sample for BigQueryWriteClient: + * + *

{@code
+ * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+ *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+ *   Stream.WriteStream writeStream = Stream.WriteStream.newBuilder().build();
+ *   Stream.WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.bigquery.storage.v1alpha2; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/stub/GrpcBigQueryWriteStub.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/stub/GrpcBigQueryWriteStub.java index 2319996a40..e1e42f1d84 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/stub/GrpcBigQueryWriteStub.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/stub/GrpcBigQueryWriteStub.java @@ -302,31 +302,37 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createWriteStreamCallable() { return createWriteStreamCallable; } + @Override public BidiStreamingCallable appendRowsCallable() { return appendRowsCallable; } + @Override public UnaryCallable getWriteStreamCallable() { return getWriteStreamCallable; } + @Override public UnaryCallable finalizeWriteStreamCallable() { return finalizeWriteStreamCallable; } + @Override public UnaryCallable< Storage.BatchCommitWriteStreamsRequest, Storage.BatchCommitWriteStreamsResponse> batchCommitWriteStreamsCallable() { return batchCommitWriteStreamsCallable; } + @Override public UnaryCallable flushRowsCallable() { return flushRowsCallable; } diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageClient.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageClient.java index 7409ee28ff..b2595cada9 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageClient.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageClient.java @@ -36,6 +36,17 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+ *   TableReferenceProto.TableReference tableReference =
+ *       TableReferenceProto.TableReference.newBuilder().build();
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   int requestedStreams = 1017221410;
+ *   Storage.ReadSession response =
+ *       baseBigQueryStorageClient.createReadSession(tableReference, parent, requestedStreams);
+ * }
+ * }
+ * *

Note: close() needs to be called on the BaseBigQueryStorageClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -152,6 +163,19 @@ public BigQueryStorageStub getStub() { *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   TableReferenceProto.TableReference tableReference =
+   *       TableReferenceProto.TableReference.newBuilder().build();
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   int requestedStreams = 1017221410;
+   *   Storage.ReadSession response =
+   *       baseBigQueryStorageClient.createReadSession(tableReference, parent, requestedStreams);
+   * }
+   * }
+ * * @param tableReference Required. Reference to the table to read. * @param parent Required. String of the form `projects/{project_id}` indicating the project this * ReadSession is associated with. This is the project that will be billed for usage. @@ -186,6 +210,19 @@ public final Storage.ReadSession createReadSession( *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   TableReferenceProto.TableReference tableReference =
+   *       TableReferenceProto.TableReference.newBuilder().build();
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   int requestedStreams = 1017221410;
+   *   Storage.ReadSession response =
+   *       baseBigQueryStorageClient.createReadSession(tableReference, parent, requestedStreams);
+   * }
+   * }
+ * * @param tableReference Required. Reference to the table to read. * @param parent Required. String of the form `projects/{project_id}` indicating the project this * ReadSession is associated with. This is the project that will be billed for usage. @@ -220,6 +257,19 @@ public final Storage.ReadSession createReadSession( *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.CreateReadSessionRequest request =
+   *       Storage.CreateReadSessionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setRequestedStreams(1017221410)
+   *           .build();
+   *   Storage.ReadSession response = baseBigQueryStorageClient.createReadSession(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -241,6 +291,20 @@ public final Storage.ReadSession createReadSession(Storage.CreateReadSessionRequ * clean-up by the caller. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.CreateReadSessionRequest request =
+   *       Storage.CreateReadSessionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setRequestedStreams(1017221410)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigQueryStorageClient.createReadSessionCallable().futureCall(request);
+   *   // Do something.
+   *   Storage.ReadSession response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createReadSessionCallable() { @@ -259,6 +323,17 @@ public final Storage.ReadSession createReadSession(Storage.CreateReadSessionRequ * data. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.ReadRowsRequest request = Storage.ReadRowsRequest.newBuilder().build();
+   *   ServerStream stream =
+   *       baseBigQueryStorageClient.readRowsCallable().call(request);
+   *   for (Storage.ReadRowsResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
*/ public final ServerStreamingCallable readRowsCallable() { @@ -270,6 +345,17 @@ public final Storage.ReadSession createReadSession(Storage.CreateReadSessionRequ * Creates additional streams for a ReadSession. This API can be used to dynamically adjust the * parallelism of a batch processing task upwards by adding additional workers. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.ReadSession session = Storage.ReadSession.newBuilder().build();
+   *   int requestedStreams = 1017221410;
+   *   Storage.BatchCreateReadSessionStreamsResponse response =
+   *       baseBigQueryStorageClient.batchCreateReadSessionStreams(session, requestedStreams);
+   * }
+   * }
+ * * @param session Required. Must be a non-expired session obtained from a call to * CreateReadSession. Only the name field needs to be set. * @param requestedStreams Required. Number of new streams requested. Must be positive. Number of @@ -291,6 +377,19 @@ public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessio * Creates additional streams for a ReadSession. This API can be used to dynamically adjust the * parallelism of a batch processing task upwards by adding additional workers. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.BatchCreateReadSessionStreamsRequest request =
+   *       Storage.BatchCreateReadSessionStreamsRequest.newBuilder()
+   *           .setRequestedStreams(1017221410)
+   *           .build();
+   *   Storage.BatchCreateReadSessionStreamsResponse response =
+   *       baseBigQueryStorageClient.batchCreateReadSessionStreams(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -305,6 +404,19 @@ public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessio * parallelism of a batch processing task upwards by adding additional workers. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.BatchCreateReadSessionStreamsRequest request =
+   *       Storage.BatchCreateReadSessionStreamsRequest.newBuilder()
+   *           .setRequestedStreams(1017221410)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigQueryStorageClient.batchCreateReadSessionStreamsCallable().futureCall(request);
+   *   // Do something.
+   *   Storage.BatchCreateReadSessionStreamsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< Storage.BatchCreateReadSessionStreamsRequest, @@ -327,6 +439,15 @@ public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessio *

This method will return an error if there are no other live streams in the Session, or if * SplitReadStream() has been called on the given Stream. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.Stream stream = Storage.Stream.newBuilder().build();
+   *   baseBigQueryStorageClient.finalizeStream(stream);
+   * }
+   * }
+ * * @param stream Required. Stream to finalize. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -350,6 +471,15 @@ public final void finalizeStream(Storage.Stream stream) { *

This method will return an error if there are no other live streams in the Session, or if * SplitReadStream() has been called on the given Stream. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.FinalizeStreamRequest request = Storage.FinalizeStreamRequest.newBuilder().build();
+   *   baseBigQueryStorageClient.finalizeStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -372,6 +502,16 @@ public final void finalizeStream(Storage.FinalizeStreamRequest request) { * SplitReadStream() has been called on the given Stream. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.FinalizeStreamRequest request = Storage.FinalizeStreamRequest.newBuilder().build();
+   *   ApiFuture future =
+   *       baseBigQueryStorageClient.finalizeStreamCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable finalizeStreamCallable() { return stub.finalizeStreamCallable(); @@ -391,6 +531,16 @@ public final UnaryCallable finalizeStreamC * *

This method is guaranteed to be idempotent. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.Stream originalStream = Storage.Stream.newBuilder().build();
+   *   Storage.SplitReadStreamResponse response =
+   *       baseBigQueryStorageClient.splitReadStream(originalStream);
+   * }
+   * }
+ * * @param originalStream Required. Stream to split. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -414,6 +564,16 @@ public final Storage.SplitReadStreamResponse splitReadStream(Storage.Stream orig * *

This method is guaranteed to be idempotent. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.SplitReadStreamRequest request =
+   *       Storage.SplitReadStreamRequest.newBuilder().setFraction(-1653751294).build();
+   *   Storage.SplitReadStreamResponse response = baseBigQueryStorageClient.splitReadStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -437,6 +597,17 @@ public final Storage.SplitReadStreamResponse splitReadStream( *

This method is guaranteed to be idempotent. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+   *   Storage.SplitReadStreamRequest request =
+   *       Storage.SplitReadStreamRequest.newBuilder().setFraction(-1653751294).build();
+   *   ApiFuture future =
+   *       baseBigQueryStorageClient.splitReadStreamCallable().futureCall(request);
+   *   // Do something.
+   *   Storage.SplitReadStreamResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable splitReadStreamCallable() { diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/package-info.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/package-info.java index 00d84fd6a9..fef267f88e 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/package-info.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/package-info.java @@ -24,6 +24,17 @@ *

The BigQuery storage API can be used to read data stored in BigQuery. * *

Sample for BaseBigQueryStorageClient: + * + *

{@code
+ * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
+ *   TableReferenceProto.TableReference tableReference =
+ *       TableReferenceProto.TableReference.newBuilder().build();
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   int requestedStreams = 1017221410;
+ *   Storage.ReadSession response =
+ *       baseBigQueryStorageClient.createReadSession(tableReference, parent, requestedStreams);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.bigquery.storage.v1beta1; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/BigQueryStorageStubSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/BigQueryStorageStubSettings.java index 5225c25b98..2fd2a9ffa6 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/BigQueryStorageStubSettings.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/BigQueryStorageStubSettings.java @@ -62,18 +62,19 @@ *

For example, to set the total timeout of createReadSession to 30 seconds: * *

{@code
- * BigQueryStorageStubSettings.Builder bigQueryStorageSettingsBuilder =
+ * BigQueryStorageStubSettings.Builder baseBigQueryStorageSettingsBuilder =
  *     BigQueryStorageStubSettings.newBuilder();
- * bigQueryStorageSettingsBuilder
+ * baseBigQueryStorageSettingsBuilder
  *     .createReadSessionSettings()
  *     .setRetrySettings(
- *         bigQueryStorageSettingsBuilder
+ *         baseBigQueryStorageSettingsBuilder
  *             .createReadSessionSettings()
  *             .getRetrySettings()
  *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * BigQueryStorageStubSettings bigQueryStorageSettings = bigQueryStorageSettingsBuilder.build();
+ * BigQueryStorageStubSettings baseBigQueryStorageSettings =
+ *     baseBigQueryStorageSettingsBuilder.build();
  * }
*/ @BetaApi diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/GrpcBigQueryStorageStub.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/GrpcBigQueryStorageStub.java index 63d7e2e5c4..c9970fa700 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/GrpcBigQueryStorageStub.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/GrpcBigQueryStorageStub.java @@ -281,16 +281,19 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createReadSessionCallable() { return createReadSessionCallable; } + @Override public ServerStreamingCallable readRowsCallable() { return readRowsCallable; } + @Override public UnaryCallable< Storage.BatchCreateReadSessionStreamsRequest, Storage.BatchCreateReadSessionStreamsResponse> @@ -298,10 +301,12 @@ public GrpcOperationsStub getOperationsStub() { return batchCreateReadSessionStreamsCallable; } + @Override public UnaryCallable finalizeStreamCallable() { return finalizeStreamCallable; } + @Override public UnaryCallable splitReadStreamCallable() { return splitReadStreamCallable; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClient.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClient.java index 41d9b173d1..6970e4e7b2 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClient.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClient.java @@ -38,6 +38,16 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   ReadSession readSession = ReadSession.newBuilder().build();
+ *   int maxStreamCount = 940837515;
+ *   ReadSession response =
+ *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+ * }
+ * }
+ * *

Note: close() needs to be called on the BaseBigQueryReadClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -160,6 +170,18 @@ public BigQueryReadStub getStub() { *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ReadSession readSession = ReadSession.newBuilder().build();
+   *   int maxStreamCount = 940837515;
+   *   ReadSession response =
+   *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+   * }
+   * }
+ * * @param parent Required. The request project that owns the session, in the form of * `projects/{project_id}`. * @param readSession Required. Session to be created. @@ -201,6 +223,18 @@ public final ReadSession createReadSession( *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   ReadSession readSession = ReadSession.newBuilder().build();
+   *   int maxStreamCount = 940837515;
+   *   ReadSession response =
+   *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+   * }
+   * }
+ * * @param parent Required. The request project that owns the session, in the form of * `projects/{project_id}`. * @param readSession Required. Session to be created. @@ -242,6 +276,20 @@ public final ReadSession createReadSession( *

Read sessions automatically expire 24 hours after they are created and do not require manual * clean-up by the caller. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   CreateReadSessionRequest request =
+   *       CreateReadSessionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setReadSession(ReadSession.newBuilder().build())
+   *           .setMaxStreamCount(940837515)
+   *           .build();
+   *   ReadSession response = baseBigQueryReadClient.createReadSession(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -269,6 +317,21 @@ public final ReadSession createReadSession(CreateReadSessionRequest request) { * clean-up by the caller. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   CreateReadSessionRequest request =
+   *       CreateReadSessionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setReadSession(ReadSession.newBuilder().build())
+   *           .setMaxStreamCount(940837515)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigQueryReadClient.createReadSessionCallable().futureCall(request);
+   *   // Do something.
+   *   ReadSession response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createReadSessionCallable() { return stub.createReadSessionCallable(); @@ -284,6 +347,22 @@ public final UnaryCallable createReadSess * stream. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   ReadRowsRequest request =
+   *       ReadRowsRequest.newBuilder()
+   *           .setReadStream(
+   *               ReadStreamName.of("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]").toString())
+   *           .setOffset(-1019779949)
+   *           .build();
+   *   ServerStream stream =
+   *       baseBigQueryReadClient.readRowsCallable().call(request);
+   *   for (ReadRowsResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
*/ public final ServerStreamingCallable readRowsCallable() { return stub.readRowsCallable(); @@ -302,6 +381,20 @@ public final ServerStreamingCallable readRows * original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read * to completion. * + *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   SplitReadStreamRequest request =
+   *       SplitReadStreamRequest.newBuilder()
+   *           .setName(
+   *               ReadStreamName.of("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]").toString())
+   *           .setFraction(-1653751294)
+   *           .build();
+   *   SplitReadStreamResponse response = baseBigQueryReadClient.splitReadStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -323,6 +416,21 @@ public final SplitReadStreamResponse splitReadStream(SplitReadStreamRequest requ * to completion. * *

Sample code: + * + *

{@code
+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   SplitReadStreamRequest request =
+   *       SplitReadStreamRequest.newBuilder()
+   *           .setName(
+   *               ReadStreamName.of("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]").toString())
+   *           .setFraction(-1653751294)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigQueryReadClient.splitReadStreamCallable().futureCall(request);
+   *   // Do something.
+   *   SplitReadStreamResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable splitReadStreamCallable() { diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteClient.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteClient.java index a2e5cd8ef6..db904ff13b 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteClient.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteClient.java @@ -35,6 +35,14 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+ *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+ *   WriteStream writeStream = WriteStream.newBuilder().build();
+ *   WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+ * }
+ * }
+ * *

Note: close() needs to be called on the BigQueryWriteClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -143,6 +151,16 @@ public BigQueryWriteStub getStub() { * clients. Data written to this stream is considered committed as soon as an acknowledgement is * received. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+   *   WriteStream writeStream = WriteStream.newBuilder().build();
+   *   WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+   * }
+   * }
+ * * @param parent Required. Reference to the table to which the stream belongs, in the format of * `projects/{project}/datasets/{dataset}/tables/{table}`. * @param writeStream Required. Stream to be created. @@ -165,6 +183,16 @@ public final WriteStream createWriteStream(TableName parent, WriteStream writeSt * clients. Data written to this stream is considered committed as soon as an acknowledgement is * received. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString();
+   *   WriteStream writeStream = WriteStream.newBuilder().build();
+   *   WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+   * }
+   * }
+ * * @param parent Required. Reference to the table to which the stream belongs, in the format of * `projects/{project}/datasets/{dataset}/tables/{table}`. * @param writeStream Required. Stream to be created. @@ -184,6 +212,19 @@ public final WriteStream createWriteStream(String parent, WriteStream writeStrea * clients. Data written to this stream is considered committed as soon as an acknowledgement is * received. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   CreateWriteStreamRequest request =
+   *       CreateWriteStreamRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
+   *           .setWriteStream(WriteStream.newBuilder().build())
+   *           .build();
+   *   WriteStream response = bigQueryWriteClient.createWriteStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -200,6 +241,20 @@ public final WriteStream createWriteStream(CreateWriteStreamRequest request) { * received. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   CreateWriteStreamRequest request =
+   *       CreateWriteStreamRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
+   *           .setWriteStream(WriteStream.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.createWriteStreamCallable().futureCall(request);
+   *   // Do something.
+   *   WriteStream response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createWriteStreamCallable() { return stub.createWriteStreamCallable(); @@ -225,6 +280,24 @@ public final UnaryCallable createWriteStr * the stream is committed. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   BidiStream bidiStream =
+   *       bigQueryWriteClient.appendRowsCallable().call();
+   *   AppendRowsRequest request =
+   *       AppendRowsRequest.newBuilder()
+   *           .setWriteStream(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setOffset(Int64Value.newBuilder().build())
+   *           .setTraceId("traceId-1067401920")
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (AppendRowsResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
*/ public final BidiStreamingCallable appendRowsCallable() { return stub.appendRowsCallable(); @@ -234,6 +307,15 @@ public final BidiStreamingCallable append /** * Gets a write stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
+   *   WriteStream response = bigQueryWriteClient.getWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to get, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -248,6 +330,15 @@ public final WriteStream getWriteStream(WriteStreamName name) { /** * Gets a write stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
+   *   WriteStream response = bigQueryWriteClient.getWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to get, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -261,6 +352,19 @@ public final WriteStream getWriteStream(String name) { /** * Gets a write stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   GetWriteStreamRequest request =
+   *       GetWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   WriteStream response = bigQueryWriteClient.getWriteStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -273,6 +377,20 @@ public final WriteStream getWriteStream(GetWriteStreamRequest request) { * Gets a write stream. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   GetWriteStreamRequest request =
+   *       GetWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.getWriteStreamCallable().futureCall(request);
+   *   // Do something.
+   *   WriteStream response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getWriteStreamCallable() { return stub.getWriteStreamCallable(); @@ -283,6 +401,15 @@ public final UnaryCallable getWriteStreamCal * Finalize a write stream so that no new data can be appended to the stream. Finalize is not * supported on the '_default' stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
+   *   FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to finalize, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -300,6 +427,15 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(WriteStreamName nam * Finalize a write stream so that no new data can be appended to the stream. Finalize is not * supported on the '_default' stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
+   *   FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
+   * }
+   * }
+ * * @param name Required. Name of the stream to finalize, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -315,6 +451,19 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(String name) { * Finalize a write stream so that no new data can be appended to the stream. Finalize is not * supported on the '_default' stream. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   FinalizeWriteStreamRequest request =
+   *       FinalizeWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -328,6 +477,20 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(FinalizeWriteStream * supported on the '_default' stream. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   FinalizeWriteStreamRequest request =
+   *       FinalizeWriteStreamRequest.newBuilder()
+   *           .setName(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.finalizeWriteStreamCallable().futureCall(request);
+   *   // Do something.
+   *   FinalizeWriteStreamResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable finalizeWriteStreamCallable() { @@ -340,6 +503,16 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(FinalizeWriteStream * must be finalized before commit and cannot be committed multiple times. Once a stream is * committed, data in the stream becomes available for read operations. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String parent = "parent-995424086";
+   *   BatchCommitWriteStreamsResponse response =
+   *       bigQueryWriteClient.batchCommitWriteStreams(parent);
+   * }
+   * }
+ * * @param parent Required. Parent table that all the streams should belong to, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -356,6 +529,20 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(String pare * must be finalized before commit and cannot be committed multiple times. Once a stream is * committed, data in the stream becomes available for read operations. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   BatchCommitWriteStreamsRequest request =
+   *       BatchCommitWriteStreamsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .addAllWriteStreams(new ArrayList())
+   *           .build();
+   *   BatchCommitWriteStreamsResponse response =
+   *       bigQueryWriteClient.batchCommitWriteStreams(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -371,6 +558,20 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams( * committed, data in the stream becomes available for read operations. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   BatchCommitWriteStreamsRequest request =
+   *       BatchCommitWriteStreamsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .addAllWriteStreams(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.batchCommitWriteStreamsCallable().futureCall(request);
+   *   // Do something.
+   *   BatchCommitWriteStreamsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable batchCommitWriteStreamsCallable() { @@ -384,6 +585,16 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams( * flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in * the request. Flush is not supported on the _default stream, since it is not BUFFERED. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   WriteStreamName writeStream =
+   *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
+   *   FlushRowsResponse response = bigQueryWriteClient.flushRows(writeStream);
+   * }
+   * }
+ * * @param writeStream Required. The stream that is the target of the flush operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -402,6 +613,16 @@ public final FlushRowsResponse flushRows(WriteStreamName writeStream) { * flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in * the request. Flush is not supported on the _default stream, since it is not BUFFERED. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String writeStream =
+   *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
+   *   FlushRowsResponse response = bigQueryWriteClient.flushRows(writeStream);
+   * }
+   * }
+ * * @param writeStream Required. The stream that is the target of the flush operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -417,6 +638,20 @@ public final FlushRowsResponse flushRows(String writeStream) { * flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in * the request. Flush is not supported on the _default stream, since it is not BUFFERED. * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   FlushRowsRequest request =
+   *       FlushRowsRequest.newBuilder()
+   *           .setWriteStream(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setOffset(Int64Value.newBuilder().build())
+   *           .build();
+   *   FlushRowsResponse response = bigQueryWriteClient.flushRows(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -432,6 +667,21 @@ public final FlushRowsResponse flushRows(FlushRowsRequest request) { * the request. Flush is not supported on the _default stream, since it is not BUFFERED. * *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   FlushRowsRequest request =
+   *       FlushRowsRequest.newBuilder()
+   *           .setWriteStream(
+   *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setOffset(Int64Value.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       bigQueryWriteClient.flushRowsCallable().futureCall(request);
+   *   // Do something.
+   *   FlushRowsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable flushRowsCallable() { return stub.flushRowsCallable(); diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java index 64b11321de..7bbac03708 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java @@ -91,6 +91,8 @@ public class StreamWriter implements AutoCloseable { private final String streamName; private final String tableName; + private final String traceId; + private final BatchingSettings batchingSettings; private final RetrySettings retrySettings; private BigQueryWriteSettings stubSettings; @@ -151,6 +153,7 @@ private StreamWriter(Builder builder) tableName = matcher.group(1); } + this.traceId = builder.traceId; this.batchingSettings = builder.batchingSettings; this.retrySettings = builder.retrySettings; this.messagesBatch = new MessagesBatch(batchingSettings, this.streamName, this); @@ -477,6 +480,11 @@ private AppendRowsRequest getMergedRequest() throws IllegalStateException { "The first message on the connection must have writer schema set"); } requestBuilder.setWriteStream(streamName); + if (!inflightRequests.get(0).message.getTraceId().isEmpty()) { + requestBuilder.setTraceId(inflightRequests.get(0).message.getTraceId()); + } else if (streamWriter.traceId != null) { + requestBuilder.setTraceId(streamWriter.traceId); + } } return requestBuilder.setProtoRows(data.build()).build(); } @@ -660,6 +668,8 @@ public static final class Builder { private String streamOrTableName; private String endpoint = BigQueryWriteSettings.getDefaultEndpoint(); + private String traceId; + private BigQueryWriteClient client = null; // Batching options @@ -814,6 +824,12 @@ public Builder createDefaultStream() { return this; } + /** Mark the request as coming from Dataflow. */ + public Builder setDataflowTraceId() { + this.traceId = "Dataflow"; + return this; + } + /** Builds the {@code StreamWriter}. */ public StreamWriter build() throws IllegalArgumentException, IOException, InterruptedException { return new StreamWriter(this); @@ -916,6 +932,7 @@ public void onComplete() { public void onError(Throwable t) { LOG.fine("OnError called"); if (streamWriter.shutdown.get()) { + abortInflightRequests(t); return; } InflightBatch inflightBatch = null; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/package-info.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/package-info.java index 39429df6bf..ae7a37d17b 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/package-info.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/package-info.java @@ -28,6 +28,16 @@ * *

Sample for BaseBigQueryReadClient: * + *

{@code
+ * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   ReadSession readSession = ReadSession.newBuilder().build();
+ *   int maxStreamCount = 940837515;
+ *   ReadSession response =
+ *       baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+ * }
+ * }
+ * *

======================= BigQueryWriteClient ======================= * *

Service Description: BigQuery Write API. @@ -35,6 +45,14 @@ *

The Write API can be used to write data to BigQuery. * *

Sample for BigQueryWriteClient: + * + *

{@code
+ * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+ *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+ *   WriteStream writeStream = WriteStream.newBuilder().build();
+ *   WriteStream response = bigQueryWriteClient.createWriteStream(parent, writeStream);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.bigquery.storage.v1beta2; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryReadStubSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryReadStubSettings.java index bb79df916a..3b230461c1 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryReadStubSettings.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryReadStubSettings.java @@ -66,18 +66,18 @@ *

For example, to set the total timeout of createReadSession to 30 seconds: * *

{@code
- * BigQueryReadStubSettings.Builder bigQueryReadSettingsBuilder =
+ * BigQueryReadStubSettings.Builder baseBigQueryReadSettingsBuilder =
  *     BigQueryReadStubSettings.newBuilder();
- * bigQueryReadSettingsBuilder
+ * baseBigQueryReadSettingsBuilder
  *     .createReadSessionSettings()
  *     .setRetrySettings(
- *         bigQueryReadSettingsBuilder
+ *         baseBigQueryReadSettingsBuilder
  *             .createReadSessionSettings()
  *             .getRetrySettings()
  *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * BigQueryReadStubSettings bigQueryReadSettings = bigQueryReadSettingsBuilder.build();
+ * BigQueryReadStubSettings baseBigQueryReadSettings = baseBigQueryReadSettingsBuilder.build();
  * }
*/ @BetaApi diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryReadStub.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryReadStub.java index 903f409708..8978f46262 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryReadStub.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryReadStub.java @@ -190,14 +190,17 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createReadSessionCallable() { return createReadSessionCallable; } + @Override public ServerStreamingCallable readRowsCallable() { return readRowsCallable; } + @Override public UnaryCallable splitReadStreamCallable() { return splitReadStreamCallable; } diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryWriteStub.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryWriteStub.java index 065dc433d9..5ac03eb194 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryWriteStub.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/GrpcBigQueryWriteStub.java @@ -286,28 +286,34 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createWriteStreamCallable() { return createWriteStreamCallable; } + @Override public BidiStreamingCallable appendRowsCallable() { return appendRowsCallable; } + @Override public UnaryCallable getWriteStreamCallable() { return getWriteStreamCallable; } + @Override public UnaryCallable finalizeWriteStreamCallable() { return finalizeWriteStreamCallable; } + @Override public UnaryCallable batchCommitWriteStreamsCallable() { return batchCommitWriteStreamsCallable; } + @Override public UnaryCallable flushRowsCallable() { return flushRowsCallable; } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java index 5691195326..7a398e0d0e 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java @@ -87,6 +87,7 @@ public void createReadSessionTest() throws Exception { ReadSession.newBuilder() .setName(ReadSessionName.of("[PROJECT]", "[LOCATION]", "[SESSION]").toString()) .setExpireTime(Timestamp.newBuilder().build()) + .setDataFormat(DataFormat.forNumber(0)) .setTable(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString()) .setTableModifiers(ReadSession.TableModifiers.newBuilder().build()) .setReadOptions(ReadSession.TableReadOptions.newBuilder().build()) @@ -136,6 +137,7 @@ public void createReadSessionTest2() throws Exception { ReadSession.newBuilder() .setName(ReadSessionName.of("[PROJECT]", "[LOCATION]", "[SESSION]").toString()) .setExpireTime(Timestamp.newBuilder().build()) + .setDataFormat(DataFormat.forNumber(0)) .setTable(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString()) .setTableModifiers(ReadSession.TableModifiers.newBuilder().build()) .setReadOptions(ReadSession.TableReadOptions.newBuilder().build()) diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java index 21e64df693..a39e91af61 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java @@ -69,7 +69,13 @@ public void createReadSession( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateReadSession, expected %s or %s", + response.getClass().getName(), + ReadSession.class.getName(), + Exception.class.getName()))); } } @@ -83,7 +89,13 @@ public void readRows(ReadRowsRequest request, StreamObserver r } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReadRows, expected %s or %s", + response.getClass().getName(), + ReadRowsResponse.class.getName(), + Exception.class.getName()))); } } @@ -98,7 +110,13 @@ public void splitReadStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SplitReadStream, expected %s or %s", + response.getClass().getName(), + SplitReadStreamResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java index e63712321a..0247da9d60 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java @@ -70,7 +70,13 @@ public void createWriteStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateWriteStream, expected %s or %s", + response.getClass().getName(), + Stream.WriteStream.class.getName(), + Exception.class.getName()))); } } @@ -88,7 +94,13 @@ public void onNext(Storage.AppendRowsRequest value) { } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AppendRows, expected %s or %s", + response.getClass().getName(), + Storage.AppendRowsResponse.class.getName(), + Exception.class.getName()))); } } @@ -116,7 +128,13 @@ public void getWriteStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetWriteStream, expected %s or %s", + response.getClass().getName(), + Stream.WriteStream.class.getName(), + Exception.class.getName()))); } } @@ -132,7 +150,13 @@ public void finalizeWriteStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FinalizeWriteStream, expected %s or %s", + response.getClass().getName(), + Storage.FinalizeWriteStreamResponse.class.getName(), + Exception.class.getName()))); } } @@ -148,7 +172,13 @@ public void batchCommitWriteStreams( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchCommitWriteStreams, expected %s or %s", + response.getClass().getName(), + Storage.BatchCommitWriteStreamsResponse.class.getName(), + Exception.class.getName()))); } } @@ -164,7 +194,13 @@ public void flushRows( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FlushRows, expected %s or %s", + response.getClass().getName(), + Storage.FlushRowsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java index 79dc8f2ca2..aaa7a242a3 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java @@ -71,7 +71,13 @@ public void createReadSession( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateReadSession, expected %s or %s", + response.getClass().getName(), + Storage.ReadSession.class.getName(), + Exception.class.getName()))); } } @@ -86,7 +92,13 @@ public void readRows( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReadRows, expected %s or %s", + response.getClass().getName(), + Storage.ReadRowsResponse.class.getName(), + Exception.class.getName()))); } } @@ -102,7 +114,13 @@ public void batchCreateReadSessionStreams( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchCreateReadSessionStreams, expected %s or %s", + response.getClass().getName(), + Storage.BatchCreateReadSessionStreamsResponse.class.getName(), + Exception.class.getName()))); } } @@ -117,7 +135,13 @@ public void finalizeStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FinalizeStream, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -133,7 +157,13 @@ public void splitReadStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SplitReadStream, expected %s or %s", + response.getClass().getName(), + Storage.SplitReadStreamResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClientTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClientTest.java index 20f1e46654..1782221409 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClientTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadClientTest.java @@ -87,6 +87,7 @@ public void createReadSessionTest() throws Exception { ReadSession.newBuilder() .setName(ReadSessionName.of("[PROJECT]", "[LOCATION]", "[SESSION]").toString()) .setExpireTime(Timestamp.newBuilder().build()) + .setDataFormat(DataFormat.forNumber(0)) .setTable(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString()) .setTableModifiers(ReadSession.TableModifiers.newBuilder().build()) .setReadOptions(ReadSession.TableReadOptions.newBuilder().build()) @@ -136,6 +137,7 @@ public void createReadSessionTest2() throws Exception { ReadSession.newBuilder() .setName(ReadSessionName.of("[PROJECT]", "[LOCATION]", "[SESSION]").toString()) .setExpireTime(Timestamp.newBuilder().build()) + .setDataFormat(DataFormat.forNumber(0)) .setTable(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString()) .setTableModifiers(ReadSession.TableModifiers.newBuilder().build()) .setReadOptions(ReadSession.TableReadOptions.newBuilder().build()) diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java index 1482baca9c..d93d819537 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java @@ -69,7 +69,13 @@ public void createReadSession( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateReadSession, expected %s or %s", + response.getClass().getName(), + ReadSession.class.getName(), + Exception.class.getName()))); } } @@ -83,7 +89,13 @@ public void readRows(ReadRowsRequest request, StreamObserver r } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReadRows, expected %s or %s", + response.getClass().getName(), + ReadRowsResponse.class.getName(), + Exception.class.getName()))); } } @@ -98,7 +110,13 @@ public void splitReadStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SplitReadStream, expected %s or %s", + response.getClass().getName(), + SplitReadStreamResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java index 078421f361..235e050165 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java @@ -69,7 +69,13 @@ public void createWriteStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateWriteStream, expected %s or %s", + response.getClass().getName(), + WriteStream.class.getName(), + Exception.class.getName()))); } } @@ -87,7 +93,13 @@ public void onNext(AppendRowsRequest value) { } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AppendRows, expected %s or %s", + response.getClass().getName(), + AppendRowsResponse.class.getName(), + Exception.class.getName()))); } } @@ -115,7 +127,13 @@ public void getWriteStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetWriteStream, expected %s or %s", + response.getClass().getName(), + WriteStream.class.getName(), + Exception.class.getName()))); } } @@ -131,7 +149,13 @@ public void finalizeWriteStream( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FinalizeWriteStream, expected %s or %s", + response.getClass().getName(), + FinalizeWriteStreamResponse.class.getName(), + Exception.class.getName()))); } } @@ -147,7 +171,13 @@ public void batchCommitWriteStreams( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchCommitWriteStreams, expected %s or %s", + response.getClass().getName(), + BatchCommitWriteStreamsResponse.class.getName(), + Exception.class.getName()))); } } @@ -162,7 +192,13 @@ public void flushRows( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FlushRows, expected %s or %s", + response.getClass().getName(), + FlushRowsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterTest.java index 7cc101de19..2b67f9f3d1 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterTest.java @@ -993,4 +993,60 @@ public void testFlushAllFailed() throws Exception { writer.close(); } + + @Test + public void testDatasetTraceId() throws Exception { + StreamWriter writer = + getTestStreamWriterBuilder() + .setBatchingSettings( + StreamWriter.Builder.DEFAULT_BATCHING_SETTINGS + .toBuilder() + .setElementCountThreshold(1L) + .build()) + .setDataflowTraceId() + .build(); + testBigQueryWrite.addResponse(AppendRowsResponse.newBuilder().build()); + testBigQueryWrite.addResponse(AppendRowsResponse.newBuilder().build()); + + ApiFuture appendFuture1 = sendTestMessage(writer, new String[] {"A"}); + ApiFuture appendFuture2 = sendTestMessage(writer, new String[] {"B"}); + appendFuture1.get(); + appendFuture2.get(); + assertEquals("Dataflow", testBigQueryWrite.getAppendRequests().get(0).getTraceId()); + assertEquals("", testBigQueryWrite.getAppendRequests().get(1).getTraceId()); + } + + @Test + public void testShutdownWithConnectionError() throws Exception { + StreamWriter writer = + getTestStreamWriterBuilder() + .setBatchingSettings( + StreamWriter.Builder.DEFAULT_BATCHING_SETTINGS + .toBuilder() + .setElementCountThreshold(1L) + .build()) + .build(); + testBigQueryWrite.addResponse( + AppendRowsResponse.newBuilder() + .setAppendResult( + AppendRowsResponse.AppendResult.newBuilder().setOffset(Int64Value.of(1)).build()) + .build()); + testBigQueryWrite.addException(Status.DATA_LOSS.asException()); + testBigQueryWrite.setResponseDelay(Duration.ofSeconds(10)); + + ApiFuture appendFuture1 = sendTestMessage(writer, new String[] {"A"}); + ApiFuture appendFuture2 = sendTestMessage(writer, new String[] {"B"}); + Thread.sleep(5000L); + // Move the needle for responses to be sent. + fakeExecutor.advanceTime(Duration.ofSeconds(20)); + // Shutdown writer immediately and there will be some error happened when flushing the queue. + writer.shutdown(); + assertEquals(1, appendFuture1.get().getAppendResult().getOffset().getValue()); + try { + appendFuture2.get(); + fail("Should fail with exception"); + } catch (java.util.concurrent.ExecutionException e) { + assertEquals("Request aborted due to previous failures", e.getCause().getMessage()); + } + } } diff --git a/grpc-google-cloud-bigquerystorage-v1/pom.xml b/grpc-google-cloud-bigquerystorage-v1/pom.xml index 8fb3321ed9..1e29dbc026 100644 --- a/grpc-google-cloud-bigquerystorage-v1/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.8.5 + 1.9.0 grpc-google-cloud-bigquerystorage-v1 GRPC library for grpc-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml b/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml index 7f2381e3ad..e91dddae67 100644 --- a/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1alpha2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.108.5 + 0.109.0 grpc-google-cloud-bigquerystorage-v1alpha2 GRPC library for grpc-google-cloud-bigquerystorage-v1alpha2 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml index b8e9f49291..9c4ad55cd4 100644 --- a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.108.5 + 0.109.0 grpc-google-cloud-bigquerystorage-v1beta1 GRPC library for grpc-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml index bbaac86f1c..063cdb2b8e 100644 --- a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml +++ b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.108.5 + 0.109.0 grpc-google-cloud-bigquerystorage-v1beta2 GRPC library for grpc-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/pom.xml b/pom.xml index 9ddf069439..b5bf6615ed 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquerystorage-parent pom - 1.8.5 + 1.9.0 BigQuery Storage Parent https://github.com/googleapis/java-bigquerystorage @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 @@ -44,11 +44,11 @@ sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots + https://google.oss.sonatype.org/content/repositories/snapshots sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + https://google.oss.sonatype.org/service/local/staging/deploy/maven2/ @@ -64,7 +64,6 @@ 3.14.0 github google-cloud-bigquerystorage-parent - 2.12.1
@@ -97,57 +96,52 @@ com.google.cloud google-cloud-bigquery - 1.126.6 + 1.127.2 com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.108.5 + 0.109.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.108.5 + 0.109.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.108.5 + 0.109.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.8.5 + 1.9.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 - 0.108.5 + 0.109.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.108.5 + 0.109.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.108.5 + 0.109.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 1.8.5 + 1.9.0 com.google.cloud google-cloud-bigquerystorage - 1.8.5 - - - com.fasterxml.jackson.core - jackson-core - ${jackson-core.version} + 1.9.0 org.json @@ -160,7 +154,7 @@ junit junit - 4.13.1 + 4.13.2 test diff --git a/proto-google-cloud-bigquerystorage-v1/pom.xml b/proto-google-cloud-bigquerystorage-v1/pom.xml index 5920fc31d4..e828d0e932 100644 --- a/proto-google-cloud-bigquerystorage-v1/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 1.8.5 + 1.9.0 proto-google-cloud-bigquerystorage-v1 PROTO library for proto-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml b/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml index b1336e9c58..74f7e0b289 100644 --- a/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1alpha2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1alpha2 - 0.108.5 + 0.109.0 proto-google-cloud-bigquerystorage-v1alpha2 PROTO library for proto-google-cloud-bigquerystorage-v1alpha2 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml index fe4097dd8e..01df5c05ec 100644 --- a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.108.5 + 0.109.0 proto-google-cloud-bigquerystorage-v1beta1 PROTO library for proto-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml index 8acafefe67..d80ae732d2 100644 --- a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml +++ b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.108.5 + 0.109.0 proto-google-cloud-bigquerystorage-v1beta2 PROTO library for proto-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 1.8.5 + 1.9.0 diff --git a/renovate.json b/renovate.json index 458c922f7f..7bf000faff 100644 --- a/renovate.json +++ b/renovate.json @@ -68,12 +68,6 @@ "^com.google.cloud:google-cloud-" ], "ignoreUnstable": false - }, - { - "packagePatterns": [ - "^com.fasterxml.jackson.core" - ], - "groupName": "jackson dependencies" } ], "semanticCommits": true, diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0f5390eb1e..f6bb91819f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud google-cloud-bigquerystorage - 1.8.4 + 1.8.5 @@ -54,7 +54,7 @@ junit junit - 4.13.1 + 4.13.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8fd063a794..0e00f3e519 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigquerystorage - 1.8.5 + 1.9.0 @@ -53,7 +53,7 @@ junit junit - 4.13.1 + 4.13.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 038326bd8f..ff3ccc1fbb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.cloud libraries-bom - 16.3.0 + 16.4.0 pom import @@ -66,7 +66,7 @@ junit junit - 4.13.1 + 4.13.2 test diff --git a/synth.metadata b/synth.metadata index 54298c680c..7d62d21ea9 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,46 +11,46 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "ac3818700405d2cf9e27a4f1dcb57957e34bef7d" + "sha": "3e86b969cb64fbeadfc8e0847556e9c9f8302179" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6133907dbb3ddab204a17a15d5c53ec0aae9b033" + "sha": "b416a7befcdbc42de41cf387dcf428f894fb812b" } } ], @@ -109,7 +109,6 @@ ".github/workflows/ci.yaml", ".github/workflows/samples.yaml", ".kokoro/build.bat", - ".kokoro/build.sh", ".kokoro/coerce_logs.sh", ".kokoro/common.cfg", ".kokoro/common.sh", @@ -117,7 +116,6 @@ ".kokoro/continuous/java8.cfg", ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", - ".kokoro/linkage-monitor.sh", ".kokoro/nightly/common.cfg", ".kokoro/nightly/integration.cfg", ".kokoro/nightly/java11.cfg", @@ -125,7 +123,6 @@ ".kokoro/nightly/java8-osx.cfg", ".kokoro/nightly/java8-win.cfg", ".kokoro/nightly/java8.cfg", - ".kokoro/nightly/samples.cfg", ".kokoro/populate-secrets.sh", ".kokoro/presubmit/clirr.cfg", ".kokoro/presubmit/common.cfg", @@ -138,7 +135,6 @@ ".kokoro/presubmit/java8.cfg", ".kokoro/presubmit/linkage-monitor.cfg", ".kokoro/presubmit/lint.cfg", - ".kokoro/presubmit/samples.cfg", ".kokoro/readme.sh", ".kokoro/release/bump_snapshot.cfg", ".kokoro/release/common.cfg", @@ -149,6 +145,8 @@ ".kokoro/release/promote.sh", ".kokoro/release/publish_javadoc.cfg", ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/publish_javadoc11.cfg", + ".kokoro/release/publish_javadoc11.sh", ".kokoro/release/snapshot.cfg", ".kokoro/release/snapshot.sh", ".kokoro/release/stage.cfg", diff --git a/versions.txt b/versions.txt index ac405cbb42..774be91bbc 100644 --- a/versions.txt +++ b/versions.txt @@ -1,12 +1,12 @@ # Format: # module:released-version:current-version -proto-google-cloud-bigquerystorage-v1alpha2:0.108.5:0.108.5 -proto-google-cloud-bigquerystorage-v1beta1:0.108.5:0.108.5 -proto-google-cloud-bigquerystorage-v1beta2:0.108.5:0.108.5 -proto-google-cloud-bigquerystorage-v1:1.8.5:1.8.5 -grpc-google-cloud-bigquerystorage-v1alpha2:0.108.5:0.108.5 -grpc-google-cloud-bigquerystorage-v1beta1:0.108.5:0.108.5 -grpc-google-cloud-bigquerystorage-v1beta2:0.108.5:0.108.5 -grpc-google-cloud-bigquerystorage-v1:1.8.5:1.8.5 -google-cloud-bigquerystorage:1.8.5:1.8.5 +proto-google-cloud-bigquerystorage-v1alpha2:0.109.0:0.109.0 +proto-google-cloud-bigquerystorage-v1beta1:0.109.0:0.109.0 +proto-google-cloud-bigquerystorage-v1beta2:0.109.0:0.109.0 +proto-google-cloud-bigquerystorage-v1:1.9.0:1.9.0 +grpc-google-cloud-bigquerystorage-v1alpha2:0.109.0:0.109.0 +grpc-google-cloud-bigquerystorage-v1beta1:0.109.0:0.109.0 +grpc-google-cloud-bigquerystorage-v1beta2:0.109.0:0.109.0 +grpc-google-cloud-bigquerystorage-v1:1.9.0:1.9.0 +google-cloud-bigquerystorage:1.9.0:1.9.0