From 62162b753d6ecb61c47a99ce08957ab310216fd4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 25 Aug 2022 17:02:13 +0200 Subject: [PATCH 01/15] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage to v2.20.1 (#1763) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage](https://togithub.com/googleapis/java-bigquerystorage) | `2.20.0` -> `2.20.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage/2.20.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage/2.20.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage/2.20.1/compatibility-slim/2.20.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage/2.20.1/confidence-slim/2.20.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerystorage). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- tutorials/JsonWriterDefaultStream/pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d0ef89e7cd..8385dc98e1 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquerystorage - 2.20.0 + 2.20.1 ``` @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-bigquerystorage' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquerystorage:2.20.0' +implementation 'com.google.cloud:google-cloud-bigquerystorage:2.20.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.20.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.20.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2c79d1870f..a65eba8985 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 - 2.20.0 + 2.20.1 diff --git a/tutorials/JsonWriterDefaultStream/pom.xml b/tutorials/JsonWriterDefaultStream/pom.xml index eada936480..15b2b53293 100644 --- a/tutorials/JsonWriterDefaultStream/pom.xml +++ b/tutorials/JsonWriterDefaultStream/pom.xml @@ -19,7 +19,7 @@ com.google.cloud google-cloud-bigquerystorage - 2.20.0 + 2.20.1 com.google.cloud From 56b3fb735561f8ac0a283677e25e673282ece5a8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:06:13 +0000 Subject: [PATCH 02/15] chore(main): release 2.20.2-SNAPSHOT (#1762) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- google-cloud-bigquerystorage-bom/pom.xml | 16 ++++++++-------- google-cloud-bigquerystorage/pom.xml | 4 ++-- grpc-google-cloud-bigquerystorage-v1/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- pom.xml | 16 ++++++++-------- proto-google-cloud-bigquerystorage-v1/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 14 +++++++------- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/google-cloud-bigquerystorage-bom/pom.xml b/google-cloud-bigquerystorage-bom/pom.xml index 23fcf65e68..9d16c31863 100644 --- a/google-cloud-bigquerystorage-bom/pom.xml +++ b/google-cloud-bigquerystorage-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage-bom - 2.20.1 + 2.20.2-SNAPSHOT pom com.google.cloud @@ -52,37 +52,37 @@ com.google.cloud google-cloud-bigquerystorage - 2.20.1 + 2.20.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 2.20.1 + 2.20.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index 6fd8bffa05..d7936d4d92 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 - 2.20.1 + 2.20.2-SNAPSHOT jar BigQuery Storage https://github.com/googleapis/java-bigquerystorage @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquerystorage-parent - 2.20.1 + 2.20.2-SNAPSHOT google-cloud-bigquerystorage diff --git a/grpc-google-cloud-bigquerystorage-v1/pom.xml b/grpc-google-cloud-bigquerystorage-v1/pom.xml index 8c505cf2e5..94d6dc4fb2 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 - 2.20.1 + 2.20.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1 GRPC library for grpc-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml index 512990d980..3604ce6a1c 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.144.1 + 0.144.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta1 GRPC library for grpc-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml index bd1a5ceb7b..06d5d56b30 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.144.1 + 0.144.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta2 GRPC library for grpc-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index 0dfa3bccc5..db222be1ce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquerystorage-parent pom - 2.20.1 + 2.20.2-SNAPSHOT BigQuery Storage Parent https://github.com/googleapis/java-bigquerystorage @@ -83,37 +83,37 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 2.20.1 + 2.20.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.144.1 + 0.144.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 2.20.1 + 2.20.2-SNAPSHOT com.google.cloud google-cloud-bigquerystorage - 2.20.1 + 2.20.2-SNAPSHOT org.json diff --git a/proto-google-cloud-bigquerystorage-v1/pom.xml b/proto-google-cloud-bigquerystorage-v1/pom.xml index 2520b365e2..686b41f4f8 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 - 2.20.1 + 2.20.2-SNAPSHOT proto-google-cloud-bigquerystorage-v1 PROTO library for proto-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml index dbf3e8551f..254ddd8cf6 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.144.1 + 0.144.2-SNAPSHOT proto-google-cloud-bigquerystorage-v1beta1 PROTO library for proto-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml index 568c18faac..919b84bd61 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.144.1 + 0.144.2-SNAPSHOT proto-google-cloud-bigquerystorage-v1beta2 PROTO library for proto-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8e58429b70..0c717a6754 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigquerystorage - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index ca61d7bfef..327d597960 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigquerystorage:2.20.1:2.20.1 -grpc-google-cloud-bigquerystorage-v1beta1:0.144.1:0.144.1 -grpc-google-cloud-bigquerystorage-v1beta2:0.144.1:0.144.1 -grpc-google-cloud-bigquerystorage-v1:2.20.1:2.20.1 -proto-google-cloud-bigquerystorage-v1beta1:0.144.1:0.144.1 -proto-google-cloud-bigquerystorage-v1beta2:0.144.1:0.144.1 -proto-google-cloud-bigquerystorage-v1:2.20.1:2.20.1 +google-cloud-bigquerystorage:2.20.1:2.20.2-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1beta1:0.144.1:0.144.2-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1beta2:0.144.1:0.144.2-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1:2.20.1:2.20.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1beta1:0.144.1:0.144.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1beta2:0.144.1:0.144.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1:2.20.1:2.20.2-SNAPSHOT From 40e0ba09527c564004fcbbb0c3af2fb97eb811c0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 29 Aug 2022 15:36:22 +0200 Subject: [PATCH 03/15] deps: update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 (#1766) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.14.7` -> `2.15.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/compatibility-slim/2.14.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/confidence-slim/2.14.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v2.15.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2150-httpsgithubcomgoogleapisjava-bigquerycomparev2147v2150-2022-08-25) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.14.7...v2.15.0) ##### Features - add preview support for default values ([#​2244](https://togithub.com/googleapis/java-bigquery/issues/2244)) ([fd3d3c5](https://togithub.com/googleapis/java-bigquery/commit/fd3d3c57afed84b4d00aab438d79472a6afa001b))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerystorage). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- tutorials/JsonWriterDefaultStream/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index db222be1ce..85fbad8bc2 100644 --- a/pom.xml +++ b/pom.xml @@ -132,7 +132,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.15.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a65eba8985..a27de5a938 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -37,7 +37,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.15.0 org.apache.avro diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0c717a6754..7b05443f83 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -36,7 +36,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.15.0 org.apache.avro diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 328608168b..20f44d28a3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -48,7 +48,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.15.0 org.apache.avro diff --git a/tutorials/JsonWriterDefaultStream/pom.xml b/tutorials/JsonWriterDefaultStream/pom.xml index 15b2b53293..63fa79ca0f 100644 --- a/tutorials/JsonWriterDefaultStream/pom.xml +++ b/tutorials/JsonWriterDefaultStream/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.15.0 org.apache.avro From 5cc96a0c5da5c8b557e96cd1a25afdff9d583a0f Mon Sep 17 00:00:00 2001 From: Sandhu Santhakumar Date: Wed, 31 Aug 2022 00:58:12 +0530 Subject: [PATCH 04/15] fix(api): numeric/bignumeric conversion issue #1757 (#1768) --- .../storage/v1/JsonToProtoMessage.java | 8 +-- .../storage/v1/JsonToProtoMessageTest.java | 55 +++++++++++++++++++ 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java index 56edc4b488..dde3b542bf 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java @@ -313,7 +313,7 @@ private static void fillField( protoMsg.setField( fieldDescriptor, BigDecimalByteStringEncoder.encodeToNumericByteString( - new BigDecimal(((Number) val).doubleValue()))); + new BigDecimal(String.valueOf(val)))); return; } } else if (fieldSchema.getType() == TableFieldSchema.Type.BIGNUMERIC) { @@ -333,7 +333,7 @@ private static void fillField( protoMsg.setField( fieldDescriptor, BigDecimalByteStringEncoder.encodeToBigNumericByteString( - new BigDecimal(((Number) val).doubleValue()))); + new BigDecimal(String.valueOf(val)))); return; } } @@ -547,7 +547,7 @@ private static void fillRepeatedField( protoMsg.addRepeatedField( fieldDescriptor, BigDecimalByteStringEncoder.encodeToNumericByteString( - new BigDecimal(((Number) val).doubleValue()))); + new BigDecimal(String.valueOf(val)))); added = true; } } else if (fieldSchema != null @@ -568,7 +568,7 @@ private static void fillRepeatedField( protoMsg.addRepeatedField( fieldDescriptor, BigDecimalByteStringEncoder.encodeToBigNumericByteString( - new BigDecimal(((Number) val).doubleValue()))); + new BigDecimal(String.valueOf(val)))); added = true; } } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessageTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessageTest.java index e69e8f1bb0..c24a49f858 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessageTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessageTest.java @@ -27,6 +27,7 @@ import com.google.protobuf.Message; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Collections; import java.util.Map; import java.util.logging.Logger; import org.json.JSONArray; @@ -1311,4 +1312,58 @@ public void testNullRepeatedField() throws Exception { JsonToProtoMessage.convertJsonToProtoMessage(RepeatedInt32.getDescriptor(), ts, json); assertTrue(protoMsg.getAllFields().isEmpty()); } + + @Test + public void testDoubleAndFloatToNumericConversion() { + TableSchema ts = + TableSchema.newBuilder() + .addFields( + 0, + TableFieldSchema.newBuilder() + .setName("numeric") + .setType(TableFieldSchema.Type.NUMERIC) + .build()) + .build(); + TestNumeric expectedProto = + TestNumeric.newBuilder() + .setNumeric( + BigDecimalByteStringEncoder.encodeToNumericByteString(new BigDecimal("24.678"))) + .build(); + JSONObject json = new JSONObject(); + json.put("numeric", new Double(24.678)); + DynamicMessage protoMsg = + JsonToProtoMessage.convertJsonToProtoMessage(TestNumeric.getDescriptor(), ts, json); + assertEquals(expectedProto, protoMsg); + json.put("numeric", new Float(24.678)); + protoMsg = JsonToProtoMessage.convertJsonToProtoMessage(TestNumeric.getDescriptor(), ts, json); + assertEquals(expectedProto, protoMsg); + } + + @Test + public void testDoubleAndFloatToRepeatedBigNumericConversion() { + TableSchema ts = + TableSchema.newBuilder() + .addFields( + 0, + TableFieldSchema.newBuilder() + .setName("bignumeric") + .setType(TableFieldSchema.Type.BIGNUMERIC) + .setMode(TableFieldSchema.Mode.REPEATED) + .build()) + .build(); + TestBignumeric expectedProto = + TestBignumeric.newBuilder() + .addBignumeric( + BigDecimalByteStringEncoder.encodeToBigNumericByteString(new BigDecimal("24.678"))) + .build(); + JSONObject json = new JSONObject(); + json.put("bignumeric", Collections.singletonList(new Double(24.678))); + DynamicMessage protoMsg = + JsonToProtoMessage.convertJsonToProtoMessage(TestBignumeric.getDescriptor(), ts, json); + assertEquals(expectedProto, protoMsg); + json.put("bignumeric", Collections.singletonList(new Float(24.678))); + protoMsg = + JsonToProtoMessage.convertJsonToProtoMessage(TestBignumeric.getDescriptor(), ts, json); + assertEquals(expectedProto, protoMsg); + } } From f446ff4f7d3f9d217501201289be416cbfdbe937 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 12:15:13 -0700 Subject: [PATCH 05/15] feat: add location to WriteStream and add WriteStreamView support (#1771) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(bazel): Update WORKSPACE files for rules_gapic, gax_java, generator_java versions PiperOrigin-RevId: 472750037 Source-Link: https://github.com/googleapis/googleapis/commit/88f2ea3f53b9712f2e04f28f06210f6f77fa7e24 Source-Link: https://github.com/googleapis/googleapis-gen/commit/230a5588306aae18fe8f2a57f14d4039ad72c901 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjMwYTU1ODgzMDZhYWUxOGZlOGYyYTU3ZjE0ZDQwMzlhZDcyYzkwMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add location to WriteStream and add WriteStreamView support PiperOrigin-RevId: 472835596 Source-Link: https://github.com/googleapis/googleapis/commit/1cf9407d5a7c889b7b30bd8a8ea4b67275943ac9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/59d0f10badec867913ebc2eb4bac021f79904519 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTlkMGYxMGJhZGVjODY3OTEzZWJjMmViNGJhYzAyMWY3OTkwNDUxOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 2 +- .../storage/v1/BaseBigQueryReadClient.java | 70 +++++-- .../storage/v1/BaseBigQueryReadSettings.java | 7 +- .../storage/v1/BigQueryWriteClient.java | 170 ++++++++++----- .../storage/v1/BigQueryWriteSettings.java | 12 +- .../bigquery/storage/v1/package-info.java | 14 +- .../v1/stub/BigQueryReadStubSettings.java | 7 +- .../v1/stub/BigQueryWriteStubSettings.java | 12 +- .../v1beta1/BaseBigQueryStorageClient.java | 119 ++++++++--- .../v1beta1/BaseBigQueryStorageSettings.java | 7 +- .../storage/v1beta1/package-info.java | 7 +- .../stub/BigQueryStorageStubSettings.java | 7 +- .../v1beta2/BaseBigQueryReadClient.java | 70 +++++-- .../v1beta2/BaseBigQueryReadSettings.java | 7 +- .../storage/v1beta2/BigQueryWriteClient.java | 161 ++++++++++---- .../v1beta2/BigQueryWriteSettings.java | 12 +- .../storage/v1beta2/package-info.java | 14 +- .../stub/BigQueryReadStubSettings.java | 7 +- .../stub/BigQueryWriteStubSettings.java | 12 +- .../storage/v1/BigQueryWriteClientTest.java | 4 + .../storage/v1/GetWriteStreamRequest.java | 165 +++++++++++++++ .../v1/GetWriteStreamRequestOrBuilder.java | 27 +++ .../bigquery/storage/v1/StorageProto.java | 197 +++++++++--------- .../bigquery/storage/v1/StreamProto.java | 35 ++-- .../bigquery/storage/v1/WriteStream.java | 193 +++++++++++++++++ .../storage/v1/WriteStreamOrBuilder.java | 29 +++ .../bigquery/storage/v1/WriteStreamView.java | 185 ++++++++++++++++ .../cloud/bigquery/storage/v1/storage.proto | 4 + .../cloud/bigquery/storage/v1/stream.proto | 22 ++ 29 files changed, 1249 insertions(+), 329 deletions(-) create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamView.java diff --git a/README.md b/README.md index 8385dc98e1..6cbfc72ed5 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.0') +implementation platform('com.google.cloud:libraries-bom:26.1.1') implementation 'com.google.cloud: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 b36e10c54f..5455e617bc 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,8 +35,11 @@ * calls that map to API methods. Sample code to get started: * *
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
  *   ProjectName parent = ProjectName.of("[PROJECT]");
  *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -76,8 +79,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryReadSettings baseBigQueryReadSettings =
  *     BaseBigQueryReadSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -89,8 +95,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryReadSettings baseBigQueryReadSettings =
  *     BaseBigQueryReadSettings.newBuilder().setEndpoint(myEndpoint).build();
  * BaseBigQueryReadClient baseBigQueryReadClient =
@@ -171,8 +180,11 @@ public BigQueryReadStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   ProjectName parent = ProjectName.of("[PROJECT]");
    *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -227,8 +239,11 @@ public final ReadSession createReadSession(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   String parent = ProjectName.of("[PROJECT]").toString();
    *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -283,8 +298,11 @@ public final ReadSession createReadSession(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   CreateReadSessionRequest request =
    *       CreateReadSessionRequest.newBuilder()
@@ -326,8 +344,11 @@ public final ReadSession createReadSession(CreateReadSessionRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   CreateReadSessionRequest request =
    *       CreateReadSessionRequest.newBuilder()
@@ -359,8 +380,11 @@ public final UnaryCallable createReadSess
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   ReadRowsRequest request =
    *       ReadRowsRequest.newBuilder()
@@ -396,8 +420,11 @@ public final ServerStreamingCallable readRows
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   SplitReadStreamRequest request =
    *       SplitReadStreamRequest.newBuilder()
@@ -432,8 +459,11 @@ public final SplitReadStreamResponse splitReadStream(SplitReadStreamRequest requ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   SplitReadStreamRequest request =
    *       SplitReadStreamRequest.newBuilder()
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadSettings.java
index 356170363d..1e6cb3fd29 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadSettings.java
@@ -51,8 +51,11 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryReadSettings.Builder baseBigQueryReadSettingsBuilder =
  *     BaseBigQueryReadSettings.newBuilder();
  * baseBigQueryReadSettingsBuilder
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java
index 5a1d7147dd..89be9c8065 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java
@@ -38,8 +38,11 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
  *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
  *   WriteStream writeStream = WriteStream.newBuilder().build();
@@ -76,8 +79,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteSettings bigQueryWriteSettings =
  *     BigQueryWriteSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -88,8 +94,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteSettings bigQueryWriteSettings =
  *     BigQueryWriteSettings.newBuilder().setEndpoint(myEndpoint).build();
  * BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create(bigQueryWriteSettings);
@@ -157,8 +166,11 @@ public BigQueryWriteStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
    *   WriteStream writeStream = WriteStream.newBuilder().build();
@@ -190,8 +202,11 @@ public final WriteStream createWriteStream(TableName parent, WriteStream writeSt
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString();
    *   WriteStream writeStream = WriteStream.newBuilder().build();
@@ -220,8 +235,11 @@ public final WriteStream createWriteStream(String parent, WriteStream writeStrea
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   CreateWriteStreamRequest request =
    *       CreateWriteStreamRequest.newBuilder()
@@ -249,8 +267,11 @@ public final WriteStream createWriteStream(CreateWriteStreamRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   CreateWriteStreamRequest request =
    *       CreateWriteStreamRequest.newBuilder()
@@ -313,8 +334,11 @@ public final UnaryCallable createWriteStr
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BidiStream bidiStream =
    *       bigQueryWriteClient.appendRowsCallable().call();
@@ -343,8 +367,11 @@ public final BidiStreamingCallable append
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
    *   WriteStream response = bigQueryWriteClient.getWriteStream(name);
@@ -368,8 +395,11 @@ public final WriteStream getWriteStream(WriteStreamName name) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
    *   WriteStream response = bigQueryWriteClient.getWriteStream(name);
@@ -392,13 +422,17 @@ public final WriteStream getWriteStream(String name) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   GetWriteStreamRequest request =
    *       GetWriteStreamRequest.newBuilder()
    *           .setName(
    *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setView(WriteStreamView.forNumber(0))
    *           .build();
    *   WriteStream response = bigQueryWriteClient.getWriteStream(request);
    * }
@@ -418,13 +452,17 @@ public final WriteStream getWriteStream(GetWriteStreamRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   GetWriteStreamRequest request =
    *       GetWriteStreamRequest.newBuilder()
    *           .setName(
    *               WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString())
+   *           .setView(WriteStreamView.forNumber(0))
    *           .build();
    *   ApiFuture future =
    *       bigQueryWriteClient.getWriteStreamCallable().futureCall(request);
@@ -445,8 +483,11 @@ public final UnaryCallable getWriteStreamCal
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
    *   FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
@@ -473,8 +514,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(WriteStreamName nam
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
    *   FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
@@ -499,8 +543,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(String name) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FinalizeWriteStreamRequest request =
    *       FinalizeWriteStreamRequest.newBuilder()
@@ -526,8 +573,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(FinalizeWriteStream
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FinalizeWriteStreamRequest request =
    *       FinalizeWriteStreamRequest.newBuilder()
@@ -556,8 +606,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(FinalizeWriteStream
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
    *   BatchCommitWriteStreamsResponse response =
@@ -587,8 +640,11 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(TableName p
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString();
    *   BatchCommitWriteStreamsResponse response =
@@ -616,8 +672,11 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(String pare
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BatchCommitWriteStreamsRequest request =
    *       BatchCommitWriteStreamsRequest.newBuilder()
@@ -647,8 +706,11 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BatchCommitWriteStreamsRequest request =
    *       BatchCommitWriteStreamsRequest.newBuilder()
@@ -680,8 +742,11 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   WriteStreamName writeStream =
    *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
@@ -713,8 +778,11 @@ public final FlushRowsResponse flushRows(WriteStreamName writeStream) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String writeStream =
    *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
@@ -743,8 +811,11 @@ public final FlushRowsResponse flushRows(String writeStream) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FlushRowsRequest request =
    *       FlushRowsRequest.newBuilder()
@@ -776,8 +847,11 @@ public final FlushRowsResponse flushRows(FlushRowsRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FlushRowsRequest request =
    *       FlushRowsRequest.newBuilder()
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteSettings.java
index 1ca1332aad..867c5b91d2 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteSettings.java
@@ -51,16 +51,16 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteSettings.Builder bigQueryWriteSettingsBuilder = BigQueryWriteSettings.newBuilder();
  * bigQueryWriteSettingsBuilder
  *     .createWriteStreamSettings()
  *     .setRetrySettings(
- *         bigQueryWriteSettingsBuilder
- *             .createWriteStreamSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         bigQueryWriteSettingsBuilder.createWriteStreamSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * BigQueryWriteSettings bigQueryWriteSettings = bigQueryWriteSettingsBuilder.build();
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 816b781e04..0f3d464e01 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
@@ -26,8 +26,11 @@
  * 

Sample for BaseBigQueryReadClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
  *   ProjectName parent = ProjectName.of("[PROJECT]");
  *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -49,8 +52,11 @@
  * 

Sample for BigQueryWriteClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
  *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
  *   WriteStream writeStream = WriteStream.newBuilder().build();
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 5e1c372454..d000dcda30 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,8 +66,11 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryReadStubSettings.Builder baseBigQueryReadSettingsBuilder =
  *     BigQueryReadStubSettings.newBuilder();
  * baseBigQueryReadSettingsBuilder
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryWriteStubSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryWriteStubSettings.java
index e026fd68cd..50e4824e2f 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryWriteStubSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryWriteStubSettings.java
@@ -71,17 +71,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteStubSettings.Builder bigQueryWriteSettingsBuilder =
  *     BigQueryWriteStubSettings.newBuilder();
  * bigQueryWriteSettingsBuilder
  *     .createWriteStreamSettings()
  *     .setRetrySettings(
- *         bigQueryWriteSettingsBuilder
- *             .createWriteStreamSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         bigQueryWriteSettingsBuilder.createWriteStreamSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * BigQueryWriteStubSettings bigQueryWriteSettings = bigQueryWriteSettingsBuilder.build();
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 93d5aa1766..de2b208041 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
@@ -37,8 +37,11 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
  *   TableReferenceProto.TableReference tableReference =
  *       TableReferenceProto.TableReference.newBuilder().build();
@@ -79,8 +82,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryStorageSettings baseBigQueryStorageSettings =
  *     BaseBigQueryStorageSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -92,8 +98,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryStorageSettings baseBigQueryStorageSettings =
  *     BaseBigQueryStorageSettings.newBuilder().setEndpoint(myEndpoint).build();
  * BaseBigQueryStorageClient baseBigQueryStorageClient =
@@ -169,8 +178,11 @@ public BigQueryStorageStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   TableReferenceProto.TableReference tableReference =
    *       TableReferenceProto.TableReference.newBuilder().build();
@@ -218,8 +230,11 @@ public final Storage.ReadSession createReadSession(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   TableReferenceProto.TableReference tableReference =
    *       TableReferenceProto.TableReference.newBuilder().build();
@@ -267,8 +282,11 @@ public final Storage.ReadSession createReadSession(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.CreateReadSessionRequest request =
    *       Storage.CreateReadSessionRequest.newBuilder()
@@ -307,8 +325,11 @@ public final Storage.ReadSession createReadSession(Storage.CreateReadSessionRequ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.CreateReadSessionRequest request =
    *       Storage.CreateReadSessionRequest.newBuilder()
@@ -346,8 +367,11 @@ public final Storage.ReadSession createReadSession(Storage.CreateReadSessionRequ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.ReadRowsRequest request =
    *       Storage.ReadRowsRequest.newBuilder()
@@ -374,8 +398,11 @@ public final Storage.ReadSession createReadSession(Storage.CreateReadSessionRequ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.ReadSession session = Storage.ReadSession.newBuilder().build();
    *   int requestedStreams = 1017221410;
@@ -408,8 +435,11 @@ public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessio
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.BatchCreateReadSessionStreamsRequest request =
    *       Storage.BatchCreateReadSessionStreamsRequest.newBuilder()
@@ -437,8 +467,11 @@ public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessio
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.BatchCreateReadSessionStreamsRequest request =
    *       Storage.BatchCreateReadSessionStreamsRequest.newBuilder()
@@ -476,8 +509,11 @@ public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessio
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.Stream stream = Storage.Stream.newBuilder().build();
    *   baseBigQueryStorageClient.finalizeStream(stream);
@@ -510,8 +546,11 @@ public final void finalizeStream(Storage.Stream stream) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.FinalizeStreamRequest request =
    *       Storage.FinalizeStreamRequest.newBuilder()
@@ -545,8 +584,11 @@ public final void finalizeStream(Storage.FinalizeStreamRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.FinalizeStreamRequest request =
    *       Storage.FinalizeStreamRequest.newBuilder()
@@ -580,8 +622,11 @@ public final UnaryCallable finalizeStreamC
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.Stream originalStream = Storage.Stream.newBuilder().build();
    *   Storage.SplitReadStreamResponse response =
@@ -615,8 +660,11 @@ public final Storage.SplitReadStreamResponse splitReadStream(Storage.Stream orig
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.SplitReadStreamRequest request =
    *       Storage.SplitReadStreamRequest.newBuilder()
@@ -652,8 +700,11 @@ public final Storage.SplitReadStreamResponse splitReadStream(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
    *   Storage.SplitReadStreamRequest request =
    *       Storage.SplitReadStreamRequest.newBuilder()
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageSettings.java
index 3ac32aa559..4df22dfce9 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BaseBigQueryStorageSettings.java
@@ -52,8 +52,11 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryStorageSettings.Builder baseBigQueryStorageSettingsBuilder =
  *     BaseBigQueryStorageSettings.newBuilder();
  * baseBigQueryStorageSettingsBuilder
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 4653decccb..8a620b33aa 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
@@ -26,8 +26,11 @@
  * 

Sample for BaseBigQueryStorageClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BaseBigQueryStorageClient baseBigQueryStorageClient = BaseBigQueryStorageClient.create()) {
  *   TableReferenceProto.TableReference tableReference =
  *       TableReferenceProto.TableReference.newBuilder().build();
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 9eebd22b94..641363fc68 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,8 +62,11 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryStorageStubSettings.Builder baseBigQueryStorageSettingsBuilder =
  *     BigQueryStorageStubSettings.newBuilder();
  * baseBigQueryStorageSettingsBuilder
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 9c697775c4..28f9b98d13 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
@@ -39,8 +39,11 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
  *   ProjectName parent = ProjectName.of("[PROJECT]");
  *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -80,8 +83,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryReadSettings baseBigQueryReadSettings =
  *     BaseBigQueryReadSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -93,8 +99,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryReadSettings baseBigQueryReadSettings =
  *     BaseBigQueryReadSettings.newBuilder().setEndpoint(myEndpoint).build();
  * BaseBigQueryReadClient baseBigQueryReadClient =
@@ -176,8 +185,11 @@ public BigQueryReadStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   ProjectName parent = ProjectName.of("[PROJECT]");
    *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -231,8 +243,11 @@ public final ReadSession createReadSession(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   String parent = ProjectName.of("[PROJECT]").toString();
    *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -286,8 +301,11 @@ public final ReadSession createReadSession(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   CreateReadSessionRequest request =
    *       CreateReadSessionRequest.newBuilder()
@@ -328,8 +346,11 @@ public final ReadSession createReadSession(CreateReadSessionRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   CreateReadSessionRequest request =
    *       CreateReadSessionRequest.newBuilder()
@@ -360,8 +381,11 @@ public final UnaryCallable createReadSess
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   ReadRowsRequest request =
    *       ReadRowsRequest.newBuilder()
@@ -397,8 +421,11 @@ public final ServerStreamingCallable readRows
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   SplitReadStreamRequest request =
    *       SplitReadStreamRequest.newBuilder()
@@ -433,8 +460,11 @@ public final SplitReadStreamResponse splitReadStream(SplitReadStreamRequest requ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
    *   SplitReadStreamRequest request =
    *       SplitReadStreamRequest.newBuilder()
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadSettings.java
index b8b312103d..8d7217f7e6 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BaseBigQueryReadSettings.java
@@ -51,8 +51,11 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BaseBigQueryReadSettings.Builder baseBigQueryReadSettingsBuilder =
  *     BaseBigQueryReadSettings.newBuilder();
  * baseBigQueryReadSettingsBuilder
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 329d2e9aca..7b8af278a1 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
@@ -36,8 +36,11 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
  *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
  *   WriteStream writeStream = WriteStream.newBuilder().build();
@@ -74,8 +77,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteSettings bigQueryWriteSettings =
  *     BigQueryWriteSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -86,8 +92,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteSettings bigQueryWriteSettings =
  *     BigQueryWriteSettings.newBuilder().setEndpoint(myEndpoint).build();
  * BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create(bigQueryWriteSettings);
@@ -157,8 +166,11 @@ public BigQueryWriteStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
    *   WriteStream writeStream = WriteStream.newBuilder().build();
@@ -191,8 +203,11 @@ public final WriteStream createWriteStream(TableName parent, WriteStream writeSt
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString();
    *   WriteStream writeStream = WriteStream.newBuilder().build();
@@ -222,8 +237,11 @@ public final WriteStream createWriteStream(String parent, WriteStream writeStrea
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   CreateWriteStreamRequest request =
    *       CreateWriteStreamRequest.newBuilder()
@@ -252,8 +270,11 @@ public final WriteStream createWriteStream(CreateWriteStreamRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   CreateWriteStreamRequest request =
    *       CreateWriteStreamRequest.newBuilder()
@@ -293,8 +314,11 @@ public final UnaryCallable createWriteStr
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BidiStream bidiStream =
    *       bigQueryWriteClient.appendRowsCallable().call();
@@ -323,8 +347,11 @@ public final BidiStreamingCallable append
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
    *   WriteStream response = bigQueryWriteClient.getWriteStream(name);
@@ -348,8 +375,11 @@ public final WriteStream getWriteStream(WriteStreamName name) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
    *   WriteStream response = bigQueryWriteClient.getWriteStream(name);
@@ -372,8 +402,11 @@ public final WriteStream getWriteStream(String name) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   GetWriteStreamRequest request =
    *       GetWriteStreamRequest.newBuilder()
@@ -398,8 +431,11 @@ public final WriteStream getWriteStream(GetWriteStreamRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   GetWriteStreamRequest request =
    *       GetWriteStreamRequest.newBuilder()
@@ -425,8 +461,11 @@ public final UnaryCallable getWriteStreamCal
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   WriteStreamName name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
    *   FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
@@ -453,8 +492,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(WriteStreamName nam
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String name = WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
    *   FinalizeWriteStreamResponse response = bigQueryWriteClient.finalizeWriteStream(name);
@@ -479,8 +521,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(String name) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FinalizeWriteStreamRequest request =
    *       FinalizeWriteStreamRequest.newBuilder()
@@ -506,8 +551,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(FinalizeWriteStream
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FinalizeWriteStreamRequest request =
    *       FinalizeWriteStreamRequest.newBuilder()
@@ -535,8 +583,11 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(FinalizeWriteStream
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String parent = "parent-995424086";
    *   BatchCommitWriteStreamsResponse response =
@@ -563,8 +614,11 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(String pare
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BatchCommitWriteStreamsRequest request =
    *       BatchCommitWriteStreamsRequest.newBuilder()
@@ -593,8 +647,11 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BatchCommitWriteStreamsRequest request =
    *       BatchCommitWriteStreamsRequest.newBuilder()
@@ -623,8 +680,11 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   WriteStreamName writeStream =
    *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]");
@@ -653,8 +713,11 @@ public final FlushRowsResponse flushRows(WriteStreamName writeStream) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   String writeStream =
    *       WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString();
@@ -680,8 +743,11 @@ public final FlushRowsResponse flushRows(String writeStream) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FlushRowsRequest request =
    *       FlushRowsRequest.newBuilder()
@@ -710,8 +776,11 @@ public final FlushRowsResponse flushRows(FlushRowsRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   FlushRowsRequest request =
    *       FlushRowsRequest.newBuilder()
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteSettings.java
index dc5f17c0da..9b26e05535 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryWriteSettings.java
@@ -51,16 +51,16 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteSettings.Builder bigQueryWriteSettingsBuilder = BigQueryWriteSettings.newBuilder();
  * bigQueryWriteSettingsBuilder
  *     .createWriteStreamSettings()
  *     .setRetrySettings(
- *         bigQueryWriteSettingsBuilder
- *             .createWriteStreamSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         bigQueryWriteSettingsBuilder.createWriteStreamSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * BigQueryWriteSettings bigQueryWriteSettings = bigQueryWriteSettingsBuilder.build();
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 3308995a62..850dfdda20 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
@@ -29,8 +29,11 @@
  * 

Sample for BaseBigQueryReadClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
  *   ProjectName parent = ProjectName.of("[PROJECT]");
  *   ReadSession readSession = ReadSession.newBuilder().build();
@@ -49,8 +52,11 @@
  * 

Sample for BigQueryWriteClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
  *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
  *   WriteStream writeStream = WriteStream.newBuilder().build();
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 9258fecf7c..fc45582e5b 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,8 +66,11 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryReadStubSettings.Builder baseBigQueryReadSettingsBuilder =
  *     BigQueryReadStubSettings.newBuilder();
  * baseBigQueryReadSettingsBuilder
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryWriteStubSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryWriteStubSettings.java
index a064c12990..28e5ca43a1 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryWriteStubSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/stub/BigQueryWriteStubSettings.java
@@ -71,17 +71,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * BigQueryWriteStubSettings.Builder bigQueryWriteSettingsBuilder =
  *     BigQueryWriteStubSettings.newBuilder();
  * bigQueryWriteSettingsBuilder
  *     .createWriteStreamSettings()
  *     .setRetrySettings(
- *         bigQueryWriteSettingsBuilder
- *             .createWriteStreamSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         bigQueryWriteSettingsBuilder.createWriteStreamSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * BigQueryWriteStubSettings bigQueryWriteSettings = bigQueryWriteSettingsBuilder.build();
diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java
index dbe48c243d..980ca568ea 100644
--- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java
+++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java
@@ -91,6 +91,7 @@ public void createWriteStreamTest() throws Exception {
             .setCreateTime(Timestamp.newBuilder().build())
             .setCommitTime(Timestamp.newBuilder().build())
             .setTableSchema(TableSchema.newBuilder().build())
+            .setLocation("location1901043637")
             .build();
     mockBigQueryWrite.addResponse(expectedResponse);
 
@@ -135,6 +136,7 @@ public void createWriteStreamTest2() throws Exception {
             .setCreateTime(Timestamp.newBuilder().build())
             .setCommitTime(Timestamp.newBuilder().build())
             .setTableSchema(TableSchema.newBuilder().build())
+            .setLocation("location1901043637")
             .build();
     mockBigQueryWrite.addResponse(expectedResponse);
 
@@ -242,6 +244,7 @@ public void getWriteStreamTest() throws Exception {
             .setCreateTime(Timestamp.newBuilder().build())
             .setCommitTime(Timestamp.newBuilder().build())
             .setTableSchema(TableSchema.newBuilder().build())
+            .setLocation("location1901043637")
             .build();
     mockBigQueryWrite.addResponse(expectedResponse);
 
@@ -283,6 +286,7 @@ public void getWriteStreamTest2() throws Exception {
             .setCreateTime(Timestamp.newBuilder().build())
             .setCommitTime(Timestamp.newBuilder().build())
             .setTableSchema(TableSchema.newBuilder().build())
+            .setLocation("location1901043637")
             .build();
     mockBigQueryWrite.addResponse(expectedResponse);
 
diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequest.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequest.java
index fafc9d8d48..f004d52fe0 100644
--- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequest.java
+++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequest.java
@@ -39,6 +39,7 @@ private GetWriteStreamRequest(com.google.protobuf.GeneratedMessageV3.Builder
 
   private GetWriteStreamRequest() {
     name_ = "";
+    view_ = 0;
   }
 
   @java.lang.Override
@@ -77,6 +78,13 @@ private GetWriteStreamRequest(
               name_ = s;
               break;
             }
+          case 24:
+            {
+              int rawValue = input.readEnum();
+
+              view_ = rawValue;
+              break;
+            }
           default:
             {
               if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -168,6 +176,46 @@ public com.google.protobuf.ByteString getNameBytes() {
     }
   }
 
+  public static final int VIEW_FIELD_NUMBER = 3;
+  private int view_;
+  /**
+   *
+   *
+   * 
+   * Indicates whether to get full or partial view of the WriteStream. If
+   * not set, view returned will be basic.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Indicates whether to get full or partial view of the WriteStream. If
+   * not set, view returned will be basic.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.WriteStreamView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.storage.v1.WriteStreamView result = + com.google.cloud.bigquery.storage.v1.WriteStreamView.valueOf(view_); + return result == null + ? com.google.cloud.bigquery.storage.v1.WriteStreamView.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -185,6 +233,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (view_ + != com.google.cloud.bigquery.storage.v1.WriteStreamView.WRITE_STREAM_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, view_); + } unknownFields.writeTo(output); } @@ -197,6 +250,11 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (view_ + != com.google.cloud.bigquery.storage.v1.WriteStreamView.WRITE_STREAM_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, view_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -214,6 +272,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.bigquery.storage.v1.GetWriteStreamRequest) obj; if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -227,6 +286,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -375,6 +436,8 @@ public Builder clear() { super.clear(); name_ = ""; + view_ = 0; + return this; } @@ -403,6 +466,7 @@ public com.google.cloud.bigquery.storage.v1.GetWriteStreamRequest buildPartial() com.google.cloud.bigquery.storage.v1.GetWriteStreamRequest result = new com.google.cloud.bigquery.storage.v1.GetWriteStreamRequest(this); result.name_ = name_; + result.view_ = view_; onBuilt(); return result; } @@ -457,6 +521,9 @@ public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.GetWriteStreamRequ name_ = other.name_; onChanged(); } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -608,6 +675,104 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + private int view_ = 0; + /** + * + * + *
+     * Indicates whether to get full or partial view of the WriteStream. If
+     * not set, view returned will be basic.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Indicates whether to get full or partial view of the WriteStream. If
+     * not set, view returned will be basic.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether to get full or partial view of the WriteStream. If
+     * not set, view returned will be basic.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.WriteStreamView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.storage.v1.WriteStreamView result = + com.google.cloud.bigquery.storage.v1.WriteStreamView.valueOf(view_); + return result == null + ? com.google.cloud.bigquery.storage.v1.WriteStreamView.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates whether to get full or partial view of the WriteStream. If
+     * not set, view returned will be basic.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.bigquery.storage.v1.WriteStreamView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether to get full or partial view of the WriteStream. If
+     * not set, view returned will be basic.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequestOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequestOrBuilder.java index fbe97e3a0e..816792d231 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequestOrBuilder.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/GetWriteStreamRequestOrBuilder.java @@ -53,4 +53,31 @@ public interface GetWriteStreamRequestOrBuilder * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Indicates whether to get full or partial view of the WriteStream. If
+   * not set, view returned will be basic.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Indicates whether to get full or partial view of the WriteStream. If
+   * not set, view returned will be basic.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.WriteStreamView view = 3; + * + * @return The view. + */ + com.google.cloud.bigquery.storage.v1.WriteStreamView getView(); } diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java index 41a86d47f0..09b7f4b778 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java @@ -193,103 +193,104 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "igquery.storage.v1.RowError\022\024\n\014write_str" + "eam\030\005 \001(\t\032;\n\014AppendResult\022+\n\006offset\030\001 \001(" + "\0132\033.google.protobuf.Int64ValueB\n\n\010respon" - + "se\"Y\n\025GetWriteStreamRequest\022@\n\004name\030\001 \001(" - + "\tB2\340A\002\372A,\n*bigquerystorage.googleapis.co" - + "m/WriteStream\"s\n\036BatchCommitWriteStreams" - + "Request\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035bigquer" - + "y.googleapis.com/Table\022\032\n\rwrite_streams\030" - + "\002 \003(\tB\003\340A\002\"\231\001\n\037BatchCommitWriteStreamsRe" - + "sponse\022/\n\013commit_time\030\001 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022E\n\rstream_errors\030\002 \003(\0132." - + ".google.cloud.bigquery.storage.v1.Storag" - + "eError\"^\n\032FinalizeWriteStreamRequest\022@\n\004" - + "name\030\001 \001(\tB2\340A\002\372A,\n*bigquerystorage.goog" - + "leapis.com/WriteStream\"0\n\033FinalizeWriteS" - + "treamResponse\022\021\n\trow_count\030\001 \001(\003\"\211\001\n\020Flu" - + "shRowsRequest\022H\n\014write_stream\030\001 \001(\tB2\340A\002" - + "\372A,\n*bigquerystorage.googleapis.com/Writ" - + "eStream\022+\n\006offset\030\002 \001(\0132\033.google.protobu" - + "f.Int64Value\"#\n\021FlushRowsResponse\022\016\n\006off" - + "set\030\001 \001(\003\"\245\003\n\014StorageError\022M\n\004code\030\001 \001(\016" - + "2?.google.cloud.bigquery.storage.v1.Stor" - + "ageError.StorageErrorCode\022\016\n\006entity\030\002 \001(" - + "\t\022\025\n\rerror_message\030\003 \001(\t\"\236\002\n\020StorageErro" - + "rCode\022\"\n\036STORAGE_ERROR_CODE_UNSPECIFIED\020" - + "\000\022\023\n\017TABLE_NOT_FOUND\020\001\022\034\n\030STREAM_ALREADY" - + "_COMMITTED\020\002\022\024\n\020STREAM_NOT_FOUND\020\003\022\027\n\023IN" - + "VALID_STREAM_TYPE\020\004\022\030\n\024INVALID_STREAM_ST" - + "ATE\020\005\022\024\n\020STREAM_FINALIZED\020\006\022 \n\034SCHEMA_MI" - + "SMATCH_EXTRA_FIELDS\020\007\022\031\n\025OFFSET_ALREADY_" - + "EXISTS\020\010\022\027\n\023OFFSET_OUT_OF_RANGE\020\t\"\263\001\n\010Ro" - + "wError\022\r\n\005index\030\001 \001(\003\022E\n\004code\030\002 \001(\01627.go" - + "ogle.cloud.bigquery.storage.v1.RowError." - + "RowErrorCode\022\017\n\007message\030\003 \001(\t\"@\n\014RowErro" - + "rCode\022\036\n\032ROW_ERROR_CODE_UNSPECIFIED\020\000\022\020\n" - + "\014FIELDS_ERROR\020\0012\222\006\n\014BigQueryRead\022\351\001\n\021Cre" - + "ateReadSession\022:.google.cloud.bigquery.s" - + "torage.v1.CreateReadSessionRequest\032-.goo" - + "gle.cloud.bigquery.storage.v1.ReadSessio" - + "n\"i\202\323\344\223\002<\"7/v1/{read_session.table=proje" - + "cts/*/datasets/*/tables/*}:\001*\332A$parent,r" - + "ead_session,max_stream_count\022\317\001\n\010ReadRow" - + "s\0221.google.cloud.bigquery.storage.v1.Rea" - + "dRowsRequest\0322.google.cloud.bigquery.sto" - + "rage.v1.ReadRowsResponse\"Z\202\323\344\223\002?\022=/v1/{r" - + "ead_stream=projects/*/locations/*/sessio" - + "ns/*/streams/*}\332A\022read_stream,offset0\001\022\306" - + "\001\n\017SplitReadStream\0228.google.cloud.bigque" - + "ry.storage.v1.SplitReadStreamRequest\0329.g" - + "oogle.cloud.bigquery.storage.v1.SplitRea" - + "dStreamResponse\">\202\323\344\223\0028\0226/v1/{name=proje" - + "cts/*/locations/*/sessions/*/streams/*}\032" - + "{\312A\036bigquerystorage.googleapis.com\322AWhtt" - + "ps://www.googleapis.com/auth/bigquery,ht" - + "tps://www.googleapis.com/auth/cloud-plat" - + "form2\274\013\n\rBigQueryWrite\022\327\001\n\021CreateWriteSt" - + "ream\022:.google.cloud.bigquery.storage.v1." - + "CreateWriteStreamRequest\032-.google.cloud." - + "bigquery.storage.v1.WriteStream\"W\202\323\344\223\002;\"" - + "+/v1/{parent=projects/*/datasets/*/table" - + "s/*}:\014write_stream\332A\023parent,write_stream" - + "\022\322\001\n\nAppendRows\0223.google.cloud.bigquery." - + "storage.v1.AppendRowsRequest\0324.google.cl" - + "oud.bigquery.storage.v1.AppendRowsRespon" - + "se\"U\202\323\344\223\002@\";/v1/{write_stream=projects/*" - + "/datasets/*/tables/*/streams/*}:\001*\332A\014wri" - + "te_stream(\0010\001\022\277\001\n\016GetWriteStream\0227.googl" - + "e.cloud.bigquery.storage.v1.GetWriteStre" - + "amRequest\032-.google.cloud.bigquery.storag" - + "e.v1.WriteStream\"E\202\323\344\223\0028\"3/v1/{name=proj" - + "ects/*/datasets/*/tables/*/streams/*}:\001*" - + "\332A\004name\022\331\001\n\023FinalizeWriteStream\022<.google" - + ".cloud.bigquery.storage.v1.FinalizeWrite" - + "StreamRequest\032=.google.cloud.bigquery.st" - + "orage.v1.FinalizeWriteStreamResponse\"E\202\323" - + "\344\223\0028\"3/v1/{name=projects/*/datasets/*/ta" - + "bles/*/streams/*}:\001*\332A\004name\022\334\001\n\027BatchCom" - + "mitWriteStreams\022@.google.cloud.bigquery." - + "storage.v1.BatchCommitWriteStreamsReques" - + "t\032A.google.cloud.bigquery.storage.v1.Bat" - + "chCommitWriteStreamsResponse\"<\202\323\344\223\002-\022+/v" - + "1/{parent=projects/*/datasets/*/tables/*" - + "}\332A\006parent\022\313\001\n\tFlushRows\0222.google.cloud." - + "bigquery.storage.v1.FlushRowsRequest\0323.g" - + "oogle.cloud.bigquery.storage.v1.FlushRow" - + "sResponse\"U\202\323\344\223\002@\";/v1/{write_stream=pro" - + "jects/*/datasets/*/tables/*/streams/*}:\001" - + "*\332A\014write_stream\032\260\001\312A\036bigquerystorage.go" - + "ogleapis.com\322A\213\001https://www.googleapis.c" - + "om/auth/bigquery,https://www.googleapis." - + "com/auth/bigquery.insertdata,https://www" - + ".googleapis.com/auth/cloud-platformB\235\002\n$" - + "com.google.cloud.bigquery.storage.v1B\014St" - + "orageProtoP\001ZGgoogle.golang.org/genproto" - + "/googleapis/cloud/bigquery/storage/v1;st" - + "orage\252\002 Google.Cloud.BigQuery.Storage.V1" - + "\312\002 Google\\Cloud\\BigQuery\\Storage\\V1\352AU\n\035" - + "bigquery.googleapis.com/Table\0224projects/" - + "{project}/datasets/{dataset}/tables/{tab" - + "le}b\006proto3" + + "se\"\232\001\n\025GetWriteStreamRequest\022@\n\004name\030\001 \001" + + "(\tB2\340A\002\372A,\n*bigquerystorage.googleapis.c" + + "om/WriteStream\022?\n\004view\030\003 \001(\01621.google.cl" + + "oud.bigquery.storage.v1.WriteStreamView\"" + + "s\n\036BatchCommitWriteStreamsRequest\0225\n\006par" + + "ent\030\001 \001(\tB%\340A\002\372A\037\n\035bigquery.googleapis.c" + + "om/Table\022\032\n\rwrite_streams\030\002 \003(\tB\003\340A\002\"\231\001\n" + + "\037BatchCommitWriteStreamsResponse\022/\n\013comm" + + "it_time\030\001 \001(\0132\032.google.protobuf.Timestam" + + "p\022E\n\rstream_errors\030\002 \003(\0132..google.cloud." + + "bigquery.storage.v1.StorageError\"^\n\032Fina" + + "lizeWriteStreamRequest\022@\n\004name\030\001 \001(\tB2\340A" + + "\002\372A,\n*bigquerystorage.googleapis.com/Wri" + + "teStream\"0\n\033FinalizeWriteStreamResponse\022" + + "\021\n\trow_count\030\001 \001(\003\"\211\001\n\020FlushRowsRequest\022" + + "H\n\014write_stream\030\001 \001(\tB2\340A\002\372A,\n*bigquerys" + + "torage.googleapis.com/WriteStream\022+\n\006off" + + "set\030\002 \001(\0132\033.google.protobuf.Int64Value\"#" + + "\n\021FlushRowsResponse\022\016\n\006offset\030\001 \001(\003\"\245\003\n\014" + + "StorageError\022M\n\004code\030\001 \001(\0162?.google.clou" + + "d.bigquery.storage.v1.StorageError.Stora" + + "geErrorCode\022\016\n\006entity\030\002 \001(\t\022\025\n\rerror_mes" + + "sage\030\003 \001(\t\"\236\002\n\020StorageErrorCode\022\"\n\036STORA" + + "GE_ERROR_CODE_UNSPECIFIED\020\000\022\023\n\017TABLE_NOT" + + "_FOUND\020\001\022\034\n\030STREAM_ALREADY_COMMITTED\020\002\022\024" + + "\n\020STREAM_NOT_FOUND\020\003\022\027\n\023INVALID_STREAM_T" + + "YPE\020\004\022\030\n\024INVALID_STREAM_STATE\020\005\022\024\n\020STREA" + + "M_FINALIZED\020\006\022 \n\034SCHEMA_MISMATCH_EXTRA_F" + + "IELDS\020\007\022\031\n\025OFFSET_ALREADY_EXISTS\020\010\022\027\n\023OF" + + "FSET_OUT_OF_RANGE\020\t\"\263\001\n\010RowError\022\r\n\005inde" + + "x\030\001 \001(\003\022E\n\004code\030\002 \001(\01627.google.cloud.big" + + "query.storage.v1.RowError.RowErrorCode\022\017" + + "\n\007message\030\003 \001(\t\"@\n\014RowErrorCode\022\036\n\032ROW_E" + + "RROR_CODE_UNSPECIFIED\020\000\022\020\n\014FIELDS_ERROR\020" + + "\0012\222\006\n\014BigQueryRead\022\351\001\n\021CreateReadSession" + + "\022:.google.cloud.bigquery.storage.v1.Crea" + + "teReadSessionRequest\032-.google.cloud.bigq" + + "uery.storage.v1.ReadSession\"i\202\323\344\223\002<\"7/v1" + + "/{read_session.table=projects/*/datasets" + + "/*/tables/*}:\001*\332A$parent,read_session,ma" + + "x_stream_count\022\317\001\n\010ReadRows\0221.google.clo" + + "ud.bigquery.storage.v1.ReadRowsRequest\0322" + + ".google.cloud.bigquery.storage.v1.ReadRo" + + "wsResponse\"Z\202\323\344\223\002?\022=/v1/{read_stream=pro" + + "jects/*/locations/*/sessions/*/streams/*" + + "}\332A\022read_stream,offset0\001\022\306\001\n\017SplitReadSt" + + "ream\0228.google.cloud.bigquery.storage.v1." + + "SplitReadStreamRequest\0329.google.cloud.bi" + + "gquery.storage.v1.SplitReadStreamRespons" + + "e\">\202\323\344\223\0028\0226/v1/{name=projects/*/location" + + "s/*/sessions/*/streams/*}\032{\312A\036bigqueryst" + + "orage.googleapis.com\322AWhttps://www.googl" + + "eapis.com/auth/bigquery,https://www.goog" + + "leapis.com/auth/cloud-platform2\274\013\n\rBigQu" + + "eryWrite\022\327\001\n\021CreateWriteStream\022:.google." + + "cloud.bigquery.storage.v1.CreateWriteStr" + + "eamRequest\032-.google.cloud.bigquery.stora" + + "ge.v1.WriteStream\"W\202\323\344\223\002;\"+/v1/{parent=p" + + "rojects/*/datasets/*/tables/*}:\014write_st" + + "ream\332A\023parent,write_stream\022\322\001\n\nAppendRow" + + "s\0223.google.cloud.bigquery.storage.v1.App" + + "endRowsRequest\0324.google.cloud.bigquery.s" + + "torage.v1.AppendRowsResponse\"U\202\323\344\223\002@\";/v" + + "1/{write_stream=projects/*/datasets/*/ta" + + "bles/*/streams/*}:\001*\332A\014write_stream(\0010\001\022" + + "\277\001\n\016GetWriteStream\0227.google.cloud.bigque" + + "ry.storage.v1.GetWriteStreamRequest\032-.go" + + "ogle.cloud.bigquery.storage.v1.WriteStre" + + "am\"E\202\323\344\223\0028\"3/v1/{name=projects/*/dataset" + + "s/*/tables/*/streams/*}:\001*\332A\004name\022\331\001\n\023Fi" + + "nalizeWriteStream\022<.google.cloud.bigquer" + + "y.storage.v1.FinalizeWriteStreamRequest\032" + + "=.google.cloud.bigquery.storage.v1.Final" + + "izeWriteStreamResponse\"E\202\323\344\223\0028\"3/v1/{nam" + + "e=projects/*/datasets/*/tables/*/streams" + + "/*}:\001*\332A\004name\022\334\001\n\027BatchCommitWriteStream" + + "s\022@.google.cloud.bigquery.storage.v1.Bat" + + "chCommitWriteStreamsRequest\032A.google.clo" + + "ud.bigquery.storage.v1.BatchCommitWriteS" + + "treamsResponse\"<\202\323\344\223\002-\022+/v1/{parent=proj" + + "ects/*/datasets/*/tables/*}\332A\006parent\022\313\001\n" + + "\tFlushRows\0222.google.cloud.bigquery.stora" + + "ge.v1.FlushRowsRequest\0323.google.cloud.bi" + + "gquery.storage.v1.FlushRowsResponse\"U\202\323\344" + + "\223\002@\";/v1/{write_stream=projects/*/datase" + + "ts/*/tables/*/streams/*}:\001*\332A\014write_stre" + + "am\032\260\001\312A\036bigquerystorage.googleapis.com\322A" + + "\213\001https://www.googleapis.com/auth/bigque" + + "ry,https://www.googleapis.com/auth/bigqu" + + "ery.insertdata,https://www.googleapis.co" + + "m/auth/cloud-platformB\235\002\n$com.google.clo" + + "ud.bigquery.storage.v1B\014StorageProtoP\001ZG" + + "google.golang.org/genproto/googleapis/cl" + + "oud/bigquery/storage/v1;storage\252\002 Google" + + ".Cloud.BigQuery.Storage.V1\312\002 Google\\Clou" + + "d\\BigQuery\\Storage\\V1\352AU\n\035bigquery.googl" + + "eapis.com/Table\0224projects/{project}/data" + + "sets/{dataset}/tables/{table}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -432,7 +433,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_storage_v1_GetWriteStreamRequest_descriptor, new java.lang.String[] { - "Name", + "Name", "View", }); internal_static_google_cloud_bigquery_storage_v1_BatchCommitWriteStreamsRequest_descriptor = getDescriptor().getMessageTypes().get(11); diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java index 737f7e7ef9..ab597149fa 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java @@ -97,7 +97,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ame\030\001 \001(\tB\003\340A\003:{\352Ax\n)bigquerystorage.goo" + "gleapis.com/ReadStream\022Kprojects/{projec" + "t}/locations/{location}/sessions/{sessio" - + "n}/streams/{stream}\"\344\004\n\013WriteStream\022\021\n\004n" + + "n}/streams/{stream}\"\373\004\n\013WriteStream\022\021\n\004n" + "ame\030\001 \001(\tB\003\340A\003\022E\n\004type\030\002 \001(\01622.google.cl" + "oud.bigquery.storage.v1.WriteStream.Type" + "B\003\340A\005\0224\n\013create_time\030\003 \001(\0132\032.google.prot" @@ -106,20 +106,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "le_schema\030\005 \001(\0132-.google.cloud.bigquery." + "storage.v1.TableSchemaB\003\340A\003\022P\n\nwrite_mod" + "e\030\007 \001(\01627.google.cloud.bigquery.storage." - + "v1.WriteStream.WriteModeB\003\340A\005\"F\n\004Type\022\024\n" - + "\020TYPE_UNSPECIFIED\020\000\022\r\n\tCOMMITTED\020\001\022\013\n\007PE" - + "NDING\020\002\022\014\n\010BUFFERED\020\003\"3\n\tWriteMode\022\032\n\026WR" - + "ITE_MODE_UNSPECIFIED\020\000\022\n\n\006INSERT\020\001:v\352As\n" - + "*bigquerystorage.googleapis.com/WriteStr" - + "eam\022Eprojects/{project}/datasets/{datase" - + "t}/tables/{table}/streams/{stream}*>\n\nDa" - + "taFormat\022\033\n\027DATA_FORMAT_UNSPECIFIED\020\000\022\010\n" - + "\004AVRO\020\001\022\t\n\005ARROW\020\002B\304\001\n$com.google.cloud." - + "bigquery.storage.v1B\013StreamProtoP\001ZGgoog" - + "le.golang.org/genproto/googleapis/cloud/" - + "bigquery/storage/v1;storage\252\002 Google.Clo" - + "ud.BigQuery.Storage.V1\312\002 Google\\Cloud\\Bi" - + "gQuery\\Storage\\V1b\006proto3" + + "v1.WriteStream.WriteModeB\003\340A\005\022\025\n\010locatio" + + "n\030\010 \001(\tB\003\340A\005\"F\n\004Type\022\024\n\020TYPE_UNSPECIFIED" + + "\020\000\022\r\n\tCOMMITTED\020\001\022\013\n\007PENDING\020\002\022\014\n\010BUFFER" + + "ED\020\003\"3\n\tWriteMode\022\032\n\026WRITE_MODE_UNSPECIF" + + "IED\020\000\022\n\n\006INSERT\020\001:v\352As\n*bigquerystorage." + + "googleapis.com/WriteStream\022Eprojects/{pr" + + "oject}/datasets/{dataset}/tables/{table}" + + "/streams/{stream}*>\n\nDataFormat\022\033\n\027DATA_" + + "FORMAT_UNSPECIFIED\020\000\022\010\n\004AVRO\020\001\022\t\n\005ARROW\020" + + "\002*I\n\017WriteStreamView\022!\n\035WRITE_STREAM_VIE" + + "W_UNSPECIFIED\020\000\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\002B\304\001\n" + + "$com.google.cloud.bigquery.storage.v1B\013S" + + "treamProtoP\001ZGgoogle.golang.org/genproto" + + "/googleapis/cloud/bigquery/storage/v1;st" + + "orage\252\002 Google.Cloud.BigQuery.Storage.V1" + + "\312\002 Google\\Cloud\\BigQuery\\Storage\\V1b\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -189,7 +192,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_storage_v1_WriteStream_descriptor, new java.lang.String[] { - "Name", "Type", "CreateTime", "CommitTime", "TableSchema", "WriteMode", + "Name", "Type", "CreateTime", "CommitTime", "TableSchema", "WriteMode", "Location", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java index ad94a441a4..be224223f2 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java @@ -41,6 +41,7 @@ private WriteStream() { name_ = ""; type_ = 0; writeMode_ = 0; + location_ = ""; } @java.lang.Override @@ -139,6 +140,13 @@ private WriteStream( writeMode_ = rawValue; break; } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + location_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -801,6 +809,59 @@ public com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode getWriteMode() : result; } + public static final int LOCATION_FIELD_NUMBER = 8; + private volatile java.lang.Object location_; + /** + * + * + *
+   * Immutable. The geographic location where the stream's dataset resides. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The geographic location where the stream's dataset resides. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -836,6 +897,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(7, writeMode_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, location_); + } unknownFields.writeTo(output); } @@ -866,6 +930,9 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, writeMode_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, location_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -897,6 +964,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTableSchema().equals(other.getTableSchema())) return false; } if (writeMode_ != other.writeMode_) return false; + if (!getLocation().equals(other.getLocation())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -926,6 +994,8 @@ public int hashCode() { } hash = (37 * hash) + WRITE_MODE_FIELD_NUMBER; hash = (53 * hash) + writeMode_; + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1095,6 +1165,8 @@ public Builder clear() { } writeMode_ = 0; + location_ = ""; + return this; } @@ -1140,6 +1212,7 @@ public com.google.cloud.bigquery.storage.v1.WriteStream buildPartial() { result.tableSchema_ = tableSchemaBuilder_.build(); } result.writeMode_ = writeMode_; + result.location_ = location_; onBuilt(); return result; } @@ -1209,6 +1282,10 @@ public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.WriteStream other) if (other.writeMode_ != 0) { setWriteModeValue(other.getWriteModeValue()); } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2224,6 +2301,122 @@ public Builder clearWriteMode() { return this; } + private java.lang.Object location_ = ""; + /** + * + * + *
+     * Immutable. The geographic location where the stream's dataset resides. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The geographic location where the stream's dataset resides. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The geographic location where the stream's dataset resides. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The geographic location where the stream's dataset resides. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The geographic location where the stream's dataset resides. See
+     * https://cloud.google.com/bigquery/docs/locations for supported
+     * locations.
+     * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java index 029de2eff0..27aca3d4f1 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java @@ -245,4 +245,33 @@ public interface WriteStreamOrBuilder * @return The writeMode. */ com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode getWriteMode(); + + /** + * + * + *
+   * Immutable. The geographic location where the stream's dataset resides. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * Immutable. The geographic location where the stream's dataset resides. See
+   * https://cloud.google.com/bigquery/docs/locations for supported
+   * locations.
+   * 
+ * + * string location = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); } diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamView.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamView.java new file mode 100644 index 0000000000..7382e19730 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamView.java @@ -0,0 +1,185 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/storage/v1/stream.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * WriteStreamView is a view enum that controls what details about a write
+ * stream should be returned.
+ * 
+ * + * Protobuf enum {@code google.cloud.bigquery.storage.v1.WriteStreamView} + */ +public enum WriteStreamView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The default / unset value.
+   * 
+ * + * WRITE_STREAM_VIEW_UNSPECIFIED = 0; + */ + WRITE_STREAM_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * The BASIC projection returns basic metadata about a write stream.  The
+   * basic view does not include schema information.  This is the default view
+   * returned by GetWriteStream.
+   * 
+ * + * BASIC = 1; + */ + BASIC(1), + /** + * + * + *
+   * The FULL projection returns all available write stream metadata, including
+   * the schema.  CreateWriteStream returns the full projection of write stream
+   * metadata.
+   * 
+ * + * FULL = 2; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The default / unset value.
+   * 
+ * + * WRITE_STREAM_VIEW_UNSPECIFIED = 0; + */ + public static final int WRITE_STREAM_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The BASIC projection returns basic metadata about a write stream.  The
+   * basic view does not include schema information.  This is the default view
+   * returned by GetWriteStream.
+   * 
+ * + * BASIC = 1; + */ + public static final int BASIC_VALUE = 1; + /** + * + * + *
+   * The FULL projection returns all available write stream metadata, including
+   * the schema.  CreateWriteStream returns the full projection of write stream
+   * metadata.
+   * 
+ * + * FULL = 2; + */ + public static final int FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WriteStreamView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static WriteStreamView forNumber(int value) { + switch (value) { + case 0: + return WRITE_STREAM_VIEW_UNSPECIFIED; + case 1: + return BASIC; + case 2: + return FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public WriteStreamView findValueByNumber(int number) { + return WriteStreamView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto.getDescriptor().getEnumTypes().get(1); + } + + private static final WriteStreamView[] VALUES = values(); + + public static WriteStreamView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private WriteStreamView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.storage.v1.WriteStreamView) +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto index e0b25c1afe..a49e1a389c 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto @@ -524,6 +524,10 @@ message GetWriteStreamRequest { type: "bigquerystorage.googleapis.com/WriteStream" } ]; + + // Indicates whether to get full or partial view of the WriteStream. If + // not set, view returned will be basic. + WriteStreamView view = 3; } // Request message for `BatchCommitWriteStreams`. diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto index 3735c73d67..fe71adfa6b 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto @@ -203,6 +203,23 @@ message ReadStream { string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// WriteStreamView is a view enum that controls what details about a write +// stream should be returned. +enum WriteStreamView { + // The default / unset value. + WRITE_STREAM_VIEW_UNSPECIFIED = 0; + + // The BASIC projection returns basic metadata about a write stream. The + // basic view does not include schema information. This is the default view + // returned by GetWriteStream. + BASIC = 1; + + // The FULL projection returns all available write stream metadata, including + // the schema. CreateWriteStream returns the full projection of write stream + // metadata. + FULL = 2; +} + // Information about a single stream that gets data inside the storage system. message WriteStream { option (google.api.resource) = { @@ -261,4 +278,9 @@ message WriteStream { // Immutable. Mode of the stream. WriteMode write_mode = 7 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The geographic location where the stream's dataset resides. See + // https://cloud.google.com/bigquery/docs/locations for supported + // locations. + string location = 8 [(google.api.field_behavior) = IMMUTABLE]; } From 3279ef42e915881c255a8db8e677799f530c5d53 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 06:10:28 +0200 Subject: [PATCH 06/15] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 (#1772) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.1` -> `3.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/compatibility-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/confidence-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.2`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​302-httpsgithubcomgoogleapisjava-shared-dependenciescomparev301v302-2022-09-08) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.1...v3.0.2) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#​789](https://togithub.com/googleapis/java-shared-dependencies/issues/789)) ([6cf91a9](https://togithub.com/googleapis/java-shared-dependencies/commit/6cf91a96b9ea6af0fb845b50582dac7aa2892cab)) - Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#​781](https://togithub.com/googleapis/java-shared-dependencies/issues/781)) ([8859e61](https://togithub.com/googleapis/java-shared-dependencies/commit/8859e61808bfc5cd9546e27e945fc855b36d2554)) - Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#​790](https://togithub.com/googleapis/java-shared-dependencies/issues/790)) ([3431a47](https://togithub.com/googleapis/java-shared-dependencies/commit/3431a471cbf874a67a4f1a42e31f0ed891dedc92)) - Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#​773](https://togithub.com/googleapis/java-shared-dependencies/issues/773)) ([27fc79f](https://togithub.com/googleapis/java-shared-dependencies/commit/27fc79f00ee70011df6a368bb8fcfad7f0ce41f0)) - Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#​776](https://togithub.com/googleapis/java-shared-dependencies/issues/776)) ([bf333b8](https://togithub.com/googleapis/java-shared-dependencies/commit/bf333b8c88072d21cb959db4d3328bbb55d9ef5c)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#​780](https://togithub.com/googleapis/java-shared-dependencies/issues/780)) ([da7f44d](https://togithub.com/googleapis/java-shared-dependencies/commit/da7f44d71d6d7f372b5313dab68ce220308614d4)) - Update dependency io.grpc:grpc-bom to v1.48.1 ([#​768](https://togithub.com/googleapis/java-shared-dependencies/issues/768)) ([5c7768d](https://togithub.com/googleapis/java-shared-dependencies/commit/5c7768d3c9665dd356de6c39c0a6a5fa6e992f2e)) - Update dependency io.grpc:grpc-bom to v1.49.0 ([#​786](https://togithub.com/googleapis/java-shared-dependencies/issues/786)) ([8734812](https://togithub.com/googleapis/java-shared-dependencies/commit/8734812f1b4e2faaa48caf41eff59a85892ae344)) - Update dependency org.checkerframework:checker-qual to v3.24.0 ([#​775](https://togithub.com/googleapis/java-shared-dependencies/issues/775)) ([df74b7b](https://togithub.com/googleapis/java-shared-dependencies/commit/df74b7b0dd5dd592523f302d9fb36adb5991cb0b)) - Update dependency org.checkerframework:checker-qual to v3.25.0 ([#​788](https://togithub.com/googleapis/java-shared-dependencies/issues/788)) ([207035b](https://togithub.com/googleapis/java-shared-dependencies/commit/207035bd04c9305899eea540acbefaf06a7b1ec9)) - Update dependency org.threeten:threetenbp to v1.6.1 ([#​782](https://togithub.com/googleapis/java-shared-dependencies/issues/782)) ([0f218ae](https://togithub.com/googleapis/java-shared-dependencies/commit/0f218aeb6aa33cf1da4a8b1d6c82bbf87946dab9)) - Update gax.version to v2.19.0 ([#​785](https://togithub.com/googleapis/java-shared-dependencies/issues/785)) ([4448331](https://togithub.com/googleapis/java-shared-dependencies/commit/4448331c4c6d88ea8076260776d1d47d24aa19fa)) - Update google.core.version to v2.8.10 ([#​787](https://togithub.com/googleapis/java-shared-dependencies/issues/787)) ([3c344d5](https://togithub.com/googleapis/java-shared-dependencies/commit/3c344d515e3b9215db5a1f8ef550d800d974e558)) - Update google.core.version to v2.8.7 ([#​774](https://togithub.com/googleapis/java-shared-dependencies/issues/774)) ([d0cd5e8](https://togithub.com/googleapis/java-shared-dependencies/commit/d0cd5e8f6ca88787fe0dbf7f30c849cb4c4fae5e)) - Update google.core.version to v2.8.8 ([#​777](https://togithub.com/googleapis/java-shared-dependencies/issues/777)) ([f00571c](https://togithub.com/googleapis/java-shared-dependencies/commit/f00571cd1e9f1c4e011fba4a1e1674c1d8d60200)) - Update google.core.version to v2.8.9 ([#​784](https://togithub.com/googleapis/java-shared-dependencies/issues/784)) ([aa8e505](https://togithub.com/googleapis/java-shared-dependencies/commit/aa8e505dbb1214b2239e55d5ac83b00c167d77e4))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerystorage). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 85fbad8bc2..3db155c60f 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.1 + 3.0.2 pom import From 450f8fff7a9dfd1ec157c62ac32c66830086442a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 10 Sep 2022 02:14:24 +0000 Subject: [PATCH 07/15] chore: Generated snippets should not be owned by samples reviewers (#1575) (#1775) Source-Link: https://github.com/googleapis/synthtool/commit/2e9ac19d5b8181af77cdc5337cf922517813cc49 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93 --- .github/.OwlBot.lock.yaml | 3 +-- .github/CODEOWNERS | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a20fd63005..6259292301 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:7a9a7eb50ca2af5bfffab3abd2f38d408735c990a74bacf9b7fde2af0a086a0b -# created: 2022-08-01T15:27:14.757266067Z + digest: sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e5cf90602f..6aaf5360dd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,3 +13,6 @@ # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/java-samples-reviewers + +# Generated snippets should not be owned by samples reviewers +samples/snippets/generated/ @googleapis/yoshi-java From 1a079ee0761bad2e942081f7f02b530f32e55afe Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 23:08:12 +0000 Subject: [PATCH 08/15] feat: add proto annotation for non-ascii field mapping (#1776) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 473815595 Source-Link: https://github.com/googleapis/googleapis/commit/46cfc4c8d90cad2a878bac4f15aa5c8683374ec3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/955ca31d81100d81ed7e0ae0522358ac45d53cc9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTU1Y2EzMWQ4MTEwMGQ4MWVkN2UwYWUwNTIyMzU4YWM0NWQ1M2NjOSJ9 --- .../bigquery/storage/v1/AnnotationsProto.java | 86 +++++++++++++++++++ .../bigquery/storage/v1/annotations.proto | 28 ++++++ 2 files changed, 114 insertions(+) create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AnnotationsProto.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/annotations.proto diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AnnotationsProto.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AnnotationsProto.java new file mode 100644 index 0000000000..cc19833bb5 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AnnotationsProto.java @@ -0,0 +1,86 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/storage/v1/annotations.proto + +package com.google.cloud.bigquery.storage.v1; + +public final class AnnotationsProto { + private AnnotationsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.cloud.bigquery.storage.v1.AnnotationsProto.columnName); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int COLUMN_NAME_FIELD_NUMBER = 454943157; + /** + * + * + *
+   * Setting the column_name extension allows users to reference
+   * bigquery column independently of the field name in the protocol buffer
+   * message.
+   * The intended use of this annotation is to reference a destination column
+   * named using characters unavailable for protobuf field names (e.g. unicode
+   * characters).
+   * More details about BigQuery naming limitations can be found here:
+   * https://cloud.google.com/bigquery/docs/schemas#column_names
+   * This extension is currently experimental.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, java.lang.String> + columnName = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + java.lang.String.class, null); + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/bigquery/storage/v1/annot" + + "ations.proto\022 google.cloud.bigquery.stor" + + "age.v1\032 google/protobuf/descriptor.proto" + + ":9\n\013column_name\022\035.google.protobuf.FieldO" + + "ptions\030\265\303\367\330\001 \001(\t\210\001\001B\311\001\n$com.google.cloud" + + ".bigquery.storage.v1B\020AnnotationsProtoP\001" + + "ZGgoogle.golang.org/genproto/googleapis/" + + "cloud/bigquery/storage/v1;storage\252\002 Goog" + + "le.Cloud.BigQuery.Storage.V1\312\002 Google\\Cl" + + "oud\\BigQuery\\Storage\\V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + columnName.internalInit(descriptor.getExtensions().get(0)); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/annotations.proto b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/annotations.proto new file mode 100644 index 0000000000..1627fd12a0 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/annotations.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +import "google/protobuf/descriptor.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; + +extend google.protobuf.FieldOptions { + // Setting the column_name extension allows users to reference + // bigquery column independently of the field name in the protocol buffer + // message. + // + // The intended use of this annotation is to reference a destination column + // named using characters unavailable for protobuf field names (e.g. unicode + // characters). + // + // More details about BigQuery naming limitations can be found here: + // https://cloud.google.com/bigquery/docs/schemas#column_names + // + // This extension is currently experimental. + optional string column_name = 454943157; +} From 08a7c8f1dde71f48706bb0b1aa780f79012594bf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 13 Sep 2022 17:59:16 +0200 Subject: [PATCH 09/15] deps: update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 (#1777) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- tutorials/JsonWriterDefaultStream/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 3db155c60f..cf735e4900 100644 --- a/pom.xml +++ b/pom.xml @@ -132,7 +132,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.16.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a27de5a938..1b738e283b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -37,7 +37,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.16.0 org.apache.avro diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7b05443f83..ef0efc6eba 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -36,7 +36,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.16.0 org.apache.avro diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 20f44d28a3..93aa5bd6d3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -48,7 +48,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.16.0 org.apache.avro diff --git a/tutorials/JsonWriterDefaultStream/pom.xml b/tutorials/JsonWriterDefaultStream/pom.xml index 63fa79ca0f..19f3e660cf 100644 --- a/tutorials/JsonWriterDefaultStream/pom.xml +++ b/tutorials/JsonWriterDefaultStream/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.16.0 org.apache.avro From 7dd447da206cdd7a403191bd15203bb4cc53ccb5 Mon Sep 17 00:00:00 2001 From: Gaole Meng Date: Tue, 13 Sep 2022 10:25:31 -0700 Subject: [PATCH 10/15] feat: Split writer into connection worker and wrapper, this is a (#1774) prerequisite for multiplexing client --- .github/.OwlBot.yaml | 1 + .../bigquery/storage/v1/ConnectionWorker.java | 675 ++++++++++++++++++ .../bigquery/storage/v1/StreamWriter.java | 613 +--------------- 3 files changed, 699 insertions(+), 590 deletions(-) create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index 1a3a604eaf..ec7bb13f06 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -77,6 +77,7 @@ deep-preserve-regex: - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1.*/StreamWriterV2.java" - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1.*/Waiter.java" - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/Exceptions.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java" deep-copy-regex: - source: "/google/cloud/bigquery/storage/(v.*)/.*-java/proto-google-.*/src" diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java new file mode 100644 index 0000000000..36bf7bbaa7 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java @@ -0,0 +1,675 @@ +/* + * Copyright 2022 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 + * + * https://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. + */ +package com.google.cloud.bigquery.storage.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.batching.FlowController; +import com.google.cloud.bigquery.storage.util.Errors; +import com.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData; +import com.google.cloud.bigquery.storage.v1.StreamConnection.DoneCallback; +import com.google.cloud.bigquery.storage.v1.StreamConnection.RequestCallback; +import com.google.common.util.concurrent.Uninterruptibles; +import com.google.protobuf.Int64Value; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Deque; +import java.util.LinkedList; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.concurrent.GuardedBy; + +/** + * A BigQuery Stream Writer that can be used to write data into BigQuery Table. + * + *

TODO: Support batching. + */ +public class ConnectionWorker implements AutoCloseable { + private static final Logger log = Logger.getLogger(StreamWriter.class.getName()); + + private Lock lock; + private Condition hasMessageInWaitingQueue; + private Condition inflightReduced; + + /* + * The identifier of stream to write to. + */ + private final String streamName; + + /* + * The proto schema of rows to write. + */ + private final ProtoSchema writerSchema; + + /* + * Max allowed inflight requests in the stream. Method append is blocked at this. + */ + private final long maxInflightRequests; + + /* + * Max allowed inflight bytes in the stream. Method append is blocked at this. + */ + private final long maxInflightBytes; + + /* + * Behavior when inflight queue is exceeded. Only supports Block or Throw, default is Block. + */ + private final FlowController.LimitExceededBehavior limitExceededBehavior; + + /* + * TraceId for debugging purpose. + */ + private final String traceId; + + /* + * Tracks current inflight requests in the stream. + */ + @GuardedBy("lock") + private long inflightRequests = 0; + + /* + * Tracks current inflight bytes in the stream. + */ + @GuardedBy("lock") + private long inflightBytes = 0; + + /* + * Tracks how often the stream was closed due to a retriable error. Streaming will stop when the + * count hits a threshold. Streaming should only be halted, if it isn't possible to establish a + * connection. Keep track of the number of reconnections in succession. This will be reset if + * a row is successfully called back. + */ + @GuardedBy("lock") + private long conectionRetryCountWithoutCallback = 0; + + /* + * If false, streamConnection needs to be reset. + */ + @GuardedBy("lock") + private boolean streamConnectionIsConnected = false; + + /* + * A boolean to track if we cleaned up inflight queue. + */ + @GuardedBy("lock") + private boolean inflightCleanuped = false; + + /* + * Indicates whether user has called Close() or not. + */ + @GuardedBy("lock") + private boolean userClosed = false; + + /* + * The final status of connection. Set to nonnull when connection is permanently closed. + */ + @GuardedBy("lock") + private Throwable connectionFinalStatus = null; + + /* + * Contains requests buffered in the client and not yet sent to server. + */ + @GuardedBy("lock") + private final Deque waitingRequestQueue; + + /* + * Contains sent append requests waiting for response from server. + */ + @GuardedBy("lock") + private final Deque inflightRequestQueue; + + /* + * Contains the updated TableSchema. + */ + @GuardedBy("lock") + private TableSchema updatedSchema; + + /* + * A client used to interact with BigQuery. + */ + private BigQueryWriteClient client; + + /* + * If true, the client above is created by this writer and should be closed. + */ + private boolean ownsBigQueryWriteClient = false; + + /* + * Wraps the underlying bi-directional stream connection with server. + */ + private StreamConnection streamConnection; + + /* + * A separate thread to handle actual communication with server. + */ + private Thread appendThread; + + /* + * The inflight wait time for the previous sent request. + */ + private final AtomicLong inflightWaitSec = new AtomicLong(0); + + /* + * A String that uniquely identifies this writer. + */ + private final String writerId = UUID.randomUUID().toString(); + + /** The maximum size of one request. Defined by the API. */ + public static long getApiMaxRequestBytes() { + return 10L * 1000L * 1000L; // 10 megabytes (https://en.wikipedia.org/wiki/Megabyte) + } + + public ConnectionWorker( + String streamName, + ProtoSchema writerSchema, + long maxInflightRequests, + long maxInflightBytes, + FlowController.LimitExceededBehavior limitExceededBehavior, + String traceId, + BigQueryWriteClient client, + boolean ownsBigQueryWriteClient) + throws IOException { + this.lock = new ReentrantLock(); + this.hasMessageInWaitingQueue = lock.newCondition(); + this.inflightReduced = lock.newCondition(); + this.streamName = streamName; + if (writerSchema == null) { + throw new StatusRuntimeException( + Status.fromCode(Code.INVALID_ARGUMENT) + .withDescription("Writer schema must be provided when building this writer.")); + } + this.writerSchema = writerSchema; + this.maxInflightRequests = maxInflightRequests; + this.maxInflightBytes = maxInflightBytes; + this.limitExceededBehavior = limitExceededBehavior; + this.traceId = traceId; + this.waitingRequestQueue = new LinkedList(); + this.inflightRequestQueue = new LinkedList(); + this.client = client; + this.ownsBigQueryWriteClient = ownsBigQueryWriteClient; + + this.appendThread = + new Thread( + new Runnable() { + @Override + public void run() { + appendLoop(); + } + }); + this.appendThread.start(); + } + + private void resetConnection() { + this.streamConnection = + new StreamConnection( + this.client, + new RequestCallback() { + @Override + public void run(AppendRowsResponse response) { + requestCallback(response); + } + }, + new DoneCallback() { + @Override + public void run(Throwable finalStatus) { + doneCallback(finalStatus); + } + }); + } + + /** Schedules the writing of rows at the end of current stream. */ + public ApiFuture append(ProtoRows rows) { + return append(rows, -1); + } + + /** Schedules the writing of rows at given offset. */ + public ApiFuture append(ProtoRows rows, long offset) { + AppendRowsRequest.Builder requestBuilder = AppendRowsRequest.newBuilder(); + requestBuilder.setProtoRows(ProtoData.newBuilder().setRows(rows).build()); + if (offset >= 0) { + requestBuilder.setOffset(Int64Value.of(offset)); + } + return appendInternal(requestBuilder.build()); + } + + private ApiFuture appendInternal(AppendRowsRequest message) { + AppendRequestAndResponse requestWrapper = new AppendRequestAndResponse(message); + if (requestWrapper.messageSize > getApiMaxRequestBytes()) { + requestWrapper.appendResult.setException( + new StatusRuntimeException( + Status.fromCode(Code.INVALID_ARGUMENT) + .withDescription( + "MessageSize is too large. Max allow: " + + getApiMaxRequestBytes() + + " Actual: " + + requestWrapper.messageSize))); + return requestWrapper.appendResult; + } + this.lock.lock(); + try { + if (userClosed) { + requestWrapper.appendResult.setException( + new Exceptions.StreamWriterClosedException( + Status.fromCode(Status.Code.FAILED_PRECONDITION) + .withDescription("Connection is already closed"), + streamName, + writerId)); + return requestWrapper.appendResult; + } + // Check if queue is going to be full before adding the request. + if (this.limitExceededBehavior == FlowController.LimitExceededBehavior.ThrowException) { + if (this.inflightRequests + 1 >= this.maxInflightRequests) { + throw new Exceptions.InflightRequestsLimitExceededException( + writerId, this.maxInflightRequests); + } + if (this.inflightBytes + requestWrapper.messageSize >= this.maxInflightBytes) { + throw new Exceptions.InflightBytesLimitExceededException(writerId, this.maxInflightBytes); + } + } + + if (connectionFinalStatus != null) { + requestWrapper.appendResult.setException( + new Exceptions.StreamWriterClosedException( + Status.fromCode(Status.Code.FAILED_PRECONDITION) + .withDescription( + "Connection is closed due to " + connectionFinalStatus.toString()), + streamName, + writerId)); + return requestWrapper.appendResult; + } + + ++this.inflightRequests; + this.inflightBytes += requestWrapper.messageSize; + waitingRequestQueue.addLast(requestWrapper); + hasMessageInWaitingQueue.signal(); + maybeWaitForInflightQuota(); + return requestWrapper.appendResult; + } finally { + this.lock.unlock(); + } + } + + @GuardedBy("lock") + private void maybeWaitForInflightQuota() { + long start_time = System.currentTimeMillis(); + while (this.inflightRequests >= this.maxInflightRequests + || this.inflightBytes >= this.maxInflightBytes) { + try { + inflightReduced.await(100, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + log.warning( + "Interrupted while waiting for inflight quota. Stream: " + + streamName + + " Error: " + + e.toString()); + throw new StatusRuntimeException( + Status.fromCode(Code.CANCELLED) + .withCause(e) + .withDescription("Interrupted while waiting for quota.")); + } + } + inflightWaitSec.set((System.currentTimeMillis() - start_time) / 1000); + } + + public long getInflightWaitSeconds() { + return inflightWaitSec.longValue(); + } + + /** @return a unique Id for the writer. */ + public String getWriterId() { + return writerId; + } + + /** Close the stream writer. Shut down all resources. */ + @Override + public void close() { + log.info("User closing stream: " + streamName); + this.lock.lock(); + try { + this.userClosed = true; + } finally { + this.lock.unlock(); + } + log.fine("Waiting for append thread to finish. Stream: " + streamName); + try { + appendThread.join(); + log.info("User close complete. Stream: " + streamName); + } catch (InterruptedException e) { + // Unexpected. Just swallow the exception with logging. + log.warning( + "Append handler join is interrupted. Stream: " + streamName + " Error: " + e.toString()); + } + if (this.ownsBigQueryWriteClient) { + this.client.close(); + try { + // Backend request has a 2 minute timeout, so wait a little longer than that. + this.client.awaitTermination(150, TimeUnit.SECONDS); + } catch (InterruptedException ignored) { + } + } + } + + /* + * This loop is executed in a separate thread. + * + * It takes requests from waiting queue and sends them to server. + */ + private void appendLoop() { + Deque localQueue = new LinkedList(); + boolean streamNeedsConnecting = false; + // Set firstRequestInConnection to true immediately after connecting the steam, + // indicates then next row sent, needs the schema and other metadata. + boolean isFirstRequestInConnection = true; + while (!waitingQueueDrained()) { + this.lock.lock(); + try { + hasMessageInWaitingQueue.await(100, TimeUnit.MILLISECONDS); + // Copy the streamConnectionIsConnected guarded by lock to a local variable. + // In addition, only reconnect if there is a retriable error. + streamNeedsConnecting = !streamConnectionIsConnected && connectionFinalStatus == null; + if (streamNeedsConnecting) { + // If the stream connection is broken, any requests on inflightRequestQueue will need + // to be resent, as the new connection has no knowledge of the requests. Copy the requests + // from inflightRequestQueue and prepent them onto the waitinRequestQueue. They need to be + // prepended as they need to be sent before new requests. + while (!inflightRequestQueue.isEmpty()) { + waitingRequestQueue.addFirst(inflightRequestQueue.pollLast()); + } + } + while (!this.waitingRequestQueue.isEmpty()) { + AppendRequestAndResponse requestWrapper = this.waitingRequestQueue.pollFirst(); + this.inflightRequestQueue.addLast(requestWrapper); + localQueue.addLast(requestWrapper); + } + } catch (InterruptedException e) { + log.warning( + "Interrupted while waiting for message. Stream: " + + streamName + + " Error: " + + e.toString()); + } finally { + this.lock.unlock(); + } + + if (localQueue.isEmpty()) { + continue; + } + if (streamNeedsConnecting) { + // Set streamConnectionIsConnected to true, to indicate the stream has been connected. This + // should happen before the call to resetConnection. As it is unknown when the connection + // could be closed and the doneCallback called, and thus clearing the flag. + lock.lock(); + try { + this.streamConnectionIsConnected = true; + } finally { + lock.unlock(); + } + resetConnection(); + // Set firstRequestInConnection to indicate the next request to be sent should include + // metedata. + isFirstRequestInConnection = true; + } + while (!localQueue.isEmpty()) { + AppendRowsRequest preparedRequest = + prepareRequestBasedOnPosition( + localQueue.pollFirst().message, isFirstRequestInConnection); + // Send should only throw an exception if there is a problem with the request. The catch + // block will handle this case, and return the exception with the result. + // Otherwise send will return: + // SUCCESS: Message was sent, wait for the callback. + // STREAM_CLOSED: Stream was closed, normally or due to en error + // NOT_ENOUGH_QUOTA: Message wasn't sent due to not enough quota. + // TODO: Handle NOT_ENOUGH_QUOTA. + // In the close case, the request is in the inflight queue, and will either be returned + // to the user with an error, or will be resent. + this.streamConnection.send(preparedRequest); + isFirstRequestInConnection = false; + } + } + + log.fine("Cleanup starts. Stream: " + streamName); + // At this point, the waiting queue is drained, so no more requests. + // We can close the stream connection and handle the remaining inflight requests. + if (streamConnection != null) { + this.streamConnection.close(); + waitForDoneCallback(3, TimeUnit.MINUTES); + } + + // At this point, there cannot be more callback. It is safe to clean up all inflight requests. + log.fine( + "Stream connection is fully closed. Cleaning up inflight requests. Stream: " + streamName); + cleanupInflightRequests(); + log.fine("Append thread is done. Stream: " + streamName); + } + + /* + * Returns true if waiting queue is drain, a.k.a. no more requests in the waiting queue. + * + * It serves as a signal to append thread that there cannot be any more requests in the waiting + * queue and it can prepare to stop. + */ + private boolean waitingQueueDrained() { + this.lock.lock(); + try { + return (this.userClosed || this.connectionFinalStatus != null) + && this.waitingRequestQueue.isEmpty(); + } finally { + this.lock.unlock(); + } + } + + private void waitForDoneCallback(long duration, TimeUnit timeUnit) { + log.fine("Waiting for done callback from stream connection. Stream: " + streamName); + long deadline = System.nanoTime() + timeUnit.toNanos(duration); + while (System.nanoTime() <= deadline) { + this.lock.lock(); + try { + if (!this.streamConnectionIsConnected) { + // Done callback is received, return. + return; + } + } finally { + this.lock.unlock(); + } + Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS); + } + this.lock.lock(); + try { + if (connectionFinalStatus == null) { + connectionFinalStatus = + new StatusRuntimeException( + Status.fromCode(Code.CANCELLED) + .withDescription("Timeout waiting for DoneCallback.")); + } + } finally { + this.lock.unlock(); + } + + return; + } + + private AppendRowsRequest prepareRequestBasedOnPosition( + AppendRowsRequest original, boolean isFirstRequest) { + AppendRowsRequest.Builder requestBuilder = original.toBuilder(); + if (isFirstRequest) { + if (this.writerSchema != null) { + requestBuilder.getProtoRowsBuilder().setWriterSchema(this.writerSchema); + } + requestBuilder.setWriteStream(this.streamName); + if (this.traceId != null) { + requestBuilder.setTraceId(this.traceId); + } + } else { + requestBuilder.clearWriteStream(); + requestBuilder.getProtoRowsBuilder().clearWriterSchema(); + } + return requestBuilder.build(); + } + + private void cleanupInflightRequests() { + Throwable finalStatus = + new Exceptions.StreamWriterClosedException( + Status.fromCode(Status.Code.FAILED_PRECONDITION) + .withDescription("Connection is already closed, cleanup inflight request"), + streamName, + writerId); + Deque localQueue = new LinkedList(); + this.lock.lock(); + try { + if (this.connectionFinalStatus != null) { + finalStatus = this.connectionFinalStatus; + } + while (!this.inflightRequestQueue.isEmpty()) { + localQueue.addLast(pollInflightRequestQueue()); + } + this.inflightCleanuped = true; + } finally { + this.lock.unlock(); + } + log.fine("Cleaning " + localQueue.size() + " inflight requests with error: " + finalStatus); + while (!localQueue.isEmpty()) { + localQueue.pollFirst().appendResult.setException(finalStatus); + } + } + + private void requestCallback(AppendRowsResponse response) { + AppendRequestAndResponse requestWrapper; + this.lock.lock(); + if (response.hasUpdatedSchema()) { + this.updatedSchema = response.getUpdatedSchema(); + } + try { + // Had a successful connection with at least one result, reset retries. + // conectionRetryCountWithoutCallback is reset so that only multiple retries, without + // successful records sent, will cause the stream to fail. + if (conectionRetryCountWithoutCallback != 0) { + conectionRetryCountWithoutCallback = 0; + } + if (!this.inflightRequestQueue.isEmpty()) { + requestWrapper = pollInflightRequestQueue(); + } else if (inflightCleanuped) { + // It is possible when requestCallback is called, the inflight queue is already drained + // because we timed out waiting for done. + return; + } else { + // This is something not expected, we shouldn't have an empty inflight queue otherwise. + log.log(Level.WARNING, "Unexpected: request callback called on an empty inflight queue."); + connectionFinalStatus = + new StatusRuntimeException( + Status.fromCode(Code.FAILED_PRECONDITION) + .withDescription("Request callback called on an empty inflight queue.")); + return; + } + } finally { + this.lock.unlock(); + } + if (response.hasError()) { + Exceptions.StorageException storageException = + Exceptions.toStorageException(response.getError(), null); + if (storageException != null) { + requestWrapper.appendResult.setException(storageException); + } else { + StatusRuntimeException exception = + new StatusRuntimeException( + Status.fromCodeValue(response.getError().getCode()) + .withDescription(response.getError().getMessage())); + requestWrapper.appendResult.setException(exception); + } + } else { + requestWrapper.appendResult.set(response); + } + } + + private boolean isRetriableError(Throwable t) { + Status status = Status.fromThrowable(t); + if (Errors.isRetryableInternalStatus(status)) { + return true; + } + return status.getCode() == Code.ABORTED + || status.getCode() == Code.UNAVAILABLE + || status.getCode() == Code.CANCELLED; + } + + private void doneCallback(Throwable finalStatus) { + log.fine( + "Received done callback. Stream: " + + streamName + + " Final status: " + + finalStatus.toString()); + this.lock.lock(); + try { + this.streamConnectionIsConnected = false; + if (connectionFinalStatus == null) { + // If the error can be retried, don't set it here, let it try to retry later on. + if (isRetriableError(finalStatus) && !userClosed) { + this.conectionRetryCountWithoutCallback++; + log.fine( + "Retriable error " + + finalStatus.toString() + + " received, retry count " + + conectionRetryCountWithoutCallback + + " for stream " + + streamName); + } else { + Exceptions.StorageException storageException = Exceptions.toStorageException(finalStatus); + this.connectionFinalStatus = storageException != null ? storageException : finalStatus; + log.info( + "Connection finished with error " + + finalStatus.toString() + + " for stream " + + streamName); + } + } + } finally { + this.lock.unlock(); + } + } + + @GuardedBy("lock") + private AppendRequestAndResponse pollInflightRequestQueue() { + AppendRequestAndResponse requestWrapper = this.inflightRequestQueue.pollFirst(); + --this.inflightRequests; + this.inflightBytes -= requestWrapper.messageSize; + this.inflightReduced.signal(); + return requestWrapper; + } + + /** Thread-safe getter of updated TableSchema */ + public synchronized TableSchema getUpdatedSchema() { + return this.updatedSchema; + } + + // Class that wraps AppendRowsRequest and its corresponding Response future. + private static final class AppendRequestAndResponse { + final SettableApiFuture appendResult; + final AppendRowsRequest message; + final long messageSize; + + AppendRequestAndResponse(AppendRowsRequest message) { + this.appendResult = SettableApiFuture.create(); + this.message = message; + this.messageSize = message.getProtoRows().getSerializedSize(); + } + } +} diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java index 151321e248..35eca74eec 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java @@ -16,33 +16,17 @@ package com.google.cloud.bigquery.storage.v1; import com.google.api.core.ApiFuture; -import com.google.api.core.SettableApiFuture; import com.google.api.gax.batching.FlowController; import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.cloud.bigquery.storage.util.Errors; -import com.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData; -import com.google.cloud.bigquery.storage.v1.StreamConnection.DoneCallback; -import com.google.cloud.bigquery.storage.v1.StreamConnection.RequestCallback; import com.google.common.base.Preconditions; -import com.google.common.util.concurrent.Uninterruptibles; -import com.google.protobuf.Int64Value; import io.grpc.Status; import io.grpc.Status.Code; import io.grpc.StatusRuntimeException; import java.io.IOException; -import java.util.Deque; -import java.util.LinkedList; import java.util.UUID; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import java.util.logging.Level; import java.util.logging.Logger; -import javax.annotation.concurrent.GuardedBy; /** * A BigQuery Stream Writer that can be used to write data into BigQuery Table. @@ -52,128 +36,13 @@ public class StreamWriter implements AutoCloseable { private static final Logger log = Logger.getLogger(StreamWriter.class.getName()); - private Lock lock; - private Condition hasMessageInWaitingQueue; - private Condition inflightReduced; + private final ConnectionWorker connectionWorker; /* * The identifier of stream to write to. */ private final String streamName; - /* - * The proto schema of rows to write. - */ - private final ProtoSchema writerSchema; - - /* - * Max allowed inflight requests in the stream. Method append is blocked at this. - */ - private final long maxInflightRequests; - - /* - * Max allowed inflight bytes in the stream. Method append is blocked at this. - */ - private final long maxInflightBytes; - - /* - * Behavior when inflight queue is exceeded. Only supports Block or Throw, default is Block. - */ - private final FlowController.LimitExceededBehavior limitExceededBehavior; - - /* - * TraceId for debugging purpose. - */ - private final String traceId; - - /* - * Tracks current inflight requests in the stream. - */ - @GuardedBy("lock") - private long inflightRequests = 0; - - /* - * Tracks current inflight bytes in the stream. - */ - @GuardedBy("lock") - private long inflightBytes = 0; - - /* - * Tracks how often the stream was closed due to a retriable error. Streaming will stop when the - * count hits a threshold. Streaming should only be halted, if it isn't possible to establish a - * connection. Keep track of the number of reconnections in succession. This will be reset if - * a row is successfully called back. - */ - @GuardedBy("lock") - private long conectionRetryCountWithoutCallback = 0; - - /* - * If false, streamConnection needs to be reset. - */ - @GuardedBy("lock") - private boolean streamConnectionIsConnected = false; - - /* - * A boolean to track if we cleaned up inflight queue. - */ - @GuardedBy("lock") - private boolean inflightCleanuped = false; - - /* - * Indicates whether user has called Close() or not. - */ - @GuardedBy("lock") - private boolean userClosed = false; - - /* - * The final status of connection. Set to nonnull when connection is permanently closed. - */ - @GuardedBy("lock") - private Throwable connectionFinalStatus = null; - - /* - * Contains requests buffered in the client and not yet sent to server. - */ - @GuardedBy("lock") - private final Deque waitingRequestQueue; - - /* - * Contains sent append requests waiting for response from server. - */ - @GuardedBy("lock") - private final Deque inflightRequestQueue; - - /* - * Contains the updated TableSchema. - */ - @GuardedBy("lock") - private TableSchema updatedSchema; - - /* - * A client used to interact with BigQuery. - */ - private BigQueryWriteClient client; - - /* - * If true, the client above is created by this writer and should be closed. - */ - private boolean ownsBigQueryWriteClient = false; - - /* - * Wraps the underlying bi-directional stream connection with server. - */ - private StreamConnection streamConnection; - - /* - * A separate thread to handle actual communication with server. - */ - private Thread appendThread; - - /* - * The inflight wait time for the previous sent request. - */ - private final AtomicLong inflightWaitSec = new AtomicLong(0); - /* * A String that uniquely identifies this writer. */ @@ -185,22 +54,9 @@ public static long getApiMaxRequestBytes() { } private StreamWriter(Builder builder) throws IOException { - this.lock = new ReentrantLock(); - this.hasMessageInWaitingQueue = lock.newCondition(); - this.inflightReduced = lock.newCondition(); + BigQueryWriteClient client; this.streamName = builder.streamName; - if (builder.writerSchema == null) { - throw new StatusRuntimeException( - Status.fromCode(Code.INVALID_ARGUMENT) - .withDescription("Writer schema must be provided when building this writer.")); - } - this.writerSchema = builder.writerSchema; - this.maxInflightRequests = builder.maxInflightRequest; - this.maxInflightBytes = builder.maxInflightBytes; - this.limitExceededBehavior = builder.limitExceededBehavior; - this.traceId = builder.traceId; - this.waitingRequestQueue = new LinkedList(); - this.inflightRequestQueue = new LinkedList(); + boolean ownsBigQueryWriteClient; if (builder.client == null) { BigQueryWriteSettings stubSettings = BigQueryWriteSettings.newBuilder() @@ -212,40 +68,22 @@ private StreamWriter(Builder builder) throws IOException { FixedHeaderProvider.create( "x-goog-request-params", "write_stream=" + this.streamName)) .build(); - this.client = BigQueryWriteClient.create(stubSettings); - this.ownsBigQueryWriteClient = true; + client = BigQueryWriteClient.create(stubSettings); + ownsBigQueryWriteClient = true; } else { - this.client = builder.client; - this.ownsBigQueryWriteClient = false; - } - - this.appendThread = - new Thread( - new Runnable() { - @Override - public void run() { - appendLoop(); - } - }); - this.appendThread.start(); - } - - private void resetConnection() { - this.streamConnection = - new StreamConnection( - this.client, - new RequestCallback() { - @Override - public void run(AppendRowsResponse response) { - requestCallback(response); - } - }, - new DoneCallback() { - @Override - public void run(Throwable finalStatus) { - doneCallback(finalStatus); - } - }); + client = builder.client; + ownsBigQueryWriteClient = false; + } + connectionWorker = + new ConnectionWorker( + builder.streamName, + builder.writerSchema, + builder.maxInflightRequest, + builder.maxInflightBytes, + builder.limitExceededBehavior, + builder.traceId, + client, + ownsBigQueryWriteClient); } /** @@ -285,91 +123,7 @@ public ApiFuture append(ProtoRows rows) { * @return the append response wrapped in a future. */ public ApiFuture append(ProtoRows rows, long offset) { - AppendRowsRequest.Builder requestBuilder = AppendRowsRequest.newBuilder(); - requestBuilder.setProtoRows(ProtoData.newBuilder().setRows(rows).build()); - if (offset >= 0) { - requestBuilder.setOffset(Int64Value.of(offset)); - } - return appendInternal(requestBuilder.build()); - } - - private ApiFuture appendInternal(AppendRowsRequest message) { - AppendRequestAndResponse requestWrapper = new AppendRequestAndResponse(message); - if (requestWrapper.messageSize > getApiMaxRequestBytes()) { - requestWrapper.appendResult.setException( - new StatusRuntimeException( - Status.fromCode(Code.INVALID_ARGUMENT) - .withDescription( - "MessageSize is too large. Max allow: " - + getApiMaxRequestBytes() - + " Actual: " - + requestWrapper.messageSize))); - return requestWrapper.appendResult; - } - this.lock.lock(); - try { - if (userClosed) { - requestWrapper.appendResult.setException( - new Exceptions.StreamWriterClosedException( - Status.fromCode(Status.Code.FAILED_PRECONDITION) - .withDescription("Connection is already closed"), - streamName, - writerId)); - return requestWrapper.appendResult; - } - // Check if queue is going to be full before adding the request. - if (this.limitExceededBehavior == FlowController.LimitExceededBehavior.ThrowException) { - if (this.inflightRequests + 1 >= this.maxInflightRequests) { - throw new Exceptions.InflightRequestsLimitExceededException( - writerId, this.maxInflightRequests); - } - if (this.inflightBytes + requestWrapper.messageSize >= this.maxInflightBytes) { - throw new Exceptions.InflightBytesLimitExceededException(writerId, this.maxInflightBytes); - } - } - - if (connectionFinalStatus != null) { - requestWrapper.appendResult.setException( - new Exceptions.StreamWriterClosedException( - Status.fromCode(Status.Code.FAILED_PRECONDITION) - .withDescription( - "Connection is closed due to " + connectionFinalStatus.toString()), - streamName, - writerId)); - return requestWrapper.appendResult; - } - - ++this.inflightRequests; - this.inflightBytes += requestWrapper.messageSize; - waitingRequestQueue.addLast(requestWrapper); - hasMessageInWaitingQueue.signal(); - maybeWaitForInflightQuota(); - return requestWrapper.appendResult; - } finally { - this.lock.unlock(); - } - } - - @GuardedBy("lock") - private void maybeWaitForInflightQuota() { - long start_time = System.currentTimeMillis(); - while (this.inflightRequests >= this.maxInflightRequests - || this.inflightBytes >= this.maxInflightBytes) { - try { - inflightReduced.await(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - log.warning( - "Interrupted while waiting for inflight quota. Stream: " - + streamName - + " Error: " - + e.toString()); - throw new StatusRuntimeException( - Status.fromCode(Code.CANCELLED) - .withCause(e) - .withDescription("Interrupted while waiting for quota.")); - } - } - inflightWaitSec.set((System.currentTimeMillis() - start_time) / 1000); + return this.connectionWorker.append(rows, offset); } /** @@ -381,12 +135,12 @@ private void maybeWaitForInflightQuota() { * stream case. */ public long getInflightWaitSeconds() { - return inflightWaitSec.longValue(); + return connectionWorker.getInflightWaitSeconds(); } /** @return a unique Id for the writer. */ public String getWriterId() { - return writerId; + return connectionWorker.getWriterId(); } /** @return name of the Stream that this writer is working on. */ @@ -397,315 +151,7 @@ public String getStreamName() { /** Close the stream writer. Shut down all resources. */ @Override public void close() { - log.info("User closing stream: " + streamName); - this.lock.lock(); - try { - this.userClosed = true; - } finally { - this.lock.unlock(); - } - log.fine("Waiting for append thread to finish. Stream: " + streamName); - try { - appendThread.join(); - log.info("User close complete. Stream: " + streamName); - } catch (InterruptedException e) { - // Unexpected. Just swallow the exception with logging. - log.warning( - "Append handler join is interrupted. Stream: " + streamName + " Error: " + e.toString()); - } - if (this.ownsBigQueryWriteClient) { - this.client.close(); - try { - // Backend request has a 2 minute timeout, so wait a little longer than that. - this.client.awaitTermination(150, TimeUnit.SECONDS); - } catch (InterruptedException ignored) { - } - } - } - - /* - * This loop is executed in a separate thread. - * - * It takes requests from waiting queue and sends them to server. - */ - private void appendLoop() { - Deque localQueue = new LinkedList(); - boolean streamNeedsConnecting = false; - // Set firstRequestInConnection to true immediately after connecting the steam, - // indicates then next row sent, needs the schema and other metadata. - boolean isFirstRequestInConnection = true; - while (!waitingQueueDrained()) { - this.lock.lock(); - try { - hasMessageInWaitingQueue.await(100, TimeUnit.MILLISECONDS); - // Copy the streamConnectionIsConnected guarded by lock to a local variable. - // In addition, only reconnect if there is a retriable error. - streamNeedsConnecting = !streamConnectionIsConnected && connectionFinalStatus == null; - if (streamNeedsConnecting) { - // If the stream connection is broken, any requests on inflightRequestQueue will need - // to be resent, as the new connection has no knowledge of the requests. Copy the requests - // from inflightRequestQueue and prepent them onto the waitinRequestQueue. They need to be - // prepended as they need to be sent before new requests. - while (!inflightRequestQueue.isEmpty()) { - waitingRequestQueue.addFirst(inflightRequestQueue.pollLast()); - } - } - while (!this.waitingRequestQueue.isEmpty()) { - AppendRequestAndResponse requestWrapper = this.waitingRequestQueue.pollFirst(); - this.inflightRequestQueue.addLast(requestWrapper); - localQueue.addLast(requestWrapper); - } - } catch (InterruptedException e) { - log.warning( - "Interrupted while waiting for message. Stream: " - + streamName - + " Error: " - + e.toString()); - } finally { - this.lock.unlock(); - } - - if (localQueue.isEmpty()) { - continue; - } - if (streamNeedsConnecting) { - // Set streamConnectionIsConnected to true, to indicate the stream has been connected. This - // should happen before the call to resetConnection. As it is unknown when the connection - // could be closed and the doneCallback called, and thus clearing the flag. - lock.lock(); - try { - this.streamConnectionIsConnected = true; - } finally { - lock.unlock(); - } - resetConnection(); - // Set firstRequestInConnection to indicate the next request to be sent should include - // metedata. - isFirstRequestInConnection = true; - } - while (!localQueue.isEmpty()) { - AppendRowsRequest preparedRequest = - prepareRequestBasedOnPosition( - localQueue.pollFirst().message, isFirstRequestInConnection); - // Send should only throw an exception if there is a problem with the request. The catch - // block will handle this case, and return the exception with the result. - // Otherwise send will return: - // SUCCESS: Message was sent, wait for the callback. - // STREAM_CLOSED: Stream was closed, normally or due to en error - // NOT_ENOUGH_QUOTA: Message wasn't sent due to not enough quota. - // TODO: Handle NOT_ENOUGH_QUOTA. - // In the close case, the request is in the inflight queue, and will either be returned - // to the user with an error, or will be resent. - this.streamConnection.send(preparedRequest); - isFirstRequestInConnection = false; - } - } - - log.fine("Cleanup starts. Stream: " + streamName); - // At this point, the waiting queue is drained, so no more requests. - // We can close the stream connection and handle the remaining inflight requests. - if (streamConnection != null) { - this.streamConnection.close(); - waitForDoneCallback(3, TimeUnit.MINUTES); - } - - // At this point, there cannot be more callback. It is safe to clean up all inflight requests. - log.fine( - "Stream connection is fully closed. Cleaning up inflight requests. Stream: " + streamName); - cleanupInflightRequests(); - log.fine("Append thread is done. Stream: " + streamName); - } - - /* - * Returns true if waiting queue is drain, a.k.a. no more requests in the waiting queue. - * - * It serves as a signal to append thread that there cannot be any more requests in the waiting - * queue and it can prepare to stop. - */ - private boolean waitingQueueDrained() { - this.lock.lock(); - try { - return (this.userClosed || this.connectionFinalStatus != null) - && this.waitingRequestQueue.isEmpty(); - } finally { - this.lock.unlock(); - } - } - - private void waitForDoneCallback(long duration, TimeUnit timeUnit) { - log.fine("Waiting for done callback from stream connection. Stream: " + streamName); - long deadline = System.nanoTime() + timeUnit.toNanos(duration); - while (System.nanoTime() <= deadline) { - this.lock.lock(); - try { - if (!this.streamConnectionIsConnected) { - // Done callback is received, return. - return; - } - } finally { - this.lock.unlock(); - } - Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS); - } - this.lock.lock(); - try { - if (connectionFinalStatus == null) { - connectionFinalStatus = - new StatusRuntimeException( - Status.fromCode(Code.CANCELLED) - .withDescription("Timeout waiting for DoneCallback.")); - } - } finally { - this.lock.unlock(); - } - - return; - } - - private AppendRowsRequest prepareRequestBasedOnPosition( - AppendRowsRequest original, boolean isFirstRequest) { - AppendRowsRequest.Builder requestBuilder = original.toBuilder(); - if (isFirstRequest) { - if (this.writerSchema != null) { - requestBuilder.getProtoRowsBuilder().setWriterSchema(this.writerSchema); - } - requestBuilder.setWriteStream(this.streamName); - if (this.traceId != null) { - requestBuilder.setTraceId(this.traceId); - } - } else { - requestBuilder.clearWriteStream(); - requestBuilder.getProtoRowsBuilder().clearWriterSchema(); - } - return requestBuilder.build(); - } - - private void cleanupInflightRequests() { - Throwable finalStatus = - new Exceptions.StreamWriterClosedException( - Status.fromCode(Status.Code.FAILED_PRECONDITION) - .withDescription("Connection is already closed, cleanup inflight request"), - streamName, - writerId); - Deque localQueue = new LinkedList(); - this.lock.lock(); - try { - if (this.connectionFinalStatus != null) { - finalStatus = this.connectionFinalStatus; - } - while (!this.inflightRequestQueue.isEmpty()) { - localQueue.addLast(pollInflightRequestQueue()); - } - this.inflightCleanuped = true; - } finally { - this.lock.unlock(); - } - log.fine("Cleaning " + localQueue.size() + " inflight requests with error: " + finalStatus); - while (!localQueue.isEmpty()) { - localQueue.pollFirst().appendResult.setException(finalStatus); - } - } - - private void requestCallback(AppendRowsResponse response) { - AppendRequestAndResponse requestWrapper; - this.lock.lock(); - if (response.hasUpdatedSchema()) { - this.updatedSchema = response.getUpdatedSchema(); - } - try { - // Had a successful connection with at least one result, reset retries. - // conectionRetryCountWithoutCallback is reset so that only multiple retries, without - // successful records sent, will cause the stream to fail. - if (conectionRetryCountWithoutCallback != 0) { - conectionRetryCountWithoutCallback = 0; - } - if (!this.inflightRequestQueue.isEmpty()) { - requestWrapper = pollInflightRequestQueue(); - } else if (inflightCleanuped) { - // It is possible when requestCallback is called, the inflight queue is already drained - // because we timed out waiting for done. - return; - } else { - // This is something not expected, we shouldn't have an empty inflight queue otherwise. - log.log(Level.WARNING, "Unexpected: request callback called on an empty inflight queue."); - connectionFinalStatus = - new StatusRuntimeException( - Status.fromCode(Code.FAILED_PRECONDITION) - .withDescription("Request callback called on an empty inflight queue.")); - return; - } - } finally { - this.lock.unlock(); - } - if (response.hasError()) { - Exceptions.StorageException storageException = - Exceptions.toStorageException(response.getError(), null); - if (storageException != null) { - requestWrapper.appendResult.setException(storageException); - } else { - StatusRuntimeException exception = - new StatusRuntimeException( - Status.fromCodeValue(response.getError().getCode()) - .withDescription(response.getError().getMessage())); - requestWrapper.appendResult.setException(exception); - } - } else { - requestWrapper.appendResult.set(response); - } - } - - private boolean isRetriableError(Throwable t) { - Status status = Status.fromThrowable(t); - if (Errors.isRetryableInternalStatus(status)) { - return true; - } - return status.getCode() == Code.ABORTED - || status.getCode() == Code.UNAVAILABLE - || status.getCode() == Code.CANCELLED; - } - - private void doneCallback(Throwable finalStatus) { - log.fine( - "Received done callback. Stream: " - + streamName - + " Final status: " - + finalStatus.toString()); - this.lock.lock(); - try { - this.streamConnectionIsConnected = false; - if (connectionFinalStatus == null) { - // If the error can be retried, don't set it here, let it try to retry later on. - if (isRetriableError(finalStatus) && !userClosed) { - this.conectionRetryCountWithoutCallback++; - log.fine( - "Retriable error " - + finalStatus.toString() - + " received, retry count " - + conectionRetryCountWithoutCallback - + " for stream " - + streamName); - } else { - Exceptions.StorageException storageException = Exceptions.toStorageException(finalStatus); - this.connectionFinalStatus = storageException != null ? storageException : finalStatus; - log.info( - "Connection finished with error " - + finalStatus.toString() - + " for stream " - + streamName); - } - } - } finally { - this.lock.unlock(); - } - } - - @GuardedBy("lock") - private AppendRequestAndResponse pollInflightRequestQueue() { - AppendRequestAndResponse requestWrapper = this.inflightRequestQueue.pollFirst(); - --this.inflightRequests; - this.inflightBytes -= requestWrapper.messageSize; - this.inflightReduced.signal(); - return requestWrapper; + this.connectionWorker.close(); } /** @@ -724,7 +170,7 @@ public static StreamWriter.Builder newBuilder(String streamName) { /** Thread-safe getter of updated TableSchema */ public synchronized TableSchema getUpdatedSchema() { - return this.updatedSchema; + return connectionWorker.getUpdatedSchema(); } /** A builder of {@link StreamWriter}s. */ @@ -847,17 +293,4 @@ public StreamWriter build() throws IOException { return new StreamWriter(this); } } - - // Class that wraps AppendRowsRequest and its corresponding Response future. - private static final class AppendRequestAndResponse { - final SettableApiFuture appendResult; - final AppendRowsRequest message; - final long messageSize; - - AppendRequestAndResponse(AppendRowsRequest message) { - this.appendResult = SettableApiFuture.create(); - this.message = message; - this.messageSize = message.getProtoRows().getSerializedSize(); - } - } } From b26265e56a47cda3fca1329d349ab4a18288d4cb Mon Sep 17 00:00:00 2001 From: Gaole Meng Date: Wed, 14 Sep 2022 11:29:43 -0700 Subject: [PATCH 11/15] feat: add connection worker skeleton used for multiplexing client (#1778) * feat: Split writer into connection worker and wrapper, this is a prerequisite for multiplexing client * feat: add connection worker pool skeleton, used for multiplexing client --- .github/.OwlBot.yaml | 1 + google-cloud-bigquerystorage/pom.xml | 21 ++- .../storage/v1/ConnectionWorkerPool.java | 176 ++++++++++++++++++ 3 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index ec7bb13f06..86af849164 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -78,6 +78,7 @@ deep-preserve-regex: - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1.*/Waiter.java" - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/Exceptions.java" - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java" deep-copy-regex: - source: "/google/cloud/bigquery/storage/(v.*)/.*-java/proto-google-.*/src" diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index d7936d4d92..bedd332046 100644 --- a/google-cloud-bigquerystorage/pom.xml +++ b/google-cloud-bigquerystorage/pom.xml @@ -44,6 +44,15 @@ org.codehaus.mojo flatten-maven-plugin + + org.apache.maven.plugins + maven-dependency-plugin + + + com.google.auto.value:auto-value + + + @@ -63,6 +72,16 @@ com.google.api api-common + + com.google.auto.value + auto-value + 1.9 + + + com.google.auto.value + auto-value-annotations + 1.9 + com.google.protobuf protobuf-java @@ -71,7 +90,6 @@ com.google.api.grpc proto-google-common-protos - com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 @@ -134,7 +152,6 @@ junit test - com.google.truth truth diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java new file mode 100644 index 0000000000..a4642a96b0 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java @@ -0,0 +1,176 @@ +/* + * Copyright 2022 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 + * + * https://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. + */ +package com.google.cloud.bigquery.storage.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.FlowController; +import com.google.auto.value.AutoValue; +import javax.annotation.concurrent.GuardedBy; + +public class ConnectionWorkerPool { + /* + * Max allowed inflight requests in the stream. Method append is blocked at this. + */ + private final long maxInflightRequests; + + /* + * Max allowed inflight bytes in the stream. Method append is blocked at this. + */ + private final long maxInflightBytes; + + /* + * Behavior when inflight queue is exceeded. Only supports Block or Throw, default is Block. + */ + private final FlowController.LimitExceededBehavior limitExceededBehavior; + + /* + * TraceId for debugging purpose. + */ + private final String traceId; + + /* + * Tracks current inflight requests in the stream. + */ + @GuardedBy("lock") + private long inflightRequests = 0; + + /* + * Tracks current inflight bytes in the stream. + */ + @GuardedBy("lock") + private long inflightBytes = 0; + + /* + * Tracks how often the stream was closed due to a retriable error. Streaming will stop when the + * count hits a threshold. Streaming should only be halted, if it isn't possible to establish a + * connection. Keep track of the number of reconnections in succession. This will be reset if + * a row is successfully called back. + */ + @GuardedBy("lock") + private long conectionRetryCountWithoutCallback = 0; + + /* + * If false, streamConnection needs to be reset. + */ + @GuardedBy("lock") + private boolean streamConnectionIsConnected = false; + + /* + * A boolean to track if we cleaned up inflight queue. + */ + @GuardedBy("lock") + private boolean inflightCleanuped = false; + + /* + * Indicates whether user has called Close() or not. + */ + @GuardedBy("lock") + private boolean userClosed = false; + + /* + * The final status of connection. Set to nonnull when connection is permanently closed. + */ + @GuardedBy("lock") + private Throwable connectionFinalStatus = null; + + /* + * Contains the updated TableSchema. + */ + @GuardedBy("lock") + private TableSchema updatedSchema; + + /* + * A client used to interact with BigQuery. + */ + private BigQueryWriteClient client; + + /* + * If true, the client above is created by this writer and should be closed. + */ + private boolean ownsBigQueryWriteClient = false; + + /** Settings for connection pool. */ + @AutoValue + public abstract static class Settings { + /** + * The minimum connections each pool created before trying to reuse the previously created + * connection in multiplexing mode. + */ + abstract int minConnectionsPerPool(); + + /** The maximum connections per connection pool. */ + abstract int maxConnectionsPerPool(); + + public static Builder builder() { + return new AutoValue_ConnectionWorkerPool_Settings.Builder() + .setMinConnectionsPerPool(2) + .setMaxConnectionsPerPool(10); + } + + /** Builder for the options to config {@link ConnectionWorkerPool}. */ + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setMinConnectionsPerPool(int value); + + public abstract Builder setMaxConnectionsPerPool(int value); + + public abstract Settings build(); + } + } + + /** Static setting for connection pool. */ + private static Settings settings = Settings.builder().build(); + + public ConnectionWorkerPool( + long maxInflightRequests, + long maxInflightBytes, + FlowController.LimitExceededBehavior limitExceededBehavior, + String traceId, + BigQueryWriteClient client, + boolean ownsBigQueryWriteClient) { + this.maxInflightRequests = maxInflightRequests; + this.maxInflightBytes = maxInflightBytes; + this.limitExceededBehavior = limitExceededBehavior; + this.traceId = traceId; + this.client = client; + this.ownsBigQueryWriteClient = ownsBigQueryWriteClient; + } + + /** + * Sets static connection pool options. + * + *

Note: this method should be triggered prior to the construction of connection pool. + */ + public static void setOptions(Settings settings) { + ConnectionWorkerPool.settings = settings; + } + + /** Distributes the writing of a message to an underlying connection. */ + public ApiFuture append(StreamWriter streamWriter, ProtoRows rows) { + throw new RuntimeException("Append is not implemented!"); + } + + /** Distributes the writing of a message to an underlying connection. */ + public ApiFuture append( + StreamWriter streamWriter, ProtoRows rows, long offset) { + throw new RuntimeException("append with offset is not implemented on connection pool!"); + } + + /** Close the stream writer. Shut down all resources. */ + public void close(StreamWriter streamWriter) { + throw new RuntimeException("close is implemented on connection pool"); + } +} From 179930e6b0017f1fa12dcd3ef7c3efa374f41576 Mon Sep 17 00:00:00 2001 From: Gaole Meng Date: Wed, 14 Sep 2022 20:41:01 -0700 Subject: [PATCH 12/15] feat: add Load api for connection worker for multiplexing worker (#1779) * feat: Split writer into connection worker and wrapper, this is a prerequisite for multiplexing client * feat: add connection worker pool skeleton, used for multiplexing client * feat: add Load api for connection worker for multiplexing client --- .../bigquery/storage/v1/ConnectionWorker.java | 75 +++++++++++++++++++ .../storage/v1/ConnectionWorkerTest.java | 56 ++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java index 36bf7bbaa7..743f926322 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java @@ -18,16 +18,19 @@ import com.google.api.core.ApiFuture; import com.google.api.core.SettableApiFuture; import com.google.api.gax.batching.FlowController; +import com.google.auto.value.AutoValue; import com.google.cloud.bigquery.storage.util.Errors; import com.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData; import com.google.cloud.bigquery.storage.v1.StreamConnection.DoneCallback; import com.google.cloud.bigquery.storage.v1.StreamConnection.RequestCallback; +import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.Uninterruptibles; import com.google.protobuf.Int64Value; import io.grpc.Status; import io.grpc.Status.Code; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.Comparator; import java.util.Deque; import java.util.LinkedList; import java.util.UUID; @@ -672,4 +675,76 @@ private static final class AppendRequestAndResponse { this.messageSize = message.getProtoRows().getSerializedSize(); } } + + /** + * Represent the current workload for this worker. Used for multiplexing algorithm to determine + * the distribution of requests. + */ + @AutoValue + public abstract static class Load { + // Consider the load on this worker to be overwhelmed when above some percentage of + // in-flight bytes or in-flight requests count. + private static double overwhelmedInflightCount = 0.5; + private static double overwhelmedInflightBytes = 0.6; + + // Number of in-flight requests bytes in the worker. + abstract long inFlightRequestsBytes(); + + // Number of in-flight requests count in the worker. + abstract long inFlightRequestsCount(); + + // Number of destination handled by this worker. + abstract long destinationCount(); + + // Max number of in-flight requests count allowed. + abstract long maxInflightBytes(); + + // Max number of in-flight requests bytes allowed. + abstract long maxInflightCount(); + + static Load create( + long inFlightRequestsBytes, + long inFlightRequestsCount, + long destinationCount, + long maxInflightBytes, + long maxInflightCount) { + return new AutoValue_ConnectionWorker_Load( + inFlightRequestsBytes, + inFlightRequestsCount, + destinationCount, + maxInflightBytes, + maxInflightCount); + } + + boolean isOverwhelmed() { + // Consider only in flight bytes and count for now, as by experiment those two are the most + // efficient and has great simplity. + return inFlightRequestsCount() > overwhelmedInflightCount * maxInflightCount() + || inFlightRequestsBytes() > overwhelmedInflightBytes * maxInflightBytes(); + } + + // Compares two different load. First compare in flight request bytes split by size 1024 bucket. + // Then compare the inflight requests count. + // Then compare destination count of the two connections. + public static final Comparator LOAD_COMPARATOR = + Comparator.comparing((Load key) -> (int) (key.inFlightRequestsBytes() / 1024)) + .thenComparing((Load key) -> (int) (key.inFlightRequestsCount() / 100)) + .thenComparing(Load::destinationCount); + + // Compares two different load without bucket, used in smaller scale unit testing. + public static final Comparator TEST_LOAD_COMPARATOR = + Comparator.comparing((Load key) -> (int) key.inFlightRequestsBytes()) + .thenComparing((Load key) -> (int) key.inFlightRequestsCount()) + .thenComparing(Load::destinationCount); + + @VisibleForTesting + public static void setOverwhelmedBytesThreshold(double newThreshold) { + overwhelmedInflightBytes = newThreshold; + } + + @VisibleForTesting + public static void setOverwhelmedCountsThreshold(double newThreshold) { + overwhelmedInflightCount = newThreshold; + } + } } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java new file mode 100644 index 0000000000..35d8d5cf09 --- /dev/null +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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 + * + * https://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. + */ +package com.google.cloud.bigquery.storage.v1; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigquery.storage.v1.ConnectionWorker.Load; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ConnectionWorkerTest { + @Test + public void testLoadCompare_compareLoad() { + // In flight bytes bucket is split as per 1024 requests per bucket. + // When in flight bytes is in lower bucket, even destination count is higher and request count + // is higher, the load is still smaller. + Load load1 = ConnectionWorker.Load.create(1000, 2000, 100, 1000, 10); + Load load2 = ConnectionWorker.Load.create(2000, 1000, 10, 1000, 10); + assertThat(Load.LOAD_COMPARATOR.compare(load1, load2)).isLessThan(0); + + // In flight bytes in the same bucke of request bytes will compare request count. + Load load3 = ConnectionWorker.Load.create(1, 300, 10, 0, 10); + Load load4 = ConnectionWorker.Load.create(10, 1, 10, 0, 10); + assertThat(Load.LOAD_COMPARATOR.compare(load3, load4)).isGreaterThan(0); + + // In flight request and bytes in the same bucket will compare the destination count. + Load load5 = ConnectionWorker.Load.create(200, 1, 10, 1000, 10); + Load load6 = ConnectionWorker.Load.create(100, 10, 10, 1000, 10); + assertThat(Load.LOAD_COMPARATOR.compare(load5, load6) == 0).isTrue(); + } + + @Test + public void testLoadIsOverWhelmed() { + // Only in flight request is considered in current overwhelmed calculation. + Load load1 = ConnectionWorker.Load.create(60, 10, 100, 90, 100); + assertThat(load1.isOverwhelmed()).isTrue(); + + Load load2 = ConnectionWorker.Load.create(1, 1, 100, 100, 100); + assertThat(load2.isOverwhelmed()).isFalse(); + } +} From ed2cd66a3804140711b9f4aa05b67641f2494bc9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Sep 2022 14:22:34 +0200 Subject: [PATCH 13/15] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 (#1780) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.2` -> `3.0.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/compatibility-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/confidence-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

googleapis/java-shared-dependencies ### [`v3.0.3`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​303-httpsgithubcomgoogleapisjava-shared-dependenciescomparev302v303-2022-09-14) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.2...v3.0.3) ##### Dependencies - Google-cloud-core 2.8.12 ([#​799](https://togithub.com/googleapis/java-shared-dependencies/issues/799)) ([1b3db8d](https://togithub.com/googleapis/java-shared-dependencies/commit/1b3db8d1e17c49ebae79fc96164fa9058e1df6e3)) - Moving gson to first-party-dependencies ([#​800](https://togithub.com/googleapis/java-shared-dependencies/issues/800)) ([a41fcc1](https://togithub.com/googleapis/java-shared-dependencies/commit/a41fcc11d32e02e5af2837561792e3919f6d4b3f)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.6 ([#​797](https://togithub.com/googleapis/java-shared-dependencies/issues/797)) ([bc5fdc9](https://togithub.com/googleapis/java-shared-dependencies/commit/bc5fdc9b3af7973c28f063a9ac156fe2af562814)) - Update gax.version to v2.19.1 ([#​798](https://togithub.com/googleapis/java-shared-dependencies/issues/798)) ([84e5487](https://togithub.com/googleapis/java-shared-dependencies/commit/84e5487b2e3dce4bb60badecebde788c3cb702b8)) - Update google.core.version to v2.8.11 ([#​793](https://togithub.com/googleapis/java-shared-dependencies/issues/793)) ([63c1297](https://togithub.com/googleapis/java-shared-dependencies/commit/63c129722aa0b821031ff5b4c11004adf7b12044))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerystorage). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cf735e4900..7acdc2b1ca 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.2 + 3.0.3 pom import From 7ff709951f40c3683da628a9bcf66a5fe0a2e368 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Sep 2022 18:19:17 +0200 Subject: [PATCH 14/15] deps: update dependency com.google.cloud:google-cloud-bigquery to v2.16.1 (#1781) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- tutorials/JsonWriterDefaultStream/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7acdc2b1ca..447dc52c66 100644 --- a/pom.xml +++ b/pom.xml @@ -132,7 +132,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1b738e283b..a1160ea583 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -37,7 +37,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1 org.apache.avro diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ef0efc6eba..1282efa1fa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -36,7 +36,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1 org.apache.avro diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 93aa5bd6d3..86cbc54568 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -48,7 +48,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1 org.apache.avro diff --git a/tutorials/JsonWriterDefaultStream/pom.xml b/tutorials/JsonWriterDefaultStream/pom.xml index 19f3e660cf..6cc8a84fa9 100644 --- a/tutorials/JsonWriterDefaultStream/pom.xml +++ b/tutorials/JsonWriterDefaultStream/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1 org.apache.avro From 6d163fbe6fd718e6343482ee704295b3bf78d4c8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 16:42:24 +0000 Subject: [PATCH 15/15] chore(main): release 2.21.0 (#1767) :robot: I have created a release *beep* *boop* --- ## [2.21.0](https://github.com/googleapis/java-bigquerystorage/compare/v2.20.1...v2.21.0) (2022-09-15) ### Features * Add connection worker skeleton used for multiplexing client ([#1778](https://github.com/googleapis/java-bigquerystorage/issues/1778)) ([b26265e](https://github.com/googleapis/java-bigquerystorage/commit/b26265e56a47cda3fca1329d349ab4a18288d4cb)) * Add Load api for connection worker for multiplexing worker ([#1779](https://github.com/googleapis/java-bigquerystorage/issues/1779)) ([179930e](https://github.com/googleapis/java-bigquerystorage/commit/179930e6b0017f1fa12dcd3ef7c3efa374f41576)) * Add location to WriteStream and add WriteStreamView support ([#1771](https://github.com/googleapis/java-bigquerystorage/issues/1771)) ([f446ff4](https://github.com/googleapis/java-bigquerystorage/commit/f446ff4f7d3f9d217501201289be416cbfdbe937)) * Add proto annotation for non-ascii field mapping ([#1776](https://github.com/googleapis/java-bigquerystorage/issues/1776)) ([1a079ee](https://github.com/googleapis/java-bigquerystorage/commit/1a079ee0761bad2e942081f7f02b530f32e55afe)) * introducing connection worker to run a loop for fetching / sending requests in a queue. ([7dd447d](https://github.com/googleapis/java-bigquerystorage/commit/7dd447da206cdd7a403191bd15203bb4cc53ccb5)) ### Bug Fixes * **api:** Numeric/bignumeric conversion issue [#1757](https://github.com/googleapis/java-bigquerystorage/issues/1757) ([#1768](https://github.com/googleapis/java-bigquerystorage/issues/1768)) ([5cc96a0](https://github.com/googleapis/java-bigquerystorage/commit/5cc96a0c5da5c8b557e96cd1a25afdff9d583a0f)) ### Dependencies * Update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 ([#1766](https://github.com/googleapis/java-bigquerystorage/issues/1766)) ([40e0ba0](https://github.com/googleapis/java-bigquerystorage/commit/40e0ba09527c564004fcbbb0c3af2fb97eb811c0)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 ([#1777](https://github.com/googleapis/java-bigquerystorage/issues/1777)) ([08a7c8f](https://github.com/googleapis/java-bigquerystorage/commit/08a7c8f1dde71f48706bb0b1aa780f79012594bf)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.16.1 ([#1781](https://github.com/googleapis/java-bigquerystorage/issues/1781)) ([7ff7099](https://github.com/googleapis/java-bigquerystorage/commit/7ff709951f40c3683da628a9bcf66a5fe0a2e368)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#1772](https://github.com/googleapis/java-bigquerystorage/issues/1772)) ([3279ef4](https://github.com/googleapis/java-bigquerystorage/commit/3279ef42e915881c255a8db8e677799f530c5d53)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1780](https://github.com/googleapis/java-bigquerystorage/issues/1780)) ([ed2cd66](https://github.com/googleapis/java-bigquerystorage/commit/ed2cd66a3804140711b9f4aa05b67641f2494bc9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 25 +++++++++++++++++++ google-cloud-bigquerystorage-bom/pom.xml | 16 ++++++------ google-cloud-bigquerystorage/pom.xml | 4 +-- grpc-google-cloud-bigquerystorage-v1/pom.xml | 4 +-- .../pom.xml | 4 +-- .../pom.xml | 4 +-- pom.xml | 16 ++++++------ proto-google-cloud-bigquerystorage-v1/pom.xml | 4 +-- .../pom.xml | 4 +-- .../pom.xml | 4 +-- samples/snapshot/pom.xml | 2 +- versions.txt | 14 +++++------ 12 files changed, 63 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdd90efa0d..dc03ea8be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [2.21.0](https://github.com/googleapis/java-bigquerystorage/compare/v2.20.1...v2.21.0) (2022-09-15) + + +### Features + +* Add connection worker skeleton used for multiplexing client ([#1778](https://github.com/googleapis/java-bigquerystorage/issues/1778)) ([b26265e](https://github.com/googleapis/java-bigquerystorage/commit/b26265e56a47cda3fca1329d349ab4a18288d4cb)) +* Add Load api for connection worker for multiplexing worker ([#1779](https://github.com/googleapis/java-bigquerystorage/issues/1779)) ([179930e](https://github.com/googleapis/java-bigquerystorage/commit/179930e6b0017f1fa12dcd3ef7c3efa374f41576)) +* Add location to WriteStream and add WriteStreamView support ([#1771](https://github.com/googleapis/java-bigquerystorage/issues/1771)) ([f446ff4](https://github.com/googleapis/java-bigquerystorage/commit/f446ff4f7d3f9d217501201289be416cbfdbe937)) +* Add proto annotation for non-ascii field mapping ([#1776](https://github.com/googleapis/java-bigquerystorage/issues/1776)) ([1a079ee](https://github.com/googleapis/java-bigquerystorage/commit/1a079ee0761bad2e942081f7f02b530f32e55afe)) +* introducing connection worker to run a loop for fetching / sending requests in a queue. ([7dd447d](https://github.com/googleapis/java-bigquerystorage/commit/7dd447da206cdd7a403191bd15203bb4cc53ccb5)) + + +### Bug Fixes + +* **api:** Numeric/bignumeric conversion issue [#1757](https://github.com/googleapis/java-bigquerystorage/issues/1757) ([#1768](https://github.com/googleapis/java-bigquerystorage/issues/1768)) ([5cc96a0](https://github.com/googleapis/java-bigquerystorage/commit/5cc96a0c5da5c8b557e96cd1a25afdff9d583a0f)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 ([#1766](https://github.com/googleapis/java-bigquerystorage/issues/1766)) ([40e0ba0](https://github.com/googleapis/java-bigquerystorage/commit/40e0ba09527c564004fcbbb0c3af2fb97eb811c0)) +* Update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 ([#1777](https://github.com/googleapis/java-bigquerystorage/issues/1777)) ([08a7c8f](https://github.com/googleapis/java-bigquerystorage/commit/08a7c8f1dde71f48706bb0b1aa780f79012594bf)) +* Update dependency com.google.cloud:google-cloud-bigquery to v2.16.1 ([#1781](https://github.com/googleapis/java-bigquerystorage/issues/1781)) ([7ff7099](https://github.com/googleapis/java-bigquerystorage/commit/7ff709951f40c3683da628a9bcf66a5fe0a2e368)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#1772](https://github.com/googleapis/java-bigquerystorage/issues/1772)) ([3279ef4](https://github.com/googleapis/java-bigquerystorage/commit/3279ef42e915881c255a8db8e677799f530c5d53)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1780](https://github.com/googleapis/java-bigquerystorage/issues/1780)) ([ed2cd66](https://github.com/googleapis/java-bigquerystorage/commit/ed2cd66a3804140711b9f4aa05b67641f2494bc9)) + ## [2.20.1](https://github.com/googleapis/java-bigquerystorage/compare/v2.20.0...v2.20.1) (2022-08-24) diff --git a/google-cloud-bigquerystorage-bom/pom.xml b/google-cloud-bigquerystorage-bom/pom.xml index 9d16c31863..3bad2dad68 100644 --- a/google-cloud-bigquerystorage-bom/pom.xml +++ b/google-cloud-bigquerystorage-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerystorage-bom - 2.20.2-SNAPSHOT + 2.21.0 pom com.google.cloud @@ -52,37 +52,37 @@ com.google.cloud google-cloud-bigquerystorage - 2.20.2-SNAPSHOT + 2.21.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 2.20.2-SNAPSHOT + 2.21.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index bedd332046..3b981e2c80 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 - 2.20.2-SNAPSHOT + 2.21.0 jar BigQuery Storage https://github.com/googleapis/java-bigquerystorage @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquerystorage-parent - 2.20.2-SNAPSHOT + 2.21.0 google-cloud-bigquerystorage diff --git a/grpc-google-cloud-bigquerystorage-v1/pom.xml b/grpc-google-cloud-bigquerystorage-v1/pom.xml index 94d6dc4fb2..9f717113f7 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 - 2.20.2-SNAPSHOT + 2.21.0 grpc-google-cloud-bigquerystorage-v1 GRPC library for grpc-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta1/pom.xml index 3604ce6a1c..2aba25912f 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.144.2-SNAPSHOT + 0.145.0 grpc-google-cloud-bigquerystorage-v1beta1 GRPC library for grpc-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml b/grpc-google-cloud-bigquerystorage-v1beta2/pom.xml index 06d5d56b30..264366f813 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.144.2-SNAPSHOT + 0.145.0 grpc-google-cloud-bigquerystorage-v1beta2 GRPC library for grpc-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/pom.xml b/pom.xml index 447dc52c66..f82088994a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquerystorage-parent pom - 2.20.2-SNAPSHOT + 2.21.0 BigQuery Storage Parent https://github.com/googleapis/java-bigquerystorage @@ -83,37 +83,37 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta1 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc proto-google-cloud-bigquerystorage-v1 - 2.20.2-SNAPSHOT + 2.21.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta1 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1beta2 - 0.144.2-SNAPSHOT + 0.145.0 com.google.api.grpc grpc-google-cloud-bigquerystorage-v1 - 2.20.2-SNAPSHOT + 2.21.0 com.google.cloud google-cloud-bigquerystorage - 2.20.2-SNAPSHOT + 2.21.0 org.json diff --git a/proto-google-cloud-bigquerystorage-v1/pom.xml b/proto-google-cloud-bigquerystorage-v1/pom.xml index 686b41f4f8..c573c5dbfe 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 - 2.20.2-SNAPSHOT + 2.21.0 proto-google-cloud-bigquerystorage-v1 PROTO library for proto-google-cloud-bigquerystorage-v1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/proto-google-cloud-bigquerystorage-v1beta1/pom.xml b/proto-google-cloud-bigquerystorage-v1beta1/pom.xml index 254ddd8cf6..29f145a357 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.144.2-SNAPSHOT + 0.145.0 proto-google-cloud-bigquerystorage-v1beta1 PROTO library for proto-google-cloud-bigquerystorage-v1beta1 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/proto-google-cloud-bigquerystorage-v1beta2/pom.xml b/proto-google-cloud-bigquerystorage-v1beta2/pom.xml index 919b84bd61..fc94104be9 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.144.2-SNAPSHOT + 0.145.0 proto-google-cloud-bigquerystorage-v1beta2 PROTO library for proto-google-cloud-bigquerystorage-v1beta2 com.google.cloud google-cloud-bigquerystorage-parent - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1282efa1fa..f933b0c8cd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigquerystorage - 2.20.2-SNAPSHOT + 2.21.0 diff --git a/versions.txt b/versions.txt index 327d597960..a987efaa34 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigquerystorage:2.20.1:2.20.2-SNAPSHOT -grpc-google-cloud-bigquerystorage-v1beta1:0.144.1:0.144.2-SNAPSHOT -grpc-google-cloud-bigquerystorage-v1beta2:0.144.1:0.144.2-SNAPSHOT -grpc-google-cloud-bigquerystorage-v1:2.20.1:2.20.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1beta1:0.144.1:0.144.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1beta2:0.144.1:0.144.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1:2.20.1:2.20.2-SNAPSHOT +google-cloud-bigquerystorage:2.21.0:2.21.0 +grpc-google-cloud-bigquerystorage-v1beta1:0.145.0:0.145.0 +grpc-google-cloud-bigquerystorage-v1beta2:0.145.0:0.145.0 +grpc-google-cloud-bigquerystorage-v1:2.21.0:2.21.0 +proto-google-cloud-bigquerystorage-v1beta1:0.145.0:0.145.0 +proto-google-cloud-bigquerystorage-v1beta2:0.145.0:0.145.0 +proto-google-cloud-bigquerystorage-v1:2.21.0:2.21.0