From 902156d576845499e3eeedeff44c47d67e228098 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 6 Feb 2020 15:35:00 -0500 Subject: [PATCH] feat: v1 client generation (#64) --- google-cloud-bigquerystorage-bom/pom.xml | 11 + google-cloud-bigquerystorage/pom.xml | 9 + .../storage/v1/BaseBigQueryReadClient.java | 387 ++ .../storage/v1/BaseBigQueryReadSettings.java | 201 + .../bigquery/storage/v1/package-info.java | 44 + .../storage/v1/stub/BigQueryReadStub.java | 54 + .../v1/stub/BigQueryReadStubSettings.java | 353 ++ .../stub/GrpcBigQueryReadCallableFactory.java | 115 + .../storage/v1/stub/GrpcBigQueryReadStub.java | 223 + .../v1/BaseBigQueryReadClientTest.java | 166 + .../bigquery/storage/v1/MockBigQueryRead.java | 57 + .../storage/v1/MockBigQueryReadImpl.java | 102 + grpc-google-cloud-bigquerystorage-v1/pom.xml | 56 + .../bigquery/storage/v1/BigQueryReadGrpc.java | 699 +++ pom.xml | 13 + proto-google-cloud-bigquerystorage-v1/pom.xml | 25 + .../cloud/bigquery/storage/v1/ArrowProto.java | 79 + .../bigquery/storage/v1/ArrowRecordBatch.java | 639 ++ .../storage/v1/ArrowRecordBatchOrBuilder.java | 51 + .../bigquery/storage/v1/ArrowSchema.java | 556 ++ .../storage/v1/ArrowSchemaOrBuilder.java | 38 + .../cloud/bigquery/storage/v1/AvroProto.java | 78 + .../cloud/bigquery/storage/v1/AvroRows.java | 636 ++ .../storage/v1/AvroRowsOrBuilder.java | 51 + .../cloud/bigquery/storage/v1/AvroSchema.java | 640 ++ .../storage/v1/AvroSchemaOrBuilder.java | 52 + .../storage/v1/CreateReadSessionRequest.java | 1071 ++++ .../v1/CreateReadSessionRequestOrBuilder.java | 116 + .../cloud/bigquery/storage/v1/DataFormat.java | 160 + .../bigquery/storage/v1/ReadRowsRequest.java | 744 +++ .../storage/v1/ReadRowsRequestOrBuilder.java | 69 + .../bigquery/storage/v1/ReadRowsResponse.java | 1788 ++++++ .../storage/v1/ReadRowsResponseOrBuilder.java | 183 + .../bigquery/storage/v1/ReadSession.java | 5146 +++++++++++++++++ .../storage/v1/ReadSessionOrBuilder.java | 406 ++ .../cloud/bigquery/storage/v1/ReadStream.java | 644 +++ .../storage/v1/ReadStreamOrBuilder.java | 52 + .../storage/v1/SplitReadStreamRequest.java | 765 +++ .../v1/SplitReadStreamRequestOrBuilder.java | 73 + .../storage/v1/SplitReadStreamResponse.java | 1046 ++++ .../v1/SplitReadStreamResponseOrBuilder.java | 104 + .../bigquery/storage/v1/StorageProto.java | 231 + .../bigquery/storage/v1/StreamProto.java | 164 + .../bigquery/storage/v1/StreamStats.java | 1424 +++++ .../storage/v1/StreamStatsOrBuilder.java | 60 + .../bigquery/storage/v1/ThrottleState.java | 548 ++ .../storage/v1/ThrottleStateOrBuilder.java | 39 + .../cloud/bigquery/storage/v1/arrow.proto | 43 + .../cloud/bigquery/storage/v1/avro.proto | 39 + .../cloud/bigquery/storage/v1/storage.proto | 230 + .../cloud/bigquery/storage/v1/stream.proto | 136 + synth.metadata | 34 +- synth.py | 2 +- versions.txt | 2 + 54 files changed, 20644 insertions(+), 10 deletions(-) create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClient.java create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadSettings.java create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/package-info.java create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStub.java create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadCallableFactory.java create mode 100644 google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java create mode 100644 google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java create mode 100644 google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryRead.java create mode 100644 google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java create mode 100644 grpc-google-cloud-bigquerystorage-v1/pom.xml create mode 100644 grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryReadGrpc.java create mode 100644 proto-google-cloud-bigquerystorage-v1/pom.xml create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowProto.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatch.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatchOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchema.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchemaOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroProto.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRows.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRowsOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchema.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchemaOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequest.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/DataFormat.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequest.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponse.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponseOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSession.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSessionOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStream.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStreamOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequest.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequestOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponse.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponseOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStats.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStatsOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleState.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleStateOrBuilder.java create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/arrow.proto create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/avro.proto create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto create mode 100644 proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto diff --git a/google-cloud-bigquerystorage-bom/pom.xml b/google-cloud-bigquerystorage-bom/pom.xml index c3d6dc71fd..c67ea82b8b 100644 --- a/google-cloud-bigquerystorage-bom/pom.xml +++ b/google-cloud-bigquerystorage-bom/pom.xml @@ -75,6 +75,12 @@ proto-google-cloud-bigquerystorage-v1beta2 0.87.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + 0.87.1-SNAPSHOT + + com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 @@ -90,6 +96,11 @@ grpc-google-cloud-bigquerystorage-v1beta2 0.87.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-bigquerystorage-v1 + 0.87.1-SNAPSHOT + com.google.cloud google-cloud-bigquerystorage diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index 5dc32513b0..7349f42c98 100644 --- a/google-cloud-bigquerystorage/pom.xml +++ b/google-cloud-bigquerystorage/pom.xml @@ -54,6 +54,10 @@ com.google.api.grpc proto-google-cloud-bigquerystorage-v1beta2 + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + com.google.guava guava @@ -137,6 +141,11 @@ grpc-google-cloud-bigquerystorage-v1beta2 test + + com.google.api.grpc + grpc-google-cloud-bigquerystorage-v1 + test + com.google.api 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 new file mode 100644 index 0000000000..01c029fa39 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClient.java @@ -0,0 +1,387 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.storage.v1.stub.BigQueryReadStub; +import com.google.cloud.bigquery.storage.v1.stub.BigQueryReadStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: BigQuery Read API. + * + *

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

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

+ * 
+ * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+ *   String parent = "";
+ *   ReadSession readSession = ReadSession.newBuilder().build();
+ *   int maxStreamCount = 0;
+ *   ReadSession response = baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the baseBigQueryReadClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of BaseBigQueryReadSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * BaseBigQueryReadSettings baseBigQueryReadSettings =
+ *     BaseBigQueryReadSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * BaseBigQueryReadClient baseBigQueryReadClient =
+ *     BaseBigQueryReadClient.create(baseBigQueryReadSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * BaseBigQueryReadSettings baseBigQueryReadSettings =
+ *     BaseBigQueryReadSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BaseBigQueryReadClient baseBigQueryReadClient =
+ *     BaseBigQueryReadClient.create(baseBigQueryReadSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class BaseBigQueryReadClient implements BackgroundResource { + private final BaseBigQueryReadSettings settings; + private final BigQueryReadStub stub; + + /** Constructs an instance of BaseBigQueryReadClient with default settings. */ + public static final BaseBigQueryReadClient create() throws IOException { + return create(BaseBigQueryReadSettings.newBuilder().build()); + } + + /** + * Constructs an instance of BaseBigQueryReadClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final BaseBigQueryReadClient create(BaseBigQueryReadSettings settings) + throws IOException { + return new BaseBigQueryReadClient(settings); + } + + /** + * Constructs an instance of BaseBigQueryReadClient, using the given stub for making calls. This + * is for advanced usage - prefer to use BaseBigQueryReadSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final BaseBigQueryReadClient create(BigQueryReadStub stub) { + return new BaseBigQueryReadClient(stub); + } + + /** + * Constructs an instance of BaseBigQueryReadClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected BaseBigQueryReadClient(BaseBigQueryReadSettings settings) throws IOException { + this.settings = settings; + this.stub = ((BigQueryReadStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected BaseBigQueryReadClient(BigQueryReadStub stub) { + this.settings = null; + this.stub = stub; + } + + public final BaseBigQueryReadSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public BigQueryReadStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new read session. A read session divides the contents of a BigQuery table into one or + * more streams, which can then be used to read data from the table. The read session also + * specifies properties of the data to be read, such as a list of columns or a push-down filter + * describing the rows to be returned. + * + *

A particular row can be read by at most one stream. When the caller has reached the end of + * each stream in the session, then all the data in the table has been read. + * + *

Data is assigned to each stream such that roughly the same number of rows can be read from + * each stream. Because the server-side unit for assigning data is collections of rows, the API + * does not guarantee that each stream will return the same number or rows. Additionally, the + * limits are enforced based on the number of pre-filtered rows, so some filters can lead to + * lopsided assignments. + * + *

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

Sample code: + * + *


+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   String parent = "";
+   *   ReadSession readSession = ReadSession.newBuilder().build();
+   *   int maxStreamCount = 0;
+   *   ReadSession response = baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+   * }
+   * 
+ * + * @param parent Required. The request project that owns the session, in the form of + * `projects/{project_id}`. + * @param readSession Required. Session to be created. + * @param maxStreamCount Max initial number of streams. If unset or zero, the server will provide + * a value of streams so as to produce reasonable throughput. Must be non-negative. The number + * of streams may be lower than the requested number, depending on the amount parallelism that + * is reasonable for the table. Error will be returned if the max count is greater than the + * current system max limit of 1,000. + *

Streams must be read starting from offset 0. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReadSession createReadSession( + String parent, ReadSession readSession, int maxStreamCount) { + CreateReadSessionRequest request = + CreateReadSessionRequest.newBuilder() + .setParent(parent) + .setReadSession(readSession) + .setMaxStreamCount(maxStreamCount) + .build(); + return createReadSession(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new read session. A read session divides the contents of a BigQuery table into one or + * more streams, which can then be used to read data from the table. The read session also + * specifies properties of the data to be read, such as a list of columns or a push-down filter + * describing the rows to be returned. + * + *

A particular row can be read by at most one stream. When the caller has reached the end of + * each stream in the session, then all the data in the table has been read. + * + *

Data is assigned to each stream such that roughly the same number of rows can be read from + * each stream. Because the server-side unit for assigning data is collections of rows, the API + * does not guarantee that each stream will return the same number or rows. Additionally, the + * limits are enforced based on the number of pre-filtered rows, so some filters can lead to + * lopsided assignments. + * + *

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

Sample code: + * + *


+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   CreateReadSessionRequest request = CreateReadSessionRequest.newBuilder().build();
+   *   ReadSession response = baseBigQueryReadClient.createReadSession(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReadSession createReadSession(CreateReadSessionRequest request) { + return createReadSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new read session. A read session divides the contents of a BigQuery table into one or + * more streams, which can then be used to read data from the table. The read session also + * specifies properties of the data to be read, such as a list of columns or a push-down filter + * describing the rows to be returned. + * + *

A particular row can be read by at most one stream. When the caller has reached the end of + * each stream in the session, then all the data in the table has been read. + * + *

Data is assigned to each stream such that roughly the same number of rows can be read from + * each stream. Because the server-side unit for assigning data is collections of rows, the API + * does not guarantee that each stream will return the same number or rows. Additionally, the + * limits are enforced based on the number of pre-filtered rows, so some filters can lead to + * lopsided assignments. + * + *

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

Sample code: + * + *


+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   CreateReadSessionRequest request = CreateReadSessionRequest.newBuilder().build();
+   *   ApiFuture<ReadSession> future = baseBigQueryReadClient.createReadSessionCallable().futureCall(request);
+   *   // Do something
+   *   ReadSession response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createReadSessionCallable() { + return stub.createReadSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Reads rows from the stream in the format prescribed by the ReadSession. Each response contains + * one or more table rows, up to a maximum of 100 MiB per response; read requests which attempt to + * read individual rows larger than 100 MiB will fail. + * + *

Each request also returns a set of stream statistics reflecting the current state of the + * stream. + * + *

Sample code: + * + *


+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   ReadRowsRequest request = ReadRowsRequest.newBuilder().build();
+   *
+   *   ServerStream<ReadRowsResponse> stream = baseBigQueryReadClient.readRowsCallable().call(request);
+   *   for (ReadRowsResponse response : stream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final ServerStreamingCallable readRowsCallable() { + return stub.readRowsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Splits a given `ReadStream` into two `ReadStream` objects. These `ReadStream` objects are + * referred to as the primary and the residual streams of the split. The original `ReadStream` can + * still be read from in the same manner as before. Both of the returned `ReadStream` objects can + * also be read from, and the rows returned by both child streams will be the same as the rows + * read from the original stream. + * + *

Moreover, the two child streams will be allocated back-to-back in the original `ReadStream`. + * Concretely, it is guaranteed that for streams original, primary, and residual, that + * original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read + * to completion. + * + *

Sample code: + * + *


+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   SplitReadStreamRequest request = SplitReadStreamRequest.newBuilder().build();
+   *   SplitReadStreamResponse response = baseBigQueryReadClient.splitReadStream(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SplitReadStreamResponse splitReadStream(SplitReadStreamRequest request) { + return splitReadStreamCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Splits a given `ReadStream` into two `ReadStream` objects. These `ReadStream` objects are + * referred to as the primary and the residual streams of the split. The original `ReadStream` can + * still be read from in the same manner as before. Both of the returned `ReadStream` objects can + * also be read from, and the rows returned by both child streams will be the same as the rows + * read from the original stream. + * + *

Moreover, the two child streams will be allocated back-to-back in the original `ReadStream`. + * Concretely, it is guaranteed that for streams original, primary, and residual, that + * original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read + * to completion. + * + *

Sample code: + * + *


+   * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+   *   SplitReadStreamRequest request = SplitReadStreamRequest.newBuilder().build();
+   *   ApiFuture<SplitReadStreamResponse> future = baseBigQueryReadClient.splitReadStreamCallable().futureCall(request);
+   *   // Do something
+   *   SplitReadStreamResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + splitReadStreamCallable() { + return stub.splitReadStreamCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} 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 new file mode 100644 index 0000000000..ed0e08871f --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadSettings.java @@ -0,0 +1,201 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.storage.v1.stub.BigQueryReadStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link BaseBigQueryReadClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigquerystorage.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

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

+ * 
+ * BaseBigQueryReadSettings.Builder baseBigQueryReadSettingsBuilder =
+ *     BaseBigQueryReadSettings.newBuilder();
+ * baseBigQueryReadSettingsBuilder.createReadSessionSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * BaseBigQueryReadSettings baseBigQueryReadSettings = baseBigQueryReadSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class BaseBigQueryReadSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createReadSession. */ + public UnaryCallSettings createReadSessionSettings() { + return ((BigQueryReadStubSettings) getStubSettings()).createReadSessionSettings(); + } + + /** Returns the object with the settings used for calls to readRows. */ + public ServerStreamingCallSettings readRowsSettings() { + return ((BigQueryReadStubSettings) getStubSettings()).readRowsSettings(); + } + + /** Returns the object with the settings used for calls to splitReadStream. */ + public UnaryCallSettings + splitReadStreamSettings() { + return ((BigQueryReadStubSettings) getStubSettings()).splitReadStreamSettings(); + } + + public static final BaseBigQueryReadSettings create(BigQueryReadStubSettings stub) + throws IOException { + return new BaseBigQueryReadSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return BigQueryReadStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return BigQueryReadStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return BigQueryReadStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return BigQueryReadStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return BigQueryReadStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return BigQueryReadStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return BigQueryReadStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BaseBigQueryReadSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for BaseBigQueryReadSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(BigQueryReadStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(BigQueryReadStubSettings.newBuilder()); + } + + protected Builder(BaseBigQueryReadSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(BigQueryReadStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public BigQueryReadStubSettings.Builder getStubSettingsBuilder() { + return ((BigQueryReadStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createReadSession. */ + public UnaryCallSettings.Builder + createReadSessionSettings() { + return getStubSettingsBuilder().createReadSessionSettings(); + } + + /** Returns the builder for the settings used for calls to readRows. */ + public ServerStreamingCallSettings.Builder + readRowsSettings() { + return getStubSettingsBuilder().readRowsSettings(); + } + + /** Returns the builder for the settings used for calls to splitReadStream. */ + public UnaryCallSettings.Builder + splitReadStreamSettings() { + return getStubSettingsBuilder().splitReadStreamSettings(); + } + + @Override + public BaseBigQueryReadSettings build() throws IOException { + return new BaseBigQueryReadSettings(this); + } + } +} 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 new file mode 100644 index 0000000000..0228be6042 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/package-info.java @@ -0,0 +1,44 @@ +/* + * 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. + */ + +/** + * A client to BigQuery Storage API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

====================== BaseBigQueryReadClient ====================== + * + *

Service Description: BigQuery Read API. + * + *

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

Sample for BaseBigQueryReadClient: + * + *

+ * 
+ * try (BaseBigQueryReadClient baseBigQueryReadClient = BaseBigQueryReadClient.create()) {
+ *   String parent = "";
+ *   ReadSession readSession = ReadSession.newBuilder().build();
+ *   int maxStreamCount = 0;
+ *   ReadSession response = baseBigQueryReadClient.createReadSession(parent, readSession, maxStreamCount);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.bigquery.storage.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStub.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStub.java new file mode 100644 index 0000000000..01bff92268 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStub.java @@ -0,0 +1,54 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsResponse; +import com.google.cloud.bigquery.storage.v1.ReadSession; +import com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest; +import com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for BigQuery Storage API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class BigQueryReadStub implements BackgroundResource { + + public UnaryCallable createReadSessionCallable() { + throw new UnsupportedOperationException("Not implemented: createReadSessionCallable()"); + } + + public ServerStreamingCallable readRowsCallable() { + throw new UnsupportedOperationException("Not implemented: readRowsCallable()"); + } + + public UnaryCallable splitReadStreamCallable() { + throw new UnsupportedOperationException("Not implemented: splitReadStreamCallable()"); + } + + @Override + public abstract void close(); +} 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 new file mode 100644 index 0000000000..3040cae377 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java @@ -0,0 +1,353 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsResponse; +import com.google.cloud.bigquery.storage.v1.ReadSession; +import com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest; +import com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link BigQueryReadStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigquerystorage.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

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

+ * 
+ * BigQueryReadStubSettings.Builder baseBigQueryReadSettingsBuilder =
+ *     BigQueryReadStubSettings.newBuilder();
+ * baseBigQueryReadSettingsBuilder.createReadSessionSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * BigQueryReadStubSettings baseBigQueryReadSettings = baseBigQueryReadSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class BigQueryReadStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigquery") + .add("https://www.googleapis.com/auth/bigquery.readonly") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private final UnaryCallSettings createReadSessionSettings; + private final ServerStreamingCallSettings readRowsSettings; + private final UnaryCallSettings + splitReadStreamSettings; + + /** Returns the object with the settings used for calls to createReadSession. */ + public UnaryCallSettings createReadSessionSettings() { + return createReadSessionSettings; + } + + /** Returns the object with the settings used for calls to readRows. */ + public ServerStreamingCallSettings readRowsSettings() { + return readRowsSettings; + } + + /** Returns the object with the settings used for calls to splitReadStream. */ + public UnaryCallSettings + splitReadStreamSettings() { + return splitReadStreamSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public BigQueryReadStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcBigQueryReadStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "bigquerystorage.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(BigQueryReadStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BigQueryReadStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createReadSessionSettings = settingsBuilder.createReadSessionSettings().build(); + readRowsSettings = settingsBuilder.readRowsSettings().build(); + splitReadStreamSettings = settingsBuilder.splitReadStreamSettings().build(); + } + + /** Builder for BigQueryReadStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createReadSessionSettings; + private final ServerStreamingCallSettings.Builder + readRowsSettings; + private final UnaryCallSettings.Builder + splitReadStreamSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "unary_streaming", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("create_read_session", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(86400000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(86400000L)) + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build(); + definitions.put("read_rows", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createReadSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + readRowsSettings = ServerStreamingCallSettings.newBuilder(); + + splitReadStreamSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createReadSessionSettings, splitReadStreamSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createReadSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("create_read_session")); + + builder + .readRowsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("unary_streaming")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("read_rows")); + + builder + .splitReadStreamSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(BigQueryReadStubSettings settings) { + super(settings); + + createReadSessionSettings = settings.createReadSessionSettings.toBuilder(); + readRowsSettings = settings.readRowsSettings.toBuilder(); + splitReadStreamSettings = settings.splitReadStreamSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createReadSessionSettings, splitReadStreamSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createReadSession. */ + public UnaryCallSettings.Builder + createReadSessionSettings() { + return createReadSessionSettings; + } + + /** Returns the builder for the settings used for calls to readRows. */ + public ServerStreamingCallSettings.Builder + readRowsSettings() { + return readRowsSettings; + } + + /** Returns the builder for the settings used for calls to splitReadStream. */ + public UnaryCallSettings.Builder + splitReadStreamSettings() { + return splitReadStreamSettings; + } + + @Override + public BigQueryReadStubSettings build() throws IOException { + return new BigQueryReadStubSettings(this); + } + } +} diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadCallableFactory.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadCallableFactory.java new file mode 100644 index 0000000000..886b58e704 --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for BigQuery Storage API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcBigQueryReadCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java new file mode 100644 index 0000000000..edb90c4e5a --- /dev/null +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/GrpcBigQueryReadStub.java @@ -0,0 +1,223 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsResponse; +import com.google.cloud.bigquery.storage.v1.ReadSession; +import com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest; +import com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse; +import com.google.common.collect.ImmutableMap; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for BigQuery Storage API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcBigQueryReadStub extends BigQueryReadStub { + + private static final MethodDescriptor + createReadSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.storage.v1.BigQueryRead/CreateReadSession") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateReadSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReadSession.getDefaultInstance())) + .build(); + private static final MethodDescriptor + readRowsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.cloud.bigquery.storage.v1.BigQueryRead/ReadRows") + .setRequestMarshaller(ProtoUtils.marshaller(ReadRowsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReadRowsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + splitReadStreamMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.storage.v1.BigQueryRead/SplitReadStream") + .setRequestMarshaller( + ProtoUtils.marshaller(SplitReadStreamRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SplitReadStreamResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createReadSessionCallable; + private final ServerStreamingCallable readRowsCallable; + private final UnaryCallable + splitReadStreamCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcBigQueryReadStub create(BigQueryReadStubSettings settings) + throws IOException { + return new GrpcBigQueryReadStub(settings, ClientContext.create(settings)); + } + + public static final GrpcBigQueryReadStub create(ClientContext clientContext) throws IOException { + return new GrpcBigQueryReadStub(BigQueryReadStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcBigQueryReadStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcBigQueryReadStub( + BigQueryReadStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcBigQueryReadStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcBigQueryReadStub(BigQueryReadStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcBigQueryReadCallableFactory()); + } + + /** + * Constructs an instance of GrpcBigQueryReadStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcBigQueryReadStub( + BigQueryReadStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createReadSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createReadSessionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateReadSessionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "read_session.table", String.valueOf(request.getReadSession().getTable())); + return params.build(); + } + }) + .build(); + GrpcCallSettings readRowsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(readRowsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ReadRowsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("read_stream", String.valueOf(request.getReadStream())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + splitReadStreamTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(splitReadStreamMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SplitReadStreamRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.createReadSessionCallable = + callableFactory.createUnaryCallable( + createReadSessionTransportSettings, + settings.createReadSessionSettings(), + clientContext); + this.readRowsCallable = + callableFactory.createServerStreamingCallable( + readRowsTransportSettings, settings.readRowsSettings(), clientContext); + this.splitReadStreamCallable = + callableFactory.createUnaryCallable( + splitReadStreamTransportSettings, settings.splitReadStreamSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createReadSessionCallable() { + return createReadSessionCallable; + } + + public ServerStreamingCallable readRowsCallable() { + return readRowsCallable; + } + + public UnaryCallable splitReadStreamCallable() { + return splitReadStreamCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java new file mode 100644 index 0000000000..71160a8ae1 --- /dev/null +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java @@ -0,0 +1,166 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.protobuf.AbstractMessage; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class BaseBigQueryReadClientTest { + private static MockBigQueryRead mockBigQueryRead; + private static MockServiceHelper serviceHelper; + private BaseBigQueryReadClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockBigQueryRead = new MockBigQueryRead(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockBigQueryRead)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + BaseBigQueryReadSettings settings = + BaseBigQueryReadSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = BaseBigQueryReadClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createReadSessionTest() { + String name = "name3373707"; + String table = "table110115790"; + ReadSession expectedResponse = ReadSession.newBuilder().setName(name).setTable(table).build(); + mockBigQueryRead.addResponse(expectedResponse); + + String parent = "parent-995424086"; + ReadSession readSession = ReadSession.newBuilder().build(); + int maxStreamCount = 940837515; + + ReadSession actualResponse = client.createReadSession(parent, readSession, maxStreamCount); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigQueryRead.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReadSessionRequest actualRequest = (CreateReadSessionRequest) actualRequests.get(0); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(readSession, actualRequest.getReadSession()); + Assert.assertEquals(maxStreamCount, actualRequest.getMaxStreamCount()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createReadSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockBigQueryRead.addException(exception); + + try { + String parent = "parent-995424086"; + ReadSession readSession = ReadSession.newBuilder().build(); + int maxStreamCount = 940837515; + + client.createReadSession(parent, readSession, maxStreamCount); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void readRowsTest() throws Exception { + long rowCount = 1340416618L; + ReadRowsResponse expectedResponse = ReadRowsResponse.newBuilder().setRowCount(rowCount).build(); + mockBigQueryRead.addResponse(expectedResponse); + ReadRowsRequest request = ReadRowsRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.readRowsCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void readRowsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockBigQueryRead.addException(exception); + ReadRowsRequest request = ReadRowsRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.readRowsCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryRead.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryRead.java new file mode 100644 index 0000000000..6c578b0d17 --- /dev/null +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryRead.java @@ -0,0 +1,57 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockBigQueryRead implements MockGrpcService { + private final MockBigQueryReadImpl serviceImpl; + + public MockBigQueryRead() { + serviceImpl = new MockBigQueryReadImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java new file mode 100644 index 0000000000..b6e022ac6f --- /dev/null +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java @@ -0,0 +1,102 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigquery.storage.v1.BigQueryReadGrpc.BigQueryReadImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockBigQueryReadImpl extends BigQueryReadImplBase { + private List requests; + private Queue responses; + + public MockBigQueryReadImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createReadSession( + CreateReadSessionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ReadSession) { + requests.add(request); + responseObserver.onNext((ReadSession) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void readRows(ReadRowsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ReadRowsResponse) { + requests.add(request); + responseObserver.onNext((ReadRowsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void splitReadStream( + SplitReadStreamRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SplitReadStreamResponse) { + requests.add(request); + responseObserver.onNext((SplitReadStreamResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-bigquerystorage-v1/pom.xml b/grpc-google-cloud-bigquerystorage-v1/pom.xml new file mode 100644 index 0000000000..06209d87ad --- /dev/null +++ b/grpc-google-cloud-bigquerystorage-v1/pom.xml @@ -0,0 +1,56 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-bigquerystorage-v1 + 0.87.1-SNAPSHOT + grpc-google-cloud-bigquerystorage-v1 + GRPC library for grpc-google-cloud-bigquerystorage-v1 + + com.google.cloud + google-cloud-bigquerystorage-parent + 0.122.1-beta-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryReadGrpc.java b/grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryReadGrpc.java new file mode 100644 index 0000000000..fb8880f8cd --- /dev/null +++ b/grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryReadGrpc.java @@ -0,0 +1,699 @@ +/* + * 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. + */ +package com.google.cloud.bigquery.storage.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * BigQuery Read API.
+ * The Read API can be used to read data from BigQuery.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/bigquery/storage/v1/storage.proto") +public final class BigQueryReadGrpc { + + private BigQueryReadGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.bigquery.storage.v1.BigQueryRead"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest, + com.google.cloud.bigquery.storage.v1.ReadSession> + getCreateReadSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateReadSession", + requestType = com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.class, + responseType = com.google.cloud.bigquery.storage.v1.ReadSession.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest, + com.google.cloud.bigquery.storage.v1.ReadSession> + getCreateReadSessionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest, + com.google.cloud.bigquery.storage.v1.ReadSession> + getCreateReadSessionMethod; + if ((getCreateReadSessionMethod = BigQueryReadGrpc.getCreateReadSessionMethod) == null) { + synchronized (BigQueryReadGrpc.class) { + if ((getCreateReadSessionMethod = BigQueryReadGrpc.getCreateReadSessionMethod) == null) { + BigQueryReadGrpc.getCreateReadSessionMethod = + getCreateReadSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateReadSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.storage.v1.ReadSession + .getDefaultInstance())) + .setSchemaDescriptor( + new BigQueryReadMethodDescriptorSupplier("CreateReadSession")) + .build(); + } + } + } + return getCreateReadSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.ReadRowsRequest, + com.google.cloud.bigquery.storage.v1.ReadRowsResponse> + getReadRowsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReadRows", + requestType = com.google.cloud.bigquery.storage.v1.ReadRowsRequest.class, + responseType = com.google.cloud.bigquery.storage.v1.ReadRowsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.ReadRowsRequest, + com.google.cloud.bigquery.storage.v1.ReadRowsResponse> + getReadRowsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.ReadRowsRequest, + com.google.cloud.bigquery.storage.v1.ReadRowsResponse> + getReadRowsMethod; + if ((getReadRowsMethod = BigQueryReadGrpc.getReadRowsMethod) == null) { + synchronized (BigQueryReadGrpc.class) { + if ((getReadRowsMethod = BigQueryReadGrpc.getReadRowsMethod) == null) { + BigQueryReadGrpc.getReadRowsMethod = + getReadRowsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadRows")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.storage.v1.ReadRowsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.storage.v1.ReadRowsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new BigQueryReadMethodDescriptorSupplier("ReadRows")) + .build(); + } + } + } + return getReadRowsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest, + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse> + getSplitReadStreamMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SplitReadStream", + requestType = com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.class, + responseType = com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest, + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse> + getSplitReadStreamMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest, + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse> + getSplitReadStreamMethod; + if ((getSplitReadStreamMethod = BigQueryReadGrpc.getSplitReadStreamMethod) == null) { + synchronized (BigQueryReadGrpc.class) { + if ((getSplitReadStreamMethod = BigQueryReadGrpc.getSplitReadStreamMethod) == null) { + BigQueryReadGrpc.getSplitReadStreamMethod = + getSplitReadStreamMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SplitReadStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigQueryReadMethodDescriptorSupplier("SplitReadStream")) + .build(); + } + } + } + return getSplitReadStreamMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static BigQueryReadStub newStub(io.grpc.Channel channel) { + return new BigQueryReadStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static BigQueryReadBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new BigQueryReadBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static BigQueryReadFutureStub newFutureStub(io.grpc.Channel channel) { + return new BigQueryReadFutureStub(channel); + } + + /** + * + * + *
+   * BigQuery Read API.
+   * The Read API can be used to read data from BigQuery.
+   * 
+ */ + public abstract static class BigQueryReadImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a new read session. A read session divides the contents of a
+     * BigQuery table into one or more streams, which can then be used to read
+     * data from the table. The read session also specifies properties of the
+     * data to be read, such as a list of columns or a push-down filter describing
+     * the rows to be returned.
+     * A particular row can be read by at most one stream. When the caller has
+     * reached the end of each stream in the session, then all the data in the
+     * table has been read.
+     * Data is assigned to each stream such that roughly the same number of
+     * rows can be read from each stream. Because the server-side unit for
+     * assigning data is collections of rows, the API does not guarantee that
+     * each stream will return the same number or rows. Additionally, the
+     * limits are enforced based on the number of pre-filtered rows, so some
+     * filters can lead to lopsided assignments.
+     * Read sessions automatically expire 24 hours after they are created and do
+     * not require manual clean-up by the caller.
+     * 
+ */ + public void createReadSession( + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateReadSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Reads rows from the stream in the format prescribed by the ReadSession.
+     * Each response contains one or more table rows, up to a maximum of 100 MiB
+     * per response; read requests which attempt to read individual rows larger
+     * than 100 MiB will fail.
+     * Each request also returns a set of stream statistics reflecting the current
+     * state of the stream.
+     * 
+ */ + public void readRows( + com.google.cloud.bigquery.storage.v1.ReadRowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getReadRowsMethod(), responseObserver); + } + + /** + * + * + *
+     * Splits a given `ReadStream` into two `ReadStream` objects. These
+     * `ReadStream` objects are referred to as the primary and the residual
+     * streams of the split. The original `ReadStream` can still be read from in
+     * the same manner as before. Both of the returned `ReadStream` objects can
+     * also be read from, and the rows returned by both child streams will be
+     * the same as the rows read from the original stream.
+     * Moreover, the two child streams will be allocated back-to-back in the
+     * original `ReadStream`. Concretely, it is guaranteed that for streams
+     * original, primary, and residual, that original[0-j] = primary[0-j] and
+     * original[j-n] = residual[0-m] once the streams have been read to
+     * completion.
+     * 
+ */ + public void splitReadStream( + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getSplitReadStreamMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateReadSessionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest, + com.google.cloud.bigquery.storage.v1.ReadSession>( + this, METHODID_CREATE_READ_SESSION))) + .addMethod( + getReadRowsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + com.google.cloud.bigquery.storage.v1.ReadRowsRequest, + com.google.cloud.bigquery.storage.v1.ReadRowsResponse>( + this, METHODID_READ_ROWS))) + .addMethod( + getSplitReadStreamMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest, + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse>( + this, METHODID_SPLIT_READ_STREAM))) + .build(); + } + } + + /** + * + * + *
+   * BigQuery Read API.
+   * The Read API can be used to read data from BigQuery.
+   * 
+ */ + public static final class BigQueryReadStub extends io.grpc.stub.AbstractStub { + private BigQueryReadStub(io.grpc.Channel channel) { + super(channel); + } + + private BigQueryReadStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigQueryReadStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigQueryReadStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new read session. A read session divides the contents of a
+     * BigQuery table into one or more streams, which can then be used to read
+     * data from the table. The read session also specifies properties of the
+     * data to be read, such as a list of columns or a push-down filter describing
+     * the rows to be returned.
+     * A particular row can be read by at most one stream. When the caller has
+     * reached the end of each stream in the session, then all the data in the
+     * table has been read.
+     * Data is assigned to each stream such that roughly the same number of
+     * rows can be read from each stream. Because the server-side unit for
+     * assigning data is collections of rows, the API does not guarantee that
+     * each stream will return the same number or rows. Additionally, the
+     * limits are enforced based on the number of pre-filtered rows, so some
+     * filters can lead to lopsided assignments.
+     * Read sessions automatically expire 24 hours after they are created and do
+     * not require manual clean-up by the caller.
+     * 
+ */ + public void createReadSession( + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateReadSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reads rows from the stream in the format prescribed by the ReadSession.
+     * Each response contains one or more table rows, up to a maximum of 100 MiB
+     * per response; read requests which attempt to read individual rows larger
+     * than 100 MiB will fail.
+     * Each request also returns a set of stream statistics reflecting the current
+     * state of the stream.
+     * 
+ */ + public void readRows( + com.google.cloud.bigquery.storage.v1.ReadRowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getReadRowsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Splits a given `ReadStream` into two `ReadStream` objects. These
+     * `ReadStream` objects are referred to as the primary and the residual
+     * streams of the split. The original `ReadStream` can still be read from in
+     * the same manner as before. Both of the returned `ReadStream` objects can
+     * also be read from, and the rows returned by both child streams will be
+     * the same as the rows read from the original stream.
+     * Moreover, the two child streams will be allocated back-to-back in the
+     * original `ReadStream`. Concretely, it is guaranteed that for streams
+     * original, primary, and residual, that original[0-j] = primary[0-j] and
+     * original[j-n] = residual[0-m] once the streams have been read to
+     * completion.
+     * 
+ */ + public void splitReadStream( + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSplitReadStreamMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * BigQuery Read API.
+   * The Read API can be used to read data from BigQuery.
+   * 
+ */ + public static final class BigQueryReadBlockingStub + extends io.grpc.stub.AbstractStub { + private BigQueryReadBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private BigQueryReadBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigQueryReadBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigQueryReadBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new read session. A read session divides the contents of a
+     * BigQuery table into one or more streams, which can then be used to read
+     * data from the table. The read session also specifies properties of the
+     * data to be read, such as a list of columns or a push-down filter describing
+     * the rows to be returned.
+     * A particular row can be read by at most one stream. When the caller has
+     * reached the end of each stream in the session, then all the data in the
+     * table has been read.
+     * Data is assigned to each stream such that roughly the same number of
+     * rows can be read from each stream. Because the server-side unit for
+     * assigning data is collections of rows, the API does not guarantee that
+     * each stream will return the same number or rows. Additionally, the
+     * limits are enforced based on the number of pre-filtered rows, so some
+     * filters can lead to lopsided assignments.
+     * Read sessions automatically expire 24 hours after they are created and do
+     * not require manual clean-up by the caller.
+     * 
+ */ + public com.google.cloud.bigquery.storage.v1.ReadSession createReadSession( + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest request) { + return blockingUnaryCall( + getChannel(), getCreateReadSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reads rows from the stream in the format prescribed by the ReadSession.
+     * Each response contains one or more table rows, up to a maximum of 100 MiB
+     * per response; read requests which attempt to read individual rows larger
+     * than 100 MiB will fail.
+     * Each request also returns a set of stream statistics reflecting the current
+     * state of the stream.
+     * 
+ */ + public java.util.Iterator readRows( + com.google.cloud.bigquery.storage.v1.ReadRowsRequest request) { + return blockingServerStreamingCall( + getChannel(), getReadRowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Splits a given `ReadStream` into two `ReadStream` objects. These
+     * `ReadStream` objects are referred to as the primary and the residual
+     * streams of the split. The original `ReadStream` can still be read from in
+     * the same manner as before. Both of the returned `ReadStream` objects can
+     * also be read from, and the rows returned by both child streams will be
+     * the same as the rows read from the original stream.
+     * Moreover, the two child streams will be allocated back-to-back in the
+     * original `ReadStream`. Concretely, it is guaranteed that for streams
+     * original, primary, and residual, that original[0-j] = primary[0-j] and
+     * original[j-n] = residual[0-m] once the streams have been read to
+     * completion.
+     * 
+ */ + public com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse splitReadStream( + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest request) { + return blockingUnaryCall(getChannel(), getSplitReadStreamMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * BigQuery Read API.
+   * The Read API can be used to read data from BigQuery.
+   * 
+ */ + public static final class BigQueryReadFutureStub + extends io.grpc.stub.AbstractStub { + private BigQueryReadFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private BigQueryReadFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigQueryReadFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigQueryReadFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new read session. A read session divides the contents of a
+     * BigQuery table into one or more streams, which can then be used to read
+     * data from the table. The read session also specifies properties of the
+     * data to be read, such as a list of columns or a push-down filter describing
+     * the rows to be returned.
+     * A particular row can be read by at most one stream. When the caller has
+     * reached the end of each stream in the session, then all the data in the
+     * table has been read.
+     * Data is assigned to each stream such that roughly the same number of
+     * rows can be read from each stream. Because the server-side unit for
+     * assigning data is collections of rows, the API does not guarantee that
+     * each stream will return the same number or rows. Additionally, the
+     * limits are enforced based on the number of pre-filtered rows, so some
+     * filters can lead to lopsided assignments.
+     * Read sessions automatically expire 24 hours after they are created and do
+     * not require manual clean-up by the caller.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.storage.v1.ReadSession> + createReadSession(com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateReadSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Splits a given `ReadStream` into two `ReadStream` objects. These
+     * `ReadStream` objects are referred to as the primary and the residual
+     * streams of the split. The original `ReadStream` can still be read from in
+     * the same manner as before. Both of the returned `ReadStream` objects can
+     * also be read from, and the rows returned by both child streams will be
+     * the same as the rows read from the original stream.
+     * Moreover, the two child streams will be allocated back-to-back in the
+     * original `ReadStream`. Concretely, it is guaranteed that for streams
+     * original, primary, and residual, that original[0-j] = primary[0-j] and
+     * original[j-n] = residual[0-m] once the streams have been read to
+     * completion.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse> + splitReadStream(com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest request) { + return futureUnaryCall( + getChannel().newCall(getSplitReadStreamMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_READ_SESSION = 0; + private static final int METHODID_READ_ROWS = 1; + private static final int METHODID_SPLIT_READ_STREAM = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final BigQueryReadImplBase serviceImpl; + private final int methodId; + + MethodHandlers(BigQueryReadImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_READ_SESSION: + serviceImpl.createReadSession( + (com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_READ_ROWS: + serviceImpl.readRows( + (com.google.cloud.bigquery.storage.v1.ReadRowsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SPLIT_READ_STREAM: + serviceImpl.splitReadStream( + (com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class BigQueryReadBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + BigQueryReadBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("BigQueryRead"); + } + } + + private static final class BigQueryReadFileDescriptorSupplier + extends BigQueryReadBaseDescriptorSupplier { + BigQueryReadFileDescriptorSupplier() {} + } + + private static final class BigQueryReadMethodDescriptorSupplier + extends BigQueryReadBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + BigQueryReadMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (BigQueryReadGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new BigQueryReadFileDescriptorSupplier()) + .addMethod(getCreateReadSessionMethod()) + .addMethod(getReadRowsMethod()) + .addMethod(getSplitReadStreamMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index a4506725cf..56fbfe5eeb 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,12 @@ proto-google-cloud-bigquerystorage-v1beta2 0.87.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + 0.87.1-SNAPSHOT + + com.google.api.grpc grpc-google-cloud-bigquerystorage-v1alpha2 @@ -110,6 +116,11 @@ grpc-google-cloud-bigquerystorage-v1beta2 0.87.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-bigquerystorage-v1 + 0.87.1-SNAPSHOT + com.google.auto.value auto-value-annotations @@ -213,9 +224,11 @@ proto-google-cloud-bigquerystorage-v1alpha2 proto-google-cloud-bigquerystorage-v1beta1 proto-google-cloud-bigquerystorage-v1beta2 + proto-google-cloud-bigquerystorage-v1 grpc-google-cloud-bigquerystorage-v1alpha2 grpc-google-cloud-bigquerystorage-v1beta1 grpc-google-cloud-bigquerystorage-v1beta2 + grpc-google-cloud-bigquerystorage-v1 google-cloud-bigquerystorage google-cloud-bigquerystorage-bom diff --git a/proto-google-cloud-bigquerystorage-v1/pom.xml b/proto-google-cloud-bigquerystorage-v1/pom.xml new file mode 100644 index 0000000000..d048280284 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + 0.87.1-SNAPSHOT + proto-google-cloud-bigquerystorage-v1 + PROTO library for proto-google-cloud-bigquerystorage-v1 + + com.google.cloud + google-cloud-bigquerystorage-parent + 0.122.1-beta-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + \ No newline at end of file diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowProto.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowProto.java new file mode 100644 index 0000000000..a85c3f343c --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowProto.java @@ -0,0 +1,79 @@ +/* + * 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/arrow.proto + +package com.google.cloud.bigquery.storage.v1; + +public final class ArrowProto { + private ArrowProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/cloud/bigquery/storage/v1/arrow" + + ".proto\022 google.cloud.bigquery.storage.v1" + + "\"(\n\013ArrowSchema\022\031\n\021serialized_schema\030\001 \001" + + "(\014\"F\n\020ArrowRecordBatch\022\037\n\027serialized_rec" + + "ord_batch\030\001 \001(\014\022\021\n\trow_count\030\002 \001(\003B}\n$co" + + "m.google.cloud.bigquery.storage.v1B\nArro" + + "wProtoP\001ZGgoogle.golang.org/genproto/goo" + + "gleapis/cloud/bigquery/storage/v1;storag" + + "eb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_descriptor, + new java.lang.String[] { + "SerializedSchema", + }); + internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_descriptor, + new java.lang.String[] { + "SerializedRecordBatch", "RowCount", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatch.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatch.java new file mode 100644 index 0000000000..e34a9abbf2 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatch.java @@ -0,0 +1,639 @@ +/* + * 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/arrow.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Arrow RecordBatch.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ArrowRecordBatch} + */ +public final class ArrowRecordBatch extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ArrowRecordBatch) + ArrowRecordBatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use ArrowRecordBatch.newBuilder() to construct. + private ArrowRecordBatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ArrowRecordBatch() { + serializedRecordBatch_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ArrowRecordBatch(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ArrowRecordBatch( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + serializedRecordBatch_ = input.readBytes(); + break; + } + case 16: + { + rowCount_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.class, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder.class); + } + + public static final int SERIALIZED_RECORD_BATCH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString serializedRecordBatch_; + /** + * + * + *
+   * IPC-serialized Arrow RecordBatch.
+   * 
+ * + * bytes serialized_record_batch = 1; + * + * @return The serializedRecordBatch. + */ + public com.google.protobuf.ByteString getSerializedRecordBatch() { + return serializedRecordBatch_; + } + + public static final int ROW_COUNT_FIELD_NUMBER = 2; + private long rowCount_; + /** + * + * + *
+   * The count of rows in `serialized_record_batch`.
+   * 
+ * + * int64 row_count = 2; + * + * @return The rowCount. + */ + public long getRowCount() { + return rowCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!serializedRecordBatch_.isEmpty()) { + output.writeBytes(1, serializedRecordBatch_); + } + if (rowCount_ != 0L) { + output.writeInt64(2, rowCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!serializedRecordBatch_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, serializedRecordBatch_); + } + if (rowCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, rowCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ArrowRecordBatch)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch other = + (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) obj; + + if (!getSerializedRecordBatch().equals(other.getSerializedRecordBatch())) return false; + if (getRowCount() != other.getRowCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERIALIZED_RECORD_BATCH_FIELD_NUMBER; + hash = (53 * hash) + getSerializedRecordBatch().hashCode(); + hash = (37 * hash) + ROW_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Arrow RecordBatch.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ArrowRecordBatch} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ArrowRecordBatch) + com.google.cloud.bigquery.storage.v1.ArrowRecordBatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.class, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + serializedRecordBatch_ = com.google.protobuf.ByteString.EMPTY; + + rowCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowRecordBatch_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatch getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatch build() { + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatch buildPartial() { + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch result = + new com.google.cloud.bigquery.storage.v1.ArrowRecordBatch(this); + result.serializedRecordBatch_ = serializedRecordBatch_; + result.rowCount_ = rowCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ArrowRecordBatch other) { + if (other == com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance()) + return this; + if (other.getSerializedRecordBatch() != com.google.protobuf.ByteString.EMPTY) { + setSerializedRecordBatch(other.getSerializedRecordBatch()); + } + if (other.getRowCount() != 0L) { + setRowCount(other.getRowCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString serializedRecordBatch_ = + com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * IPC-serialized Arrow RecordBatch.
+     * 
+ * + * bytes serialized_record_batch = 1; + * + * @return The serializedRecordBatch. + */ + public com.google.protobuf.ByteString getSerializedRecordBatch() { + return serializedRecordBatch_; + } + /** + * + * + *
+     * IPC-serialized Arrow RecordBatch.
+     * 
+ * + * bytes serialized_record_batch = 1; + * + * @param value The serializedRecordBatch to set. + * @return This builder for chaining. + */ + public Builder setSerializedRecordBatch(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + serializedRecordBatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * IPC-serialized Arrow RecordBatch.
+     * 
+ * + * bytes serialized_record_batch = 1; + * + * @return This builder for chaining. + */ + public Builder clearSerializedRecordBatch() { + + serializedRecordBatch_ = getDefaultInstance().getSerializedRecordBatch(); + onChanged(); + return this; + } + + private long rowCount_; + /** + * + * + *
+     * The count of rows in `serialized_record_batch`.
+     * 
+ * + * int64 row_count = 2; + * + * @return The rowCount. + */ + public long getRowCount() { + return rowCount_; + } + /** + * + * + *
+     * The count of rows in `serialized_record_batch`.
+     * 
+ * + * int64 row_count = 2; + * + * @param value The rowCount to set. + * @return This builder for chaining. + */ + public Builder setRowCount(long value) { + + rowCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The count of rows in `serialized_record_batch`.
+     * 
+ * + * int64 row_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearRowCount() { + + rowCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ArrowRecordBatch) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ArrowRecordBatch) + private static final com.google.cloud.bigquery.storage.v1.ArrowRecordBatch DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ArrowRecordBatch(); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowRecordBatch getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ArrowRecordBatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ArrowRecordBatch(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatch getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatchOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatchOrBuilder.java new file mode 100644 index 0000000000..b6a38ab736 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowRecordBatchOrBuilder.java @@ -0,0 +1,51 @@ +/* + * 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/arrow.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface ArrowRecordBatchOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ArrowRecordBatch) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * IPC-serialized Arrow RecordBatch.
+   * 
+ * + * bytes serialized_record_batch = 1; + * + * @return The serializedRecordBatch. + */ + com.google.protobuf.ByteString getSerializedRecordBatch(); + + /** + * + * + *
+   * The count of rows in `serialized_record_batch`.
+   * 
+ * + * int64 row_count = 2; + * + * @return The rowCount. + */ + long getRowCount(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchema.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchema.java new file mode 100644 index 0000000000..3080140c6d --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchema.java @@ -0,0 +1,556 @@ +/* + * 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/arrow.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Arrow schema as specified in
+ * https://arrow.apache.org/docs/python/api/datatypes.html
+ * and serialized to bytes using IPC:
+ * https://arrow.apache.org/docs/ipc.html.
+ * See code samples on how this message can be deserialized.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ArrowSchema} + */ +public final class ArrowSchema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ArrowSchema) + ArrowSchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use ArrowSchema.newBuilder() to construct. + private ArrowSchema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ArrowSchema() { + serializedSchema_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ArrowSchema(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ArrowSchema( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + serializedSchema_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ArrowSchema.class, + com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder.class); + } + + public static final int SERIALIZED_SCHEMA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString serializedSchema_; + /** + * + * + *
+   * IPC serialized Arrow schema.
+   * 
+ * + * bytes serialized_schema = 1; + * + * @return The serializedSchema. + */ + public com.google.protobuf.ByteString getSerializedSchema() { + return serializedSchema_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!serializedSchema_.isEmpty()) { + output.writeBytes(1, serializedSchema_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!serializedSchema_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, serializedSchema_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ArrowSchema)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ArrowSchema other = + (com.google.cloud.bigquery.storage.v1.ArrowSchema) obj; + + if (!getSerializedSchema().equals(other.getSerializedSchema())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERIALIZED_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSerializedSchema().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.ArrowSchema prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Arrow schema as specified in
+   * https://arrow.apache.org/docs/python/api/datatypes.html
+   * and serialized to bytes using IPC:
+   * https://arrow.apache.org/docs/ipc.html.
+   * See code samples on how this message can be deserialized.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ArrowSchema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ArrowSchema) + com.google.cloud.bigquery.storage.v1.ArrowSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ArrowSchema.class, + com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.ArrowSchema.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + serializedSchema_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.ArrowProto + .internal_static_google_cloud_bigquery_storage_v1_ArrowSchema_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowSchema getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowSchema build() { + com.google.cloud.bigquery.storage.v1.ArrowSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowSchema buildPartial() { + com.google.cloud.bigquery.storage.v1.ArrowSchema result = + new com.google.cloud.bigquery.storage.v1.ArrowSchema(this); + result.serializedSchema_ = serializedSchema_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ArrowSchema) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ArrowSchema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ArrowSchema other) { + if (other == com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance()) + return this; + if (other.getSerializedSchema() != com.google.protobuf.ByteString.EMPTY) { + setSerializedSchema(other.getSerializedSchema()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ArrowSchema parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.bigquery.storage.v1.ArrowSchema) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString serializedSchema_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * IPC serialized Arrow schema.
+     * 
+ * + * bytes serialized_schema = 1; + * + * @return The serializedSchema. + */ + public com.google.protobuf.ByteString getSerializedSchema() { + return serializedSchema_; + } + /** + * + * + *
+     * IPC serialized Arrow schema.
+     * 
+ * + * bytes serialized_schema = 1; + * + * @param value The serializedSchema to set. + * @return This builder for chaining. + */ + public Builder setSerializedSchema(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + serializedSchema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * IPC serialized Arrow schema.
+     * 
+ * + * bytes serialized_schema = 1; + * + * @return This builder for chaining. + */ + public Builder clearSerializedSchema() { + + serializedSchema_ = getDefaultInstance().getSerializedSchema(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ArrowSchema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ArrowSchema) + private static final com.google.cloud.bigquery.storage.v1.ArrowSchema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ArrowSchema(); + } + + public static com.google.cloud.bigquery.storage.v1.ArrowSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ArrowSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ArrowSchema(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ArrowSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchemaOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchemaOrBuilder.java new file mode 100644 index 0000000000..d123329e39 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ArrowSchemaOrBuilder.java @@ -0,0 +1,38 @@ +/* + * 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/arrow.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface ArrowSchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ArrowSchema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * IPC serialized Arrow schema.
+   * 
+ * + * bytes serialized_schema = 1; + * + * @return The serializedSchema. + */ + com.google.protobuf.ByteString getSerializedSchema(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroProto.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroProto.java new file mode 100644 index 0000000000..abf6aa7b3f --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroProto.java @@ -0,0 +1,78 @@ +/* + * 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/avro.proto + +package com.google.cloud.bigquery.storage.v1; + +public final class AvroProto { + private AvroProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_AvroSchema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_AvroSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_AvroRows_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_AvroRows_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/cloud/bigquery/storage/v1/avro." + + "proto\022 google.cloud.bigquery.storage.v1\"" + + "\034\n\nAvroSchema\022\016\n\006schema\030\001 \001(\t\"=\n\010AvroRow" + + "s\022\036\n\026serialized_binary_rows\030\001 \001(\014\022\021\n\trow" + + "_count\030\002 \001(\003B|\n$com.google.cloud.bigquer" + + "y.storage.v1B\tAvroProtoP\001ZGgoogle.golang" + + ".org/genproto/googleapis/cloud/bigquery/" + + "storage/v1;storageb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_bigquery_storage_v1_AvroSchema_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_storage_v1_AvroSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_AvroSchema_descriptor, + new java.lang.String[] { + "Schema", + }); + internal_static_google_cloud_bigquery_storage_v1_AvroRows_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_storage_v1_AvroRows_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_AvroRows_descriptor, + new java.lang.String[] { + "SerializedBinaryRows", "RowCount", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRows.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRows.java new file mode 100644 index 0000000000..e7654adaee --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRows.java @@ -0,0 +1,636 @@ +/* + * 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/avro.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Avro rows.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.AvroRows} + */ +public final class AvroRows extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.AvroRows) + AvroRowsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AvroRows.newBuilder() to construct. + private AvroRows(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AvroRows() { + serializedBinaryRows_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AvroRows(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AvroRows( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + serializedBinaryRows_ = input.readBytes(); + break; + } + case 16: + { + rowCount_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroRows_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroRows_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.AvroRows.class, + com.google.cloud.bigquery.storage.v1.AvroRows.Builder.class); + } + + public static final int SERIALIZED_BINARY_ROWS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString serializedBinaryRows_; + /** + * + * + *
+   * Binary serialized rows in a block.
+   * 
+ * + * bytes serialized_binary_rows = 1; + * + * @return The serializedBinaryRows. + */ + public com.google.protobuf.ByteString getSerializedBinaryRows() { + return serializedBinaryRows_; + } + + public static final int ROW_COUNT_FIELD_NUMBER = 2; + private long rowCount_; + /** + * + * + *
+   * The count of rows in the returning block.
+   * 
+ * + * int64 row_count = 2; + * + * @return The rowCount. + */ + public long getRowCount() { + return rowCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!serializedBinaryRows_.isEmpty()) { + output.writeBytes(1, serializedBinaryRows_); + } + if (rowCount_ != 0L) { + output.writeInt64(2, rowCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!serializedBinaryRows_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, serializedBinaryRows_); + } + if (rowCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, rowCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.AvroRows)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.AvroRows other = + (com.google.cloud.bigquery.storage.v1.AvroRows) obj; + + if (!getSerializedBinaryRows().equals(other.getSerializedBinaryRows())) return false; + if (getRowCount() != other.getRowCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERIALIZED_BINARY_ROWS_FIELD_NUMBER; + hash = (53 * hash) + getSerializedBinaryRows().hashCode(); + hash = (37 * hash) + ROW_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.AvroRows prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Avro rows.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.AvroRows} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.AvroRows) + com.google.cloud.bigquery.storage.v1.AvroRowsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroRows_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroRows_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.AvroRows.class, + com.google.cloud.bigquery.storage.v1.AvroRows.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.AvroRows.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + serializedBinaryRows_ = com.google.protobuf.ByteString.EMPTY; + + rowCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroRows_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroRows getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroRows build() { + com.google.cloud.bigquery.storage.v1.AvroRows result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroRows buildPartial() { + com.google.cloud.bigquery.storage.v1.AvroRows result = + new com.google.cloud.bigquery.storage.v1.AvroRows(this); + result.serializedBinaryRows_ = serializedBinaryRows_; + result.rowCount_ = rowCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.AvroRows) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.AvroRows) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.AvroRows other) { + if (other == com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance()) return this; + if (other.getSerializedBinaryRows() != com.google.protobuf.ByteString.EMPTY) { + setSerializedBinaryRows(other.getSerializedBinaryRows()); + } + if (other.getRowCount() != 0L) { + setRowCount(other.getRowCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.AvroRows parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.bigquery.storage.v1.AvroRows) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString serializedBinaryRows_ = + com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Binary serialized rows in a block.
+     * 
+ * + * bytes serialized_binary_rows = 1; + * + * @return The serializedBinaryRows. + */ + public com.google.protobuf.ByteString getSerializedBinaryRows() { + return serializedBinaryRows_; + } + /** + * + * + *
+     * Binary serialized rows in a block.
+     * 
+ * + * bytes serialized_binary_rows = 1; + * + * @param value The serializedBinaryRows to set. + * @return This builder for chaining. + */ + public Builder setSerializedBinaryRows(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + serializedBinaryRows_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Binary serialized rows in a block.
+     * 
+ * + * bytes serialized_binary_rows = 1; + * + * @return This builder for chaining. + */ + public Builder clearSerializedBinaryRows() { + + serializedBinaryRows_ = getDefaultInstance().getSerializedBinaryRows(); + onChanged(); + return this; + } + + private long rowCount_; + /** + * + * + *
+     * The count of rows in the returning block.
+     * 
+ * + * int64 row_count = 2; + * + * @return The rowCount. + */ + public long getRowCount() { + return rowCount_; + } + /** + * + * + *
+     * The count of rows in the returning block.
+     * 
+ * + * int64 row_count = 2; + * + * @param value The rowCount to set. + * @return This builder for chaining. + */ + public Builder setRowCount(long value) { + + rowCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The count of rows in the returning block.
+     * 
+ * + * int64 row_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearRowCount() { + + rowCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.AvroRows) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.AvroRows) + private static final com.google.cloud.bigquery.storage.v1.AvroRows DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.AvroRows(); + } + + public static com.google.cloud.bigquery.storage.v1.AvroRows getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AvroRows parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AvroRows(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroRows getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRowsOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRowsOrBuilder.java new file mode 100644 index 0000000000..27cd68e6fc --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroRowsOrBuilder.java @@ -0,0 +1,51 @@ +/* + * 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/avro.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface AvroRowsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.AvroRows) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Binary serialized rows in a block.
+   * 
+ * + * bytes serialized_binary_rows = 1; + * + * @return The serializedBinaryRows. + */ + com.google.protobuf.ByteString getSerializedBinaryRows(); + + /** + * + * + *
+   * The count of rows in the returning block.
+   * 
+ * + * int64 row_count = 2; + * + * @return The rowCount. + */ + long getRowCount(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchema.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchema.java new file mode 100644 index 0000000000..f6785523a5 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchema.java @@ -0,0 +1,640 @@ +/* + * 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/avro.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Avro schema.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.AvroSchema} + */ +public final class AvroSchema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.AvroSchema) + AvroSchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use AvroSchema.newBuilder() to construct. + private AvroSchema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AvroSchema() { + schema_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AvroSchema(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AvroSchema( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + schema_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.AvroSchema.class, + com.google.cloud.bigquery.storage.v1.AvroSchema.Builder.class); + } + + public static final int SCHEMA_FIELD_NUMBER = 1; + private volatile java.lang.Object schema_; + /** + * + * + *
+   * Json serialized schema, as described at
+   * https://avro.apache.org/docs/1.8.1/spec.html.
+   * 
+ * + * string schema = 1; + * + * @return The schema. + */ + public java.lang.String getSchema() { + java.lang.Object ref = schema_; + 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(); + schema_ = s; + return s; + } + } + /** + * + * + *
+   * Json serialized schema, as described at
+   * https://avro.apache.org/docs/1.8.1/spec.html.
+   * 
+ * + * string schema = 1; + * + * @return The bytes for schema. + */ + public com.google.protobuf.ByteString getSchemaBytes() { + java.lang.Object ref = schema_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getSchemaBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schema_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSchemaBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, schema_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.AvroSchema)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.AvroSchema other = + (com.google.cloud.bigquery.storage.v1.AvroSchema) obj; + + if (!getSchema().equals(other.getSchema())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.AvroSchema prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Avro schema.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.AvroSchema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.AvroSchema) + com.google.cloud.bigquery.storage.v1.AvroSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.AvroSchema.class, + com.google.cloud.bigquery.storage.v1.AvroSchema.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.AvroSchema.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + schema_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.AvroProto + .internal_static_google_cloud_bigquery_storage_v1_AvroSchema_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroSchema getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroSchema build() { + com.google.cloud.bigquery.storage.v1.AvroSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroSchema buildPartial() { + com.google.cloud.bigquery.storage.v1.AvroSchema result = + new com.google.cloud.bigquery.storage.v1.AvroSchema(this); + result.schema_ = schema_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.AvroSchema) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.AvroSchema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.AvroSchema other) { + if (other == com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance()) + return this; + if (!other.getSchema().isEmpty()) { + schema_ = other.schema_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.AvroSchema parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.bigquery.storage.v1.AvroSchema) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object schema_ = ""; + /** + * + * + *
+     * Json serialized schema, as described at
+     * https://avro.apache.org/docs/1.8.1/spec.html.
+     * 
+ * + * string schema = 1; + * + * @return The schema. + */ + public java.lang.String getSchema() { + java.lang.Object ref = schema_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schema_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Json serialized schema, as described at
+     * https://avro.apache.org/docs/1.8.1/spec.html.
+     * 
+ * + * string schema = 1; + * + * @return The bytes for schema. + */ + public com.google.protobuf.ByteString getSchemaBytes() { + java.lang.Object ref = schema_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Json serialized schema, as described at
+     * https://avro.apache.org/docs/1.8.1/spec.html.
+     * 
+ * + * string schema = 1; + * + * @param value The schema to set. + * @return This builder for chaining. + */ + public Builder setSchema(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + schema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Json serialized schema, as described at
+     * https://avro.apache.org/docs/1.8.1/spec.html.
+     * 
+ * + * string schema = 1; + * + * @return This builder for chaining. + */ + public Builder clearSchema() { + + schema_ = getDefaultInstance().getSchema(); + onChanged(); + return this; + } + /** + * + * + *
+     * Json serialized schema, as described at
+     * https://avro.apache.org/docs/1.8.1/spec.html.
+     * 
+ * + * string schema = 1; + * + * @param value The bytes for schema to set. + * @return This builder for chaining. + */ + public Builder setSchemaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + schema_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.AvroSchema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.AvroSchema) + private static final com.google.cloud.bigquery.storage.v1.AvroSchema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.AvroSchema(); + } + + public static com.google.cloud.bigquery.storage.v1.AvroSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AvroSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AvroSchema(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AvroSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchemaOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchemaOrBuilder.java new file mode 100644 index 0000000000..2612720e29 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AvroSchemaOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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/avro.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface AvroSchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.AvroSchema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Json serialized schema, as described at
+   * https://avro.apache.org/docs/1.8.1/spec.html.
+   * 
+ * + * string schema = 1; + * + * @return The schema. + */ + java.lang.String getSchema(); + /** + * + * + *
+   * Json serialized schema, as described at
+   * https://avro.apache.org/docs/1.8.1/spec.html.
+   * 
+ * + * string schema = 1; + * + * @return The bytes for schema. + */ + com.google.protobuf.ByteString getSchemaBytes(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequest.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequest.java new file mode 100644 index 0000000000..4436a0e9c4 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequest.java @@ -0,0 +1,1071 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Request message for `CreateReadSession`.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.CreateReadSessionRequest} + */ +public final class CreateReadSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.CreateReadSessionRequest) + CreateReadSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateReadSessionRequest.newBuilder() to construct. + private CreateReadSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateReadSessionRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateReadSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateReadSessionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.bigquery.storage.v1.ReadSession.Builder subBuilder = null; + if (readSession_ != null) { + subBuilder = readSession_.toBuilder(); + } + readSession_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ReadSession.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readSession_); + readSession_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + maxStreamCount_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.class, + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The request project that owns the session, in the form of
+   * `projects/{project_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The request project that owns the session, in the form of
+   * `projects/{project_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_SESSION_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.storage.v1.ReadSession readSession_; + /** + * + * + *
+   * Required. Session to be created.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the readSession field is set. + */ + public boolean hasReadSession() { + return readSession_ != null; + } + /** + * + * + *
+   * Required. Session to be created.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The readSession. + */ + public com.google.cloud.bigquery.storage.v1.ReadSession getReadSession() { + return readSession_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.getDefaultInstance() + : readSession_; + } + /** + * + * + *
+   * Required. Session to be created.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSessionOrBuilder getReadSessionOrBuilder() { + return getReadSession(); + } + + public static final int MAX_STREAM_COUNT_FIELD_NUMBER = 3; + private int maxStreamCount_; + /** + * + * + *
+   * Max initial number of streams. If unset or zero, the server will
+   * provide a value of streams so as to produce reasonable throughput. Must be
+   * non-negative. The number of streams may be lower than the requested number,
+   * depending on the amount parallelism that is reasonable for the table. Error
+   * will be returned if the max count is greater than the current system
+   * max limit of 1,000.
+   * Streams must be read starting from offset 0.
+   * 
+ * + * int32 max_stream_count = 3; + * + * @return The maxStreamCount. + */ + public int getMaxStreamCount() { + return maxStreamCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (readSession_ != null) { + output.writeMessage(2, getReadSession()); + } + if (maxStreamCount_ != 0) { + output.writeInt32(3, maxStreamCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (readSession_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadSession()); + } + if (maxStreamCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxStreamCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest other = + (com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasReadSession() != other.hasReadSession()) return false; + if (hasReadSession()) { + if (!getReadSession().equals(other.getReadSession())) return false; + } + if (getMaxStreamCount() != other.getMaxStreamCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasReadSession()) { + hash = (37 * hash) + READ_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getReadSession().hashCode(); + } + hash = (37 * hash) + MAX_STREAM_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxStreamCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `CreateReadSession`.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.CreateReadSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.CreateReadSessionRequest) + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.class, + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (readSessionBuilder_ == null) { + readSession_ = null; + } else { + readSession_ = null; + readSessionBuilder_ = null; + } + maxStreamCount_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest build() { + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest buildPartial() { + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest result = + new com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest(this); + result.parent_ = parent_; + if (readSessionBuilder_ == null) { + result.readSession_ = readSession_; + } else { + result.readSession_ = readSessionBuilder_.build(); + } + result.maxStreamCount_ = maxStreamCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest other) { + if (other + == com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasReadSession()) { + mergeReadSession(other.getReadSession()); + } + if (other.getMaxStreamCount() != 0) { + setMaxStreamCount(other.getMaxStreamCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The request project that owns the session, in the form of
+     * `projects/{project_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The request project that owns the session, in the form of
+     * `projects/{project_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The request project that owns the session, in the form of
+     * `projects/{project_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The request project that owns the session, in the form of
+     * `projects/{project_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The request project that owns the session, in the form of
+     * `projects/{project_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.storage.v1.ReadSession readSession_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession, + com.google.cloud.bigquery.storage.v1.ReadSession.Builder, + com.google.cloud.bigquery.storage.v1.ReadSessionOrBuilder> + readSessionBuilder_; + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the readSession field is set. + */ + public boolean hasReadSession() { + return readSessionBuilder_ != null || readSession_ != null; + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The readSession. + */ + public com.google.cloud.bigquery.storage.v1.ReadSession getReadSession() { + if (readSessionBuilder_ == null) { + return readSession_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.getDefaultInstance() + : readSession_; + } else { + return readSessionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReadSession(com.google.cloud.bigquery.storage.v1.ReadSession value) { + if (readSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readSession_ = value; + onChanged(); + } else { + readSessionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReadSession( + com.google.cloud.bigquery.storage.v1.ReadSession.Builder builderForValue) { + if (readSessionBuilder_ == null) { + readSession_ = builderForValue.build(); + onChanged(); + } else { + readSessionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeReadSession(com.google.cloud.bigquery.storage.v1.ReadSession value) { + if (readSessionBuilder_ == null) { + if (readSession_ != null) { + readSession_ = + com.google.cloud.bigquery.storage.v1.ReadSession.newBuilder(readSession_) + .mergeFrom(value) + .buildPartial(); + } else { + readSession_ = value; + } + onChanged(); + } else { + readSessionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearReadSession() { + if (readSessionBuilder_ == null) { + readSession_ = null; + onChanged(); + } else { + readSession_ = null; + readSessionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.Builder getReadSessionBuilder() { + + onChanged(); + return getReadSessionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSessionOrBuilder getReadSessionOrBuilder() { + if (readSessionBuilder_ != null) { + return readSessionBuilder_.getMessageOrBuilder(); + } else { + return readSession_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.getDefaultInstance() + : readSession_; + } + } + /** + * + * + *
+     * Required. Session to be created.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession, + com.google.cloud.bigquery.storage.v1.ReadSession.Builder, + com.google.cloud.bigquery.storage.v1.ReadSessionOrBuilder> + getReadSessionFieldBuilder() { + if (readSessionBuilder_ == null) { + readSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession, + com.google.cloud.bigquery.storage.v1.ReadSession.Builder, + com.google.cloud.bigquery.storage.v1.ReadSessionOrBuilder>( + getReadSession(), getParentForChildren(), isClean()); + readSession_ = null; + } + return readSessionBuilder_; + } + + private int maxStreamCount_; + /** + * + * + *
+     * Max initial number of streams. If unset or zero, the server will
+     * provide a value of streams so as to produce reasonable throughput. Must be
+     * non-negative. The number of streams may be lower than the requested number,
+     * depending on the amount parallelism that is reasonable for the table. Error
+     * will be returned if the max count is greater than the current system
+     * max limit of 1,000.
+     * Streams must be read starting from offset 0.
+     * 
+ * + * int32 max_stream_count = 3; + * + * @return The maxStreamCount. + */ + public int getMaxStreamCount() { + return maxStreamCount_; + } + /** + * + * + *
+     * Max initial number of streams. If unset or zero, the server will
+     * provide a value of streams so as to produce reasonable throughput. Must be
+     * non-negative. The number of streams may be lower than the requested number,
+     * depending on the amount parallelism that is reasonable for the table. Error
+     * will be returned if the max count is greater than the current system
+     * max limit of 1,000.
+     * Streams must be read starting from offset 0.
+     * 
+ * + * int32 max_stream_count = 3; + * + * @param value The maxStreamCount to set. + * @return This builder for chaining. + */ + public Builder setMaxStreamCount(int value) { + + maxStreamCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Max initial number of streams. If unset or zero, the server will
+     * provide a value of streams so as to produce reasonable throughput. Must be
+     * non-negative. The number of streams may be lower than the requested number,
+     * depending on the amount parallelism that is reasonable for the table. Error
+     * will be returned if the max count is greater than the current system
+     * max limit of 1,000.
+     * Streams must be read starting from offset 0.
+     * 
+ * + * int32 max_stream_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxStreamCount() { + + maxStreamCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.CreateReadSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.CreateReadSessionRequest) + private static final com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest(); + } + + public static com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateReadSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateReadSessionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequestOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequestOrBuilder.java new file mode 100644 index 0000000000..d522222bc1 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/CreateReadSessionRequestOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface CreateReadSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.CreateReadSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The request project that owns the session, in the form of
+   * `projects/{project_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The request project that owns the session, in the form of
+   * `projects/{project_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Session to be created.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the readSession field is set. + */ + boolean hasReadSession(); + /** + * + * + *
+   * Required. Session to be created.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The readSession. + */ + com.google.cloud.bigquery.storage.v1.ReadSession getReadSession(); + /** + * + * + *
+   * Required. Session to be created.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.storage.v1.ReadSessionOrBuilder getReadSessionOrBuilder(); + + /** + * + * + *
+   * Max initial number of streams. If unset or zero, the server will
+   * provide a value of streams so as to produce reasonable throughput. Must be
+   * non-negative. The number of streams may be lower than the requested number,
+   * depending on the amount parallelism that is reasonable for the table. Error
+   * will be returned if the max count is greater than the current system
+   * max limit of 1,000.
+   * Streams must be read starting from offset 0.
+   * 
+ * + * int32 max_stream_count = 3; + * + * @return The maxStreamCount. + */ + int getMaxStreamCount(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/DataFormat.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/DataFormat.java new file mode 100644 index 0000000000..ce53fa9157 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/DataFormat.java @@ -0,0 +1,160 @@ +/* + * 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; + +/** + * + * + *
+ * Data format for input or output data.
+ * 
+ * + * Protobuf enum {@code google.cloud.bigquery.storage.v1.DataFormat} + */ +public enum DataFormat implements com.google.protobuf.ProtocolMessageEnum { + /** DATA_FORMAT_UNSPECIFIED = 0; */ + DATA_FORMAT_UNSPECIFIED(0), + /** + * + * + *
+   * Avro is a standard open source row based file format.
+   * See https://avro.apache.org/ for more details.
+   * 
+ * + * AVRO = 1; + */ + AVRO(1), + /** + * + * + *
+   * Arrow is a standard open source column-based message format.
+   * See https://arrow.apache.org/ for more details.
+   * 
+ * + * ARROW = 2; + */ + ARROW(2), + UNRECOGNIZED(-1), + ; + + /** DATA_FORMAT_UNSPECIFIED = 0; */ + public static final int DATA_FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Avro is a standard open source row based file format.
+   * See https://avro.apache.org/ for more details.
+   * 
+ * + * AVRO = 1; + */ + public static final int AVRO_VALUE = 1; + /** + * + * + *
+   * Arrow is a standard open source column-based message format.
+   * See https://arrow.apache.org/ for more details.
+   * 
+ * + * ARROW = 2; + */ + public static final int ARROW_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 DataFormat 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 DataFormat forNumber(int value) { + switch (value) { + case 0: + return DATA_FORMAT_UNSPECIFIED; + case 1: + return AVRO; + case 2: + return ARROW; + 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 DataFormat findValueByNumber(int number) { + return DataFormat.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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(0); + } + + private static final DataFormat[] VALUES = values(); + + public static DataFormat 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 DataFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.storage.v1.DataFormat) +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequest.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequest.java new file mode 100644 index 0000000000..dfe113ec13 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequest.java @@ -0,0 +1,744 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Request message for `ReadRows`.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadRowsRequest} + */ +public final class ReadRowsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ReadRowsRequest) + ReadRowsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadRowsRequest.newBuilder() to construct. + private ReadRowsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadRowsRequest() { + readStream_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadRowsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadRowsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + readStream_ = s; + break; + } + case 16: + { + offset_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadRowsRequest.class, + com.google.cloud.bigquery.storage.v1.ReadRowsRequest.Builder.class); + } + + public static final int READ_STREAM_FIELD_NUMBER = 1; + private volatile java.lang.Object readStream_; + /** + * + * + *
+   * Required. Stream to read rows from.
+   * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The readStream. + */ + public java.lang.String getReadStream() { + java.lang.Object ref = readStream_; + 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(); + readStream_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Stream to read rows from.
+   * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for readStream. + */ + public com.google.protobuf.ByteString getReadStreamBytes() { + java.lang.Object ref = readStream_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + readStream_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OFFSET_FIELD_NUMBER = 2; + private long offset_; + /** + * + * + *
+   * The offset requested must be less than the last row read from Read.
+   * Requesting a larger offset is undefined. If not specified, start reading
+   * from offset zero.
+   * 
+ * + * int64 offset = 2; + * + * @return The offset. + */ + public long getOffset() { + return offset_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getReadStreamBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, readStream_); + } + if (offset_ != 0L) { + output.writeInt64(2, offset_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getReadStreamBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, readStream_); + } + if (offset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, offset_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ReadRowsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ReadRowsRequest other = + (com.google.cloud.bigquery.storage.v1.ReadRowsRequest) obj; + + if (!getReadStream().equals(other.getReadStream())) return false; + if (getOffset() != other.getOffset()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + READ_STREAM_FIELD_NUMBER; + hash = (53 * hash) + getReadStream().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffset()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.ReadRowsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `ReadRows`.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadRowsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ReadRowsRequest) + com.google.cloud.bigquery.storage.v1.ReadRowsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadRowsRequest.class, + com.google.cloud.bigquery.storage.v1.ReadRowsRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.ReadRowsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + readStream_ = ""; + + offset_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsRequest getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ReadRowsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsRequest build() { + com.google.cloud.bigquery.storage.v1.ReadRowsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsRequest buildPartial() { + com.google.cloud.bigquery.storage.v1.ReadRowsRequest result = + new com.google.cloud.bigquery.storage.v1.ReadRowsRequest(this); + result.readStream_ = readStream_; + result.offset_ = offset_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ReadRowsRequest) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ReadRowsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ReadRowsRequest other) { + if (other == com.google.cloud.bigquery.storage.v1.ReadRowsRequest.getDefaultInstance()) + return this; + if (!other.getReadStream().isEmpty()) { + readStream_ = other.readStream_; + onChanged(); + } + if (other.getOffset() != 0L) { + setOffset(other.getOffset()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ReadRowsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.ReadRowsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object readStream_ = ""; + /** + * + * + *
+     * Required. Stream to read rows from.
+     * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The readStream. + */ + public java.lang.String getReadStream() { + java.lang.Object ref = readStream_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + readStream_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Stream to read rows from.
+     * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for readStream. + */ + public com.google.protobuf.ByteString getReadStreamBytes() { + java.lang.Object ref = readStream_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + readStream_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Stream to read rows from.
+     * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The readStream to set. + * @return This builder for chaining. + */ + public Builder setReadStream(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + readStream_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Stream to read rows from.
+     * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearReadStream() { + + readStream_ = getDefaultInstance().getReadStream(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Stream to read rows from.
+     * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for readStream to set. + * @return This builder for chaining. + */ + public Builder setReadStreamBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + readStream_ = value; + onChanged(); + return this; + } + + private long offset_; + /** + * + * + *
+     * The offset requested must be less than the last row read from Read.
+     * Requesting a larger offset is undefined. If not specified, start reading
+     * from offset zero.
+     * 
+ * + * int64 offset = 2; + * + * @return The offset. + */ + public long getOffset() { + return offset_; + } + /** + * + * + *
+     * The offset requested must be less than the last row read from Read.
+     * Requesting a larger offset is undefined. If not specified, start reading
+     * from offset zero.
+     * 
+ * + * int64 offset = 2; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(long value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The offset requested must be less than the last row read from Read.
+     * Requesting a larger offset is undefined. If not specified, start reading
+     * from offset zero.
+     * 
+ * + * int64 offset = 2; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ReadRowsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ReadRowsRequest) + private static final com.google.cloud.bigquery.storage.v1.ReadRowsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ReadRowsRequest(); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadRowsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadRowsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequestOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequestOrBuilder.java new file mode 100644 index 0000000000..ae6058f280 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsRequestOrBuilder.java @@ -0,0 +1,69 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface ReadRowsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ReadRowsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Stream to read rows from.
+   * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The readStream. + */ + java.lang.String getReadStream(); + /** + * + * + *
+   * Required. Stream to read rows from.
+   * 
+ * + * + * string read_stream = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for readStream. + */ + com.google.protobuf.ByteString getReadStreamBytes(); + + /** + * + * + *
+   * The offset requested must be less than the last row read from Read.
+   * Requesting a larger offset is undefined. If not specified, start reading
+   * from offset zero.
+   * 
+ * + * int64 offset = 2; + * + * @return The offset. + */ + long getOffset(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponse.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponse.java new file mode 100644 index 0000000000..48b5347a06 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponse.java @@ -0,0 +1,1788 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Response from calling `ReadRows` may include row data, progress and
+ * throttling information.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadRowsResponse} + */ +public final class ReadRowsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ReadRowsResponse) + ReadRowsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadRowsResponse.newBuilder() to construct. + private ReadRowsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadRowsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadRowsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadRowsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + com.google.cloud.bigquery.storage.v1.StreamStats.Builder subBuilder = null; + if (stats_ != null) { + subBuilder = stats_.toBuilder(); + } + stats_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.StreamStats.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(stats_); + stats_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.bigquery.storage.v1.AvroRows.Builder subBuilder = null; + if (rowsCase_ == 3) { + subBuilder = ((com.google.cloud.bigquery.storage.v1.AvroRows) rows_).toBuilder(); + } + rows_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.AvroRows.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.bigquery.storage.v1.AvroRows) rows_); + rows_ = subBuilder.buildPartial(); + } + rowsCase_ = 3; + break; + } + case 34: + { + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder subBuilder = null; + if (rowsCase_ == 4) { + subBuilder = + ((com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_).toBuilder(); + } + rows_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_); + rows_ = subBuilder.buildPartial(); + } + rowsCase_ = 4; + break; + } + case 42: + { + com.google.cloud.bigquery.storage.v1.ThrottleState.Builder subBuilder = null; + if (throttleState_ != null) { + subBuilder = throttleState_.toBuilder(); + } + throttleState_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ThrottleState.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(throttleState_); + throttleState_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + rowCount_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadRowsResponse.class, + com.google.cloud.bigquery.storage.v1.ReadRowsResponse.Builder.class); + } + + private int rowsCase_ = 0; + private java.lang.Object rows_; + + public enum RowsCase implements com.google.protobuf.Internal.EnumLite { + AVRO_ROWS(3), + ARROW_RECORD_BATCH(4), + ROWS_NOT_SET(0); + private final int value; + + private RowsCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RowsCase valueOf(int value) { + return forNumber(value); + } + + public static RowsCase forNumber(int value) { + switch (value) { + case 3: + return AVRO_ROWS; + case 4: + return ARROW_RECORD_BATCH; + case 0: + return ROWS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RowsCase getRowsCase() { + return RowsCase.forNumber(rowsCase_); + } + + public static final int AVRO_ROWS_FIELD_NUMBER = 3; + /** + * + * + *
+   * Serialized row data in AVRO format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * + * @return Whether the avroRows field is set. + */ + public boolean hasAvroRows() { + return rowsCase_ == 3; + } + /** + * + * + *
+   * Serialized row data in AVRO format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * + * @return The avroRows. + */ + public com.google.cloud.bigquery.storage.v1.AvroRows getAvroRows() { + if (rowsCase_ == 3) { + return (com.google.cloud.bigquery.storage.v1.AvroRows) rows_; + } + return com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance(); + } + /** + * + * + *
+   * Serialized row data in AVRO format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + public com.google.cloud.bigquery.storage.v1.AvroRowsOrBuilder getAvroRowsOrBuilder() { + if (rowsCase_ == 3) { + return (com.google.cloud.bigquery.storage.v1.AvroRows) rows_; + } + return com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance(); + } + + public static final int ARROW_RECORD_BATCH_FIELD_NUMBER = 4; + /** + * + * + *
+   * Serialized row data in Arrow RecordBatch format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * + * @return Whether the arrowRecordBatch field is set. + */ + public boolean hasArrowRecordBatch() { + return rowsCase_ == 4; + } + /** + * + * + *
+   * Serialized row data in Arrow RecordBatch format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * + * @return The arrowRecordBatch. + */ + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatch getArrowRecordBatch() { + if (rowsCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_; + } + return com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance(); + } + /** + * + * + *
+   * Serialized row data in Arrow RecordBatch format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatchOrBuilder + getArrowRecordBatchOrBuilder() { + if (rowsCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_; + } + return com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance(); + } + + public static final int ROW_COUNT_FIELD_NUMBER = 6; + private long rowCount_; + /** + * + * + *
+   * Number of serialized rows in the rows block.
+   * 
+ * + * int64 row_count = 6; + * + * @return The rowCount. + */ + public long getRowCount() { + return rowCount_; + } + + public static final int STATS_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.storage.v1.StreamStats stats_; + /** + * + * + *
+   * Statistics for the stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return stats_ != null; + } + /** + * + * + *
+   * Statistics for the stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * + * @return The stats. + */ + public com.google.cloud.bigquery.storage.v1.StreamStats getStats() { + return stats_ == null + ? com.google.cloud.bigquery.storage.v1.StreamStats.getDefaultInstance() + : stats_; + } + /** + * + * + *
+   * Statistics for the stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + public com.google.cloud.bigquery.storage.v1.StreamStatsOrBuilder getStatsOrBuilder() { + return getStats(); + } + + public static final int THROTTLE_STATE_FIELD_NUMBER = 5; + private com.google.cloud.bigquery.storage.v1.ThrottleState throttleState_; + /** + * + * + *
+   * Throttling state. If unset, the latest response still describes
+   * the current throttling status.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * + * @return Whether the throttleState field is set. + */ + public boolean hasThrottleState() { + return throttleState_ != null; + } + /** + * + * + *
+   * Throttling state. If unset, the latest response still describes
+   * the current throttling status.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * + * @return The throttleState. + */ + public com.google.cloud.bigquery.storage.v1.ThrottleState getThrottleState() { + return throttleState_ == null + ? com.google.cloud.bigquery.storage.v1.ThrottleState.getDefaultInstance() + : throttleState_; + } + /** + * + * + *
+   * Throttling state. If unset, the latest response still describes
+   * the current throttling status.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + public com.google.cloud.bigquery.storage.v1.ThrottleStateOrBuilder getThrottleStateOrBuilder() { + return getThrottleState(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (stats_ != null) { + output.writeMessage(2, getStats()); + } + if (rowsCase_ == 3) { + output.writeMessage(3, (com.google.cloud.bigquery.storage.v1.AvroRows) rows_); + } + if (rowsCase_ == 4) { + output.writeMessage(4, (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_); + } + if (throttleState_ != null) { + output.writeMessage(5, getThrottleState()); + } + if (rowCount_ != 0L) { + output.writeInt64(6, rowCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stats_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStats()); + } + if (rowsCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.bigquery.storage.v1.AvroRows) rows_); + } + if (rowsCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_); + } + if (throttleState_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getThrottleState()); + } + if (rowCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, rowCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ReadRowsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ReadRowsResponse other = + (com.google.cloud.bigquery.storage.v1.ReadRowsResponse) obj; + + if (getRowCount() != other.getRowCount()) return false; + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } + if (hasThrottleState() != other.hasThrottleState()) return false; + if (hasThrottleState()) { + if (!getThrottleState().equals(other.getThrottleState())) return false; + } + if (!getRowsCase().equals(other.getRowsCase())) return false; + switch (rowsCase_) { + case 3: + if (!getAvroRows().equals(other.getAvroRows())) return false; + break; + case 4: + if (!getArrowRecordBatch().equals(other.getArrowRecordBatch())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ROW_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowCount()); + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + if (hasThrottleState()) { + hash = (37 * hash) + THROTTLE_STATE_FIELD_NUMBER; + hash = (53 * hash) + getThrottleState().hashCode(); + } + switch (rowsCase_) { + case 3: + hash = (37 * hash) + AVRO_ROWS_FIELD_NUMBER; + hash = (53 * hash) + getAvroRows().hashCode(); + break; + case 4: + hash = (37 * hash) + ARROW_RECORD_BATCH_FIELD_NUMBER; + hash = (53 * hash) + getArrowRecordBatch().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.ReadRowsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response from calling `ReadRows` may include row data, progress and
+   * throttling information.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadRowsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ReadRowsResponse) + com.google.cloud.bigquery.storage.v1.ReadRowsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadRowsResponse.class, + com.google.cloud.bigquery.storage.v1.ReadRowsResponse.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.ReadRowsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + rowCount_ = 0L; + + if (statsBuilder_ == null) { + stats_ = null; + } else { + stats_ = null; + statsBuilder_ = null; + } + if (throttleStateBuilder_ == null) { + throttleState_ = null; + } else { + throttleState_ = null; + throttleStateBuilder_ = null; + } + rowsCase_ = 0; + rows_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsResponse getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ReadRowsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsResponse build() { + com.google.cloud.bigquery.storage.v1.ReadRowsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsResponse buildPartial() { + com.google.cloud.bigquery.storage.v1.ReadRowsResponse result = + new com.google.cloud.bigquery.storage.v1.ReadRowsResponse(this); + if (rowsCase_ == 3) { + if (avroRowsBuilder_ == null) { + result.rows_ = rows_; + } else { + result.rows_ = avroRowsBuilder_.build(); + } + } + if (rowsCase_ == 4) { + if (arrowRecordBatchBuilder_ == null) { + result.rows_ = rows_; + } else { + result.rows_ = arrowRecordBatchBuilder_.build(); + } + } + result.rowCount_ = rowCount_; + if (statsBuilder_ == null) { + result.stats_ = stats_; + } else { + result.stats_ = statsBuilder_.build(); + } + if (throttleStateBuilder_ == null) { + result.throttleState_ = throttleState_; + } else { + result.throttleState_ = throttleStateBuilder_.build(); + } + result.rowsCase_ = rowsCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ReadRowsResponse) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ReadRowsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ReadRowsResponse other) { + if (other == com.google.cloud.bigquery.storage.v1.ReadRowsResponse.getDefaultInstance()) + return this; + if (other.getRowCount() != 0L) { + setRowCount(other.getRowCount()); + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + if (other.hasThrottleState()) { + mergeThrottleState(other.getThrottleState()); + } + switch (other.getRowsCase()) { + case AVRO_ROWS: + { + mergeAvroRows(other.getAvroRows()); + break; + } + case ARROW_RECORD_BATCH: + { + mergeArrowRecordBatch(other.getArrowRecordBatch()); + break; + } + case ROWS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ReadRowsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.ReadRowsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int rowsCase_ = 0; + private java.lang.Object rows_; + + public RowsCase getRowsCase() { + return RowsCase.forNumber(rowsCase_); + } + + public Builder clearRows() { + rowsCase_ = 0; + rows_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.AvroRows, + com.google.cloud.bigquery.storage.v1.AvroRows.Builder, + com.google.cloud.bigquery.storage.v1.AvroRowsOrBuilder> + avroRowsBuilder_; + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * + * @return Whether the avroRows field is set. + */ + public boolean hasAvroRows() { + return rowsCase_ == 3; + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * + * @return The avroRows. + */ + public com.google.cloud.bigquery.storage.v1.AvroRows getAvroRows() { + if (avroRowsBuilder_ == null) { + if (rowsCase_ == 3) { + return (com.google.cloud.bigquery.storage.v1.AvroRows) rows_; + } + return com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance(); + } else { + if (rowsCase_ == 3) { + return avroRowsBuilder_.getMessage(); + } + return com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance(); + } + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + public Builder setAvroRows(com.google.cloud.bigquery.storage.v1.AvroRows value) { + if (avroRowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rows_ = value; + onChanged(); + } else { + avroRowsBuilder_.setMessage(value); + } + rowsCase_ = 3; + return this; + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + public Builder setAvroRows( + com.google.cloud.bigquery.storage.v1.AvroRows.Builder builderForValue) { + if (avroRowsBuilder_ == null) { + rows_ = builderForValue.build(); + onChanged(); + } else { + avroRowsBuilder_.setMessage(builderForValue.build()); + } + rowsCase_ = 3; + return this; + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + public Builder mergeAvroRows(com.google.cloud.bigquery.storage.v1.AvroRows value) { + if (avroRowsBuilder_ == null) { + if (rowsCase_ == 3 + && rows_ != com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance()) { + rows_ = + com.google.cloud.bigquery.storage.v1.AvroRows.newBuilder( + (com.google.cloud.bigquery.storage.v1.AvroRows) rows_) + .mergeFrom(value) + .buildPartial(); + } else { + rows_ = value; + } + onChanged(); + } else { + if (rowsCase_ == 3) { + avroRowsBuilder_.mergeFrom(value); + } + avroRowsBuilder_.setMessage(value); + } + rowsCase_ = 3; + return this; + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + public Builder clearAvroRows() { + if (avroRowsBuilder_ == null) { + if (rowsCase_ == 3) { + rowsCase_ = 0; + rows_ = null; + onChanged(); + } + } else { + if (rowsCase_ == 3) { + rowsCase_ = 0; + rows_ = null; + } + avroRowsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + public com.google.cloud.bigquery.storage.v1.AvroRows.Builder getAvroRowsBuilder() { + return getAvroRowsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + public com.google.cloud.bigquery.storage.v1.AvroRowsOrBuilder getAvroRowsOrBuilder() { + if ((rowsCase_ == 3) && (avroRowsBuilder_ != null)) { + return avroRowsBuilder_.getMessageOrBuilder(); + } else { + if (rowsCase_ == 3) { + return (com.google.cloud.bigquery.storage.v1.AvroRows) rows_; + } + return com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance(); + } + } + /** + * + * + *
+     * Serialized row data in AVRO format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.AvroRows, + com.google.cloud.bigquery.storage.v1.AvroRows.Builder, + com.google.cloud.bigquery.storage.v1.AvroRowsOrBuilder> + getAvroRowsFieldBuilder() { + if (avroRowsBuilder_ == null) { + if (!(rowsCase_ == 3)) { + rows_ = com.google.cloud.bigquery.storage.v1.AvroRows.getDefaultInstance(); + } + avroRowsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.AvroRows, + com.google.cloud.bigquery.storage.v1.AvroRows.Builder, + com.google.cloud.bigquery.storage.v1.AvroRowsOrBuilder>( + (com.google.cloud.bigquery.storage.v1.AvroRows) rows_, + getParentForChildren(), + isClean()); + rows_ = null; + } + rowsCase_ = 3; + onChanged(); + ; + return avroRowsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatchOrBuilder> + arrowRecordBatchBuilder_; + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * + * @return Whether the arrowRecordBatch field is set. + */ + public boolean hasArrowRecordBatch() { + return rowsCase_ == 4; + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * + * @return The arrowRecordBatch. + */ + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatch getArrowRecordBatch() { + if (arrowRecordBatchBuilder_ == null) { + if (rowsCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_; + } + return com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance(); + } else { + if (rowsCase_ == 4) { + return arrowRecordBatchBuilder_.getMessage(); + } + return com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance(); + } + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + public Builder setArrowRecordBatch( + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch value) { + if (arrowRecordBatchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rows_ = value; + onChanged(); + } else { + arrowRecordBatchBuilder_.setMessage(value); + } + rowsCase_ = 4; + return this; + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + public Builder setArrowRecordBatch( + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder builderForValue) { + if (arrowRecordBatchBuilder_ == null) { + rows_ = builderForValue.build(); + onChanged(); + } else { + arrowRecordBatchBuilder_.setMessage(builderForValue.build()); + } + rowsCase_ = 4; + return this; + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + public Builder mergeArrowRecordBatch( + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch value) { + if (arrowRecordBatchBuilder_ == null) { + if (rowsCase_ == 4 + && rows_ + != com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance()) { + rows_ = + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.newBuilder( + (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_) + .mergeFrom(value) + .buildPartial(); + } else { + rows_ = value; + } + onChanged(); + } else { + if (rowsCase_ == 4) { + arrowRecordBatchBuilder_.mergeFrom(value); + } + arrowRecordBatchBuilder_.setMessage(value); + } + rowsCase_ = 4; + return this; + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + public Builder clearArrowRecordBatch() { + if (arrowRecordBatchBuilder_ == null) { + if (rowsCase_ == 4) { + rowsCase_ = 0; + rows_ = null; + onChanged(); + } + } else { + if (rowsCase_ == 4) { + rowsCase_ = 0; + rows_ = null; + } + arrowRecordBatchBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder + getArrowRecordBatchBuilder() { + return getArrowRecordBatchFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + public com.google.cloud.bigquery.storage.v1.ArrowRecordBatchOrBuilder + getArrowRecordBatchOrBuilder() { + if ((rowsCase_ == 4) && (arrowRecordBatchBuilder_ != null)) { + return arrowRecordBatchBuilder_.getMessageOrBuilder(); + } else { + if (rowsCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_; + } + return com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance(); + } + } + /** + * + * + *
+     * Serialized row data in Arrow RecordBatch format.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatchOrBuilder> + getArrowRecordBatchFieldBuilder() { + if (arrowRecordBatchBuilder_ == null) { + if (!(rowsCase_ == 4)) { + rows_ = com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.getDefaultInstance(); + } + arrowRecordBatchBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch.Builder, + com.google.cloud.bigquery.storage.v1.ArrowRecordBatchOrBuilder>( + (com.google.cloud.bigquery.storage.v1.ArrowRecordBatch) rows_, + getParentForChildren(), + isClean()); + rows_ = null; + } + rowsCase_ = 4; + onChanged(); + ; + return arrowRecordBatchBuilder_; + } + + private long rowCount_; + /** + * + * + *
+     * Number of serialized rows in the rows block.
+     * 
+ * + * int64 row_count = 6; + * + * @return The rowCount. + */ + public long getRowCount() { + return rowCount_; + } + /** + * + * + *
+     * Number of serialized rows in the rows block.
+     * 
+ * + * int64 row_count = 6; + * + * @param value The rowCount to set. + * @return This builder for chaining. + */ + public Builder setRowCount(long value) { + + rowCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of serialized rows in the rows block.
+     * 
+ * + * int64 row_count = 6; + * + * @return This builder for chaining. + */ + public Builder clearRowCount() { + + rowCount_ = 0L; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.storage.v1.StreamStats stats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.StreamStats, + com.google.cloud.bigquery.storage.v1.StreamStats.Builder, + com.google.cloud.bigquery.storage.v1.StreamStatsOrBuilder> + statsBuilder_; + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return statsBuilder_ != null || stats_ != null; + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * + * @return The stats. + */ + public com.google.cloud.bigquery.storage.v1.StreamStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.cloud.bigquery.storage.v1.StreamStats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + public Builder setStats(com.google.cloud.bigquery.storage.v1.StreamStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + onChanged(); + } else { + statsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + public Builder setStats( + com.google.cloud.bigquery.storage.v1.StreamStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + onChanged(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + public Builder mergeStats(com.google.cloud.bigquery.storage.v1.StreamStats value) { + if (statsBuilder_ == null) { + if (stats_ != null) { + stats_ = + com.google.cloud.bigquery.storage.v1.StreamStats.newBuilder(stats_) + .mergeFrom(value) + .buildPartial(); + } else { + stats_ = value; + } + onChanged(); + } else { + statsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + public Builder clearStats() { + if (statsBuilder_ == null) { + stats_ = null; + onChanged(); + } else { + stats_ = null; + statsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + public com.google.cloud.bigquery.storage.v1.StreamStats.Builder getStatsBuilder() { + + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + public com.google.cloud.bigquery.storage.v1.StreamStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.cloud.bigquery.storage.v1.StreamStats.getDefaultInstance() + : stats_; + } + } + /** + * + * + *
+     * Statistics for the stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.StreamStats, + com.google.cloud.bigquery.storage.v1.StreamStats.Builder, + com.google.cloud.bigquery.storage.v1.StreamStatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.StreamStats, + com.google.cloud.bigquery.storage.v1.StreamStats.Builder, + com.google.cloud.bigquery.storage.v1.StreamStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + + private com.google.cloud.bigquery.storage.v1.ThrottleState throttleState_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ThrottleState, + com.google.cloud.bigquery.storage.v1.ThrottleState.Builder, + com.google.cloud.bigquery.storage.v1.ThrottleStateOrBuilder> + throttleStateBuilder_; + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * + * @return Whether the throttleState field is set. + */ + public boolean hasThrottleState() { + return throttleStateBuilder_ != null || throttleState_ != null; + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * + * @return The throttleState. + */ + public com.google.cloud.bigquery.storage.v1.ThrottleState getThrottleState() { + if (throttleStateBuilder_ == null) { + return throttleState_ == null + ? com.google.cloud.bigquery.storage.v1.ThrottleState.getDefaultInstance() + : throttleState_; + } else { + return throttleStateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + public Builder setThrottleState(com.google.cloud.bigquery.storage.v1.ThrottleState value) { + if (throttleStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + throttleState_ = value; + onChanged(); + } else { + throttleStateBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + public Builder setThrottleState( + com.google.cloud.bigquery.storage.v1.ThrottleState.Builder builderForValue) { + if (throttleStateBuilder_ == null) { + throttleState_ = builderForValue.build(); + onChanged(); + } else { + throttleStateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + public Builder mergeThrottleState(com.google.cloud.bigquery.storage.v1.ThrottleState value) { + if (throttleStateBuilder_ == null) { + if (throttleState_ != null) { + throttleState_ = + com.google.cloud.bigquery.storage.v1.ThrottleState.newBuilder(throttleState_) + .mergeFrom(value) + .buildPartial(); + } else { + throttleState_ = value; + } + onChanged(); + } else { + throttleStateBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + public Builder clearThrottleState() { + if (throttleStateBuilder_ == null) { + throttleState_ = null; + onChanged(); + } else { + throttleState_ = null; + throttleStateBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + public com.google.cloud.bigquery.storage.v1.ThrottleState.Builder getThrottleStateBuilder() { + + onChanged(); + return getThrottleStateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + public com.google.cloud.bigquery.storage.v1.ThrottleStateOrBuilder getThrottleStateOrBuilder() { + if (throttleStateBuilder_ != null) { + return throttleStateBuilder_.getMessageOrBuilder(); + } else { + return throttleState_ == null + ? com.google.cloud.bigquery.storage.v1.ThrottleState.getDefaultInstance() + : throttleState_; + } + } + /** + * + * + *
+     * Throttling state. If unset, the latest response still describes
+     * the current throttling status.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ThrottleState, + com.google.cloud.bigquery.storage.v1.ThrottleState.Builder, + com.google.cloud.bigquery.storage.v1.ThrottleStateOrBuilder> + getThrottleStateFieldBuilder() { + if (throttleStateBuilder_ == null) { + throttleStateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ThrottleState, + com.google.cloud.bigquery.storage.v1.ThrottleState.Builder, + com.google.cloud.bigquery.storage.v1.ThrottleStateOrBuilder>( + getThrottleState(), getParentForChildren(), isClean()); + throttleState_ = null; + } + return throttleStateBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ReadRowsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ReadRowsResponse) + private static final com.google.cloud.bigquery.storage.v1.ReadRowsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ReadRowsResponse(); + } + + public static com.google.cloud.bigquery.storage.v1.ReadRowsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadRowsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadRowsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadRowsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponseOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponseOrBuilder.java new file mode 100644 index 0000000000..a2675b3a0d --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadRowsResponseOrBuilder.java @@ -0,0 +1,183 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface ReadRowsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ReadRowsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Serialized row data in AVRO format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * + * @return Whether the avroRows field is set. + */ + boolean hasAvroRows(); + /** + * + * + *
+   * Serialized row data in AVRO format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + * + * @return The avroRows. + */ + com.google.cloud.bigquery.storage.v1.AvroRows getAvroRows(); + /** + * + * + *
+   * Serialized row data in AVRO format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.AvroRows avro_rows = 3; + */ + com.google.cloud.bigquery.storage.v1.AvroRowsOrBuilder getAvroRowsOrBuilder(); + + /** + * + * + *
+   * Serialized row data in Arrow RecordBatch format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * + * @return Whether the arrowRecordBatch field is set. + */ + boolean hasArrowRecordBatch(); + /** + * + * + *
+   * Serialized row data in Arrow RecordBatch format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + * + * @return The arrowRecordBatch. + */ + com.google.cloud.bigquery.storage.v1.ArrowRecordBatch getArrowRecordBatch(); + /** + * + * + *
+   * Serialized row data in Arrow RecordBatch format.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ArrowRecordBatch arrow_record_batch = 4; + */ + com.google.cloud.bigquery.storage.v1.ArrowRecordBatchOrBuilder getArrowRecordBatchOrBuilder(); + + /** + * + * + *
+   * Number of serialized rows in the rows block.
+   * 
+ * + * int64 row_count = 6; + * + * @return The rowCount. + */ + long getRowCount(); + + /** + * + * + *
+   * Statistics for the stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * + * + *
+   * Statistics for the stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + * + * @return The stats. + */ + com.google.cloud.bigquery.storage.v1.StreamStats getStats(); + /** + * + * + *
+   * Statistics for the stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats stats = 2; + */ + com.google.cloud.bigquery.storage.v1.StreamStatsOrBuilder getStatsOrBuilder(); + + /** + * + * + *
+   * Throttling state. If unset, the latest response still describes
+   * the current throttling status.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * + * @return Whether the throttleState field is set. + */ + boolean hasThrottleState(); + /** + * + * + *
+   * Throttling state. If unset, the latest response still describes
+   * the current throttling status.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + * + * @return The throttleState. + */ + com.google.cloud.bigquery.storage.v1.ThrottleState getThrottleState(); + /** + * + * + *
+   * Throttling state. If unset, the latest response still describes
+   * the current throttling status.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ThrottleState throttle_state = 5; + */ + com.google.cloud.bigquery.storage.v1.ThrottleStateOrBuilder getThrottleStateOrBuilder(); + + public com.google.cloud.bigquery.storage.v1.ReadRowsResponse.RowsCase getRowsCase(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSession.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSession.java new file mode 100644 index 0000000000..2cacbb33c2 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSession.java @@ -0,0 +1,5146 @@ +/* + * 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; + +/** + * + * + *
+ * Information about the ReadSession.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadSession} + */ +public final class ReadSession extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ReadSession) + ReadSessionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadSession.newBuilder() to construct. + private ReadSession(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadSession() { + name_ = ""; + dataFormat_ = 0; + table_ = ""; + streams_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadSession(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadSession( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + int rawValue = input.readEnum(); + + dataFormat_ = rawValue; + break; + } + case 34: + { + com.google.cloud.bigquery.storage.v1.AvroSchema.Builder subBuilder = null; + if (schemaCase_ == 4) { + subBuilder = + ((com.google.cloud.bigquery.storage.v1.AvroSchema) schema_).toBuilder(); + } + schema_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.AvroSchema.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.bigquery.storage.v1.AvroSchema) schema_); + schema_ = subBuilder.buildPartial(); + } + schemaCase_ = 4; + break; + } + case 42: + { + com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder subBuilder = null; + if (schemaCase_ == 5) { + subBuilder = + ((com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_).toBuilder(); + } + schema_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ArrowSchema.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_); + schema_ = subBuilder.buildPartial(); + } + schemaCase_ = 5; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + table_ = s; + break; + } + case 58: + { + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder subBuilder = + null; + if (tableModifiers_ != null) { + subBuilder = tableModifiers_.toBuilder(); + } + tableModifiers_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tableModifiers_); + tableModifiers_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder subBuilder = + null; + if (readOptions_ != null) { + subBuilder = readOptions_.toBuilder(); + } + readOptions_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readOptions_); + readOptions_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + streams_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + streams_.add( + input.readMessage( + com.google.cloud.bigquery.storage.v1.ReadStream.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + streams_ = java.util.Collections.unmodifiableList(streams_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadSession.class, + com.google.cloud.bigquery.storage.v1.ReadSession.Builder.class); + } + + public interface TableModifiersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The snapshot time of the table. If not set, interpreted as now.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + * + * @return Whether the snapshotTime field is set. + */ + boolean hasSnapshotTime(); + /** + * + * + *
+     * The snapshot time of the table. If not set, interpreted as now.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + * + * @return The snapshotTime. + */ + com.google.protobuf.Timestamp getSnapshotTime(); + /** + * + * + *
+     * The snapshot time of the table. If not set, interpreted as now.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder(); + } + /** + * + * + *
+   * Additional attributes when reading a table.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} + */ + public static final class TableModifiers extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + TableModifiersOrBuilder { + private static final long serialVersionUID = 0L; + // Use TableModifiers.newBuilder() to construct. + private TableModifiers(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TableModifiers() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TableModifiers(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TableModifiers( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (snapshotTime_ != null) { + subBuilder = snapshotTime_.toBuilder(); + } + snapshotTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(snapshotTime_); + snapshotTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.class, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder.class); + } + + public static final int SNAPSHOT_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp snapshotTime_; + /** + * + * + *
+     * The snapshot time of the table. If not set, interpreted as now.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + * + * @return Whether the snapshotTime field is set. + */ + public boolean hasSnapshotTime() { + return snapshotTime_ != null; + } + /** + * + * + *
+     * The snapshot time of the table. If not set, interpreted as now.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + * + * @return The snapshotTime. + */ + public com.google.protobuf.Timestamp getSnapshotTime() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + /** + * + * + *
+     * The snapshot time of the table. If not set, interpreted as now.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + return getSnapshotTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (snapshotTime_ != null) { + output.writeMessage(1, getSnapshotTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (snapshotTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSnapshotTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers other = + (com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) obj; + + if (hasSnapshotTime() != other.hasSnapshotTime()) return false; + if (hasSnapshotTime()) { + if (!getSnapshotTime().equals(other.getSnapshotTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSnapshotTime()) { + hash = (37 * hash) + SNAPSHOT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Additional attributes when reading a table.
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.class, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = null; + } else { + snapshotTime_ = null; + snapshotTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers build() { + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers buildPartial() { + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers result = + new com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers(this); + if (snapshotTimeBuilder_ == null) { + result.snapshotTime_ = snapshotTime_; + } else { + result.snapshotTime_ = snapshotTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers other) { + if (other + == com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.getDefaultInstance()) + return this; + if (other.hasSnapshotTime()) { + mergeSnapshotTime(other.getSnapshotTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp snapshotTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + snapshotTimeBuilder_; + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + * + * @return Whether the snapshotTime field is set. + */ + public boolean hasSnapshotTime() { + return snapshotTimeBuilder_ != null || snapshotTime_ != null; + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + * + * @return The snapshotTime. + */ + public com.google.protobuf.Timestamp getSnapshotTime() { + if (snapshotTimeBuilder_ == null) { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } else { + return snapshotTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshotTime_ = value; + onChanged(); + } else { + snapshotTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = builderForValue.build(); + onChanged(); + } else { + snapshotTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + public Builder mergeSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (snapshotTime_ != null) { + snapshotTime_ = + com.google.protobuf.Timestamp.newBuilder(snapshotTime_) + .mergeFrom(value) + .buildPartial(); + } else { + snapshotTime_ = value; + } + onChanged(); + } else { + snapshotTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + public Builder clearSnapshotTime() { + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = null; + onChanged(); + } else { + snapshotTime_ = null; + snapshotTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getSnapshotTimeBuilder() { + + onChanged(); + return getSnapshotTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + if (snapshotTimeBuilder_ != null) { + return snapshotTimeBuilder_.getMessageOrBuilder(); + } else { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + } + /** + * + * + *
+       * The snapshot time of the table. If not set, interpreted as now.
+       * 
+ * + * .google.protobuf.Timestamp snapshot_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSnapshotTimeFieldBuilder() { + if (snapshotTimeBuilder_ == null) { + snapshotTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSnapshotTime(), getParentForChildren(), isClean()); + snapshotTime_ = null; + } + return snapshotTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + private static final com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers(); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TableModifiers parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TableModifiers(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TableReadOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @return A list containing the selectedFields. + */ + java.util.List getSelectedFieldsList(); + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @return The count of selectedFields. + */ + int getSelectedFieldsCount(); + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @param index The index of the element to return. + * @return The selectedFields at the given index. + */ + java.lang.String getSelectedFields(int index); + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @param index The index of the value to return. + * @return The bytes of the selectedFields at the given index. + */ + com.google.protobuf.ByteString getSelectedFieldsBytes(int index); + + /** + * + * + *
+     * SQL text filtering statement, similar to a WHERE clause in a query.
+     * Currently, only a single predicate that is a comparison between a column
+     * and a constant value is supported. Aggregates are not supported.
+     * Examples: "int_field > 5"
+     *           "date_field = CAST('2014-9-27' as DATE)"
+     *           "nullable_field is not NULL"
+     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+     *           "numeric_field BETWEEN 1.0 AND 5.0"
+     * 
+ * + * string row_restriction = 2; + * + * @return The rowRestriction. + */ + java.lang.String getRowRestriction(); + /** + * + * + *
+     * SQL text filtering statement, similar to a WHERE clause in a query.
+     * Currently, only a single predicate that is a comparison between a column
+     * and a constant value is supported. Aggregates are not supported.
+     * Examples: "int_field > 5"
+     *           "date_field = CAST('2014-9-27' as DATE)"
+     *           "nullable_field is not NULL"
+     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+     *           "numeric_field BETWEEN 1.0 AND 5.0"
+     * 
+ * + * string row_restriction = 2; + * + * @return The bytes for rowRestriction. + */ + com.google.protobuf.ByteString getRowRestrictionBytes(); + } + /** + * + * + *
+   * Options dictating how we read a table.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} + */ + public static final class TableReadOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + TableReadOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TableReadOptions.newBuilder() to construct. + private TableReadOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TableReadOptions() { + selectedFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + rowRestriction_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TableReadOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TableReadOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + selectedFields_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + selectedFields_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + rowRestriction_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + selectedFields_ = selectedFields_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.class, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder.class); + } + + public static final int SELECTED_FIELDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList selectedFields_; + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @return A list containing the selectedFields. + */ + public com.google.protobuf.ProtocolStringList getSelectedFieldsList() { + return selectedFields_; + } + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @return The count of selectedFields. + */ + public int getSelectedFieldsCount() { + return selectedFields_.size(); + } + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @param index The index of the element to return. + * @return The selectedFields at the given index. + */ + public java.lang.String getSelectedFields(int index) { + return selectedFields_.get(index); + } + /** + * + * + *
+     * Names of the fields in the table that should be read. If empty, all
+     * fields will be read. If the specified field is a nested field, all
+     * the sub-fields in the field will be selected. The output field order is
+     * unrelated to the order of fields in selected_fields.
+     * 
+ * + * repeated string selected_fields = 1; + * + * @param index The index of the value to return. + * @return The bytes of the selectedFields at the given index. + */ + public com.google.protobuf.ByteString getSelectedFieldsBytes(int index) { + return selectedFields_.getByteString(index); + } + + public static final int ROW_RESTRICTION_FIELD_NUMBER = 2; + private volatile java.lang.Object rowRestriction_; + /** + * + * + *
+     * SQL text filtering statement, similar to a WHERE clause in a query.
+     * Currently, only a single predicate that is a comparison between a column
+     * and a constant value is supported. Aggregates are not supported.
+     * Examples: "int_field > 5"
+     *           "date_field = CAST('2014-9-27' as DATE)"
+     *           "nullable_field is not NULL"
+     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+     *           "numeric_field BETWEEN 1.0 AND 5.0"
+     * 
+ * + * string row_restriction = 2; + * + * @return The rowRestriction. + */ + public java.lang.String getRowRestriction() { + java.lang.Object ref = rowRestriction_; + 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(); + rowRestriction_ = s; + return s; + } + } + /** + * + * + *
+     * SQL text filtering statement, similar to a WHERE clause in a query.
+     * Currently, only a single predicate that is a comparison between a column
+     * and a constant value is supported. Aggregates are not supported.
+     * Examples: "int_field > 5"
+     *           "date_field = CAST('2014-9-27' as DATE)"
+     *           "nullable_field is not NULL"
+     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+     *           "numeric_field BETWEEN 1.0 AND 5.0"
+     * 
+ * + * string row_restriction = 2; + * + * @return The bytes for rowRestriction. + */ + public com.google.protobuf.ByteString getRowRestrictionBytes() { + java.lang.Object ref = rowRestriction_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rowRestriction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < selectedFields_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selectedFields_.getRaw(i)); + } + if (!getRowRestrictionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rowRestriction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < selectedFields_.size(); i++) { + dataSize += computeStringSizeNoTag(selectedFields_.getRaw(i)); + } + size += dataSize; + size += 1 * getSelectedFieldsList().size(); + } + if (!getRowRestrictionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, rowRestriction_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions other = + (com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) obj; + + if (!getSelectedFieldsList().equals(other.getSelectedFieldsList())) return false; + if (!getRowRestriction().equals(other.getRowRestriction())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSelectedFieldsCount() > 0) { + hash = (37 * hash) + SELECTED_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getSelectedFieldsList().hashCode(); + } + hash = (37 * hash) + ROW_RESTRICTION_FIELD_NUMBER; + hash = (53 * hash) + getRowRestriction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Options dictating how we read a table.
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.class, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + selectedFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + rowRestriction_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions build() { + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions buildPartial() { + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions result = + new com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + selectedFields_ = selectedFields_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.selectedFields_ = selectedFields_; + result.rowRestriction_ = rowRestriction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) { + return mergeFrom( + (com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions other) { + if (other + == com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + .getDefaultInstance()) return this; + if (!other.selectedFields_.isEmpty()) { + if (selectedFields_.isEmpty()) { + selectedFields_ = other.selectedFields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSelectedFieldsIsMutable(); + selectedFields_.addAll(other.selectedFields_); + } + onChanged(); + } + if (!other.getRowRestriction().isEmpty()) { + rowRestriction_ = other.rowRestriction_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList selectedFields_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSelectedFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + selectedFields_ = new com.google.protobuf.LazyStringArrayList(selectedFields_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @return A list containing the selectedFields. + */ + public com.google.protobuf.ProtocolStringList getSelectedFieldsList() { + return selectedFields_.getUnmodifiableView(); + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @return The count of selectedFields. + */ + public int getSelectedFieldsCount() { + return selectedFields_.size(); + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @param index The index of the element to return. + * @return The selectedFields at the given index. + */ + public java.lang.String getSelectedFields(int index) { + return selectedFields_.get(index); + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @param value The bytes of the selectedFields to add. + */ + public com.google.protobuf.ByteString getSelectedFieldsBytes(int index) { + return selectedFields_.getByteString(index); + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @param index The index to set the value at. + * @param value The selectedFields to set. + * @return This builder for chaining. + */ + public Builder setSelectedFields(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedFieldsIsMutable(); + selectedFields_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @param value The selectedFields to add. + * @return This builder for chaining. + */ + public Builder addSelectedFields(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSelectedFieldsIsMutable(); + selectedFields_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @param values The selectedFields to add. + * @return This builder for chaining. + */ + public Builder addAllSelectedFields(java.lang.Iterable values) { + ensureSelectedFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, selectedFields_); + onChanged(); + return this; + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @return This builder for chaining. + */ + public Builder clearSelectedFields() { + selectedFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Names of the fields in the table that should be read. If empty, all
+       * fields will be read. If the specified field is a nested field, all
+       * the sub-fields in the field will be selected. The output field order is
+       * unrelated to the order of fields in selected_fields.
+       * 
+ * + * repeated string selected_fields = 1; + * + * @param value The bytes of the selectedFields to add. + * @return This builder for chaining. + */ + public Builder addSelectedFieldsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSelectedFieldsIsMutable(); + selectedFields_.add(value); + onChanged(); + return this; + } + + private java.lang.Object rowRestriction_ = ""; + /** + * + * + *
+       * SQL text filtering statement, similar to a WHERE clause in a query.
+       * Currently, only a single predicate that is a comparison between a column
+       * and a constant value is supported. Aggregates are not supported.
+       * Examples: "int_field > 5"
+       *           "date_field = CAST('2014-9-27' as DATE)"
+       *           "nullable_field is not NULL"
+       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+       *           "numeric_field BETWEEN 1.0 AND 5.0"
+       * 
+ * + * string row_restriction = 2; + * + * @return The rowRestriction. + */ + public java.lang.String getRowRestriction() { + java.lang.Object ref = rowRestriction_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rowRestriction_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * SQL text filtering statement, similar to a WHERE clause in a query.
+       * Currently, only a single predicate that is a comparison between a column
+       * and a constant value is supported. Aggregates are not supported.
+       * Examples: "int_field > 5"
+       *           "date_field = CAST('2014-9-27' as DATE)"
+       *           "nullable_field is not NULL"
+       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+       *           "numeric_field BETWEEN 1.0 AND 5.0"
+       * 
+ * + * string row_restriction = 2; + * + * @return The bytes for rowRestriction. + */ + public com.google.protobuf.ByteString getRowRestrictionBytes() { + java.lang.Object ref = rowRestriction_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rowRestriction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * SQL text filtering statement, similar to a WHERE clause in a query.
+       * Currently, only a single predicate that is a comparison between a column
+       * and a constant value is supported. Aggregates are not supported.
+       * Examples: "int_field > 5"
+       *           "date_field = CAST('2014-9-27' as DATE)"
+       *           "nullable_field is not NULL"
+       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+       *           "numeric_field BETWEEN 1.0 AND 5.0"
+       * 
+ * + * string row_restriction = 2; + * + * @param value The rowRestriction to set. + * @return This builder for chaining. + */ + public Builder setRowRestriction(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + rowRestriction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * SQL text filtering statement, similar to a WHERE clause in a query.
+       * Currently, only a single predicate that is a comparison between a column
+       * and a constant value is supported. Aggregates are not supported.
+       * Examples: "int_field > 5"
+       *           "date_field = CAST('2014-9-27' as DATE)"
+       *           "nullable_field is not NULL"
+       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+       *           "numeric_field BETWEEN 1.0 AND 5.0"
+       * 
+ * + * string row_restriction = 2; + * + * @return This builder for chaining. + */ + public Builder clearRowRestriction() { + + rowRestriction_ = getDefaultInstance().getRowRestriction(); + onChanged(); + return this; + } + /** + * + * + *
+       * SQL text filtering statement, similar to a WHERE clause in a query.
+       * Currently, only a single predicate that is a comparison between a column
+       * and a constant value is supported. Aggregates are not supported.
+       * Examples: "int_field > 5"
+       *           "date_field = CAST('2014-9-27' as DATE)"
+       *           "nullable_field is not NULL"
+       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
+       *           "numeric_field BETWEEN 1.0 AND 5.0"
+       * 
+ * + * string row_restriction = 2; + * + * @param value The bytes for rowRestriction to set. + * @return This builder for chaining. + */ + public Builder setRowRestrictionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + rowRestriction_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + private static final com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions(); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TableReadOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TableReadOptions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int schemaCase_ = 0; + private java.lang.Object schema_; + + public enum SchemaCase implements com.google.protobuf.Internal.EnumLite { + AVRO_SCHEMA(4), + ARROW_SCHEMA(5), + SCHEMA_NOT_SET(0); + private final int value; + + private SchemaCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SchemaCase valueOf(int value) { + return forNumber(value); + } + + public static SchemaCase forNumber(int value) { + switch (value) { + case 4: + return AVRO_SCHEMA; + case 5: + return ARROW_SCHEMA; + case 0: + return SCHEMA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SchemaCase getSchemaCase() { + return SchemaCase.forNumber(schemaCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Unique identifier for the session, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Unique identifier for the session, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * Output only. Time at which the session becomes invalid. After this time, subsequent
+   * requests to read this Session will return errors. The expire_time is
+   * automatically assigned and currently cannot be specified or updated.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * Output only. Time at which the session becomes invalid. After this time, subsequent
+   * requests to read this Session will return errors. The expire_time is
+   * automatically assigned and currently cannot be specified or updated.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * Output only. Time at which the session becomes invalid. After this time, subsequent
+   * requests to read this Session will return errors. The expire_time is
+   * automatically assigned and currently cannot be specified or updated.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + public static final int DATA_FORMAT_FIELD_NUMBER = 3; + private int dataFormat_; + /** + * + * + *
+   * Immutable. Data format of the output data.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+   * Immutable. Data format of the output data.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The dataFormat. + */ + public com.google.cloud.bigquery.storage.v1.DataFormat getDataFormat() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.storage.v1.DataFormat result = + com.google.cloud.bigquery.storage.v1.DataFormat.valueOf(dataFormat_); + return result == null ? com.google.cloud.bigquery.storage.v1.DataFormat.UNRECOGNIZED : result; + } + + public static final int AVRO_SCHEMA_FIELD_NUMBER = 4; + /** + * + * + *
+   * Output only. Avro schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the avroSchema field is set. + */ + public boolean hasAvroSchema() { + return schemaCase_ == 4; + } + /** + * + * + *
+   * Output only. Avro schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The avroSchema. + */ + public com.google.cloud.bigquery.storage.v1.AvroSchema getAvroSchema() { + if (schemaCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Avro schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.AvroSchemaOrBuilder getAvroSchemaOrBuilder() { + if (schemaCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance(); + } + + public static final int ARROW_SCHEMA_FIELD_NUMBER = 5; + /** + * + * + *
+   * Output only. Arrow schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the arrowSchema field is set. + */ + public boolean hasArrowSchema() { + return schemaCase_ == 5; + } + /** + * + * + *
+   * Output only. Arrow schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The arrowSchema. + */ + public com.google.cloud.bigquery.storage.v1.ArrowSchema getArrowSchema() { + if (schemaCase_ == 5) { + return (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. Arrow schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ArrowSchemaOrBuilder getArrowSchemaOrBuilder() { + if (schemaCase_ == 5) { + return (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance(); + } + + public static final int TABLE_FIELD_NUMBER = 6; + private volatile java.lang.Object table_; + /** + * + * + *
+   * Immutable. Table that this ReadSession is reading from, in the form
+   * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+   * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The table. + */ + public java.lang.String getTable() { + java.lang.Object ref = table_; + 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(); + table_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Table that this ReadSession is reading from, in the form
+   * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+   * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for table. + */ + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_MODIFIERS_FIELD_NUMBER = 7; + private com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers tableModifiers_; + /** + * + * + *
+   * Optional. Any modifiers which are applied when reading from the specified table.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tableModifiers field is set. + */ + public boolean hasTableModifiers() { + return tableModifiers_ != null; + } + /** + * + * + *
+   * Optional. Any modifiers which are applied when reading from the specified table.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tableModifiers. + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers getTableModifiers() { + return tableModifiers_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.getDefaultInstance() + : tableModifiers_; + } + /** + * + * + *
+   * Optional. Any modifiers which are applied when reading from the specified table.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiersOrBuilder + getTableModifiersOrBuilder() { + return getTableModifiers(); + } + + public static final int READ_OPTIONS_FIELD_NUMBER = 8; + private com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions readOptions_; + /** + * + * + *
+   * Optional. Read options for this session (e.g. column selection, filters).
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readOptions field is set. + */ + public boolean hasReadOptions() { + return readOptions_ != null; + } + /** + * + * + *
+   * Optional. Read options for this session (e.g. column selection, filters).
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readOptions. + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions getReadOptions() { + return readOptions_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.getDefaultInstance() + : readOptions_; + } + /** + * + * + *
+   * Optional. Read options for this session (e.g. column selection, filters).
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptionsOrBuilder + getReadOptionsOrBuilder() { + return getReadOptions(); + } + + public static final int STREAMS_FIELD_NUMBER = 10; + private java.util.List streams_; + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getStreamsList() { + return streams_; + } + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStreamsOrBuilderList() { + return streams_; + } + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getStreamsCount() { + return streams_.size(); + } + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadStream getStreams(int index) { + return streams_.get(index); + } + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getStreamsOrBuilder(int index) { + return streams_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (expireTime_ != null) { + output.writeMessage(2, getExpireTime()); + } + if (dataFormat_ + != com.google.cloud.bigquery.storage.v1.DataFormat.DATA_FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(3, dataFormat_); + } + if (schemaCase_ == 4) { + output.writeMessage(4, (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_); + } + if (schemaCase_ == 5) { + output.writeMessage(5, (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_); + } + if (!getTableBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, table_); + } + if (tableModifiers_ != null) { + output.writeMessage(7, getTableModifiers()); + } + if (readOptions_ != null) { + output.writeMessage(8, getReadOptions()); + } + for (int i = 0; i < streams_.size(); i++) { + output.writeMessage(10, streams_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpireTime()); + } + if (dataFormat_ + != com.google.cloud.bigquery.storage.v1.DataFormat.DATA_FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, dataFormat_); + } + if (schemaCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_); + } + if (schemaCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_); + } + if (!getTableBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, table_); + } + if (tableModifiers_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getTableModifiers()); + } + if (readOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getReadOptions()); + } + for (int i = 0; i < streams_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, streams_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ReadSession)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ReadSession other = + (com.google.cloud.bigquery.storage.v1.ReadSession) obj; + + if (!getName().equals(other.getName())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (dataFormat_ != other.dataFormat_) return false; + if (!getTable().equals(other.getTable())) return false; + if (hasTableModifiers() != other.hasTableModifiers()) return false; + if (hasTableModifiers()) { + if (!getTableModifiers().equals(other.getTableModifiers())) return false; + } + if (hasReadOptions() != other.hasReadOptions()) return false; + if (hasReadOptions()) { + if (!getReadOptions().equals(other.getReadOptions())) return false; + } + if (!getStreamsList().equals(other.getStreamsList())) return false; + if (!getSchemaCase().equals(other.getSchemaCase())) return false; + switch (schemaCase_) { + case 4: + if (!getAvroSchema().equals(other.getAvroSchema())) return false; + break; + case 5: + if (!getArrowSchema().equals(other.getArrowSchema())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (37 * hash) + DATA_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + dataFormat_; + hash = (37 * hash) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + if (hasTableModifiers()) { + hash = (37 * hash) + TABLE_MODIFIERS_FIELD_NUMBER; + hash = (53 * hash) + getTableModifiers().hashCode(); + } + if (hasReadOptions()) { + hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getReadOptions().hashCode(); + } + if (getStreamsCount() > 0) { + hash = (37 * hash) + STREAMS_FIELD_NUMBER; + hash = (53 * hash) + getStreamsList().hashCode(); + } + switch (schemaCase_) { + case 4: + hash = (37 * hash) + AVRO_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getAvroSchema().hashCode(); + break; + case 5: + hash = (37 * hash) + ARROW_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getArrowSchema().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.ReadSession prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information about the ReadSession.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadSession} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ReadSession) + com.google.cloud.bigquery.storage.v1.ReadSessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadSession.class, + com.google.cloud.bigquery.storage.v1.ReadSession.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.ReadSession.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStreamsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + dataFormat_ = 0; + + table_ = ""; + + if (tableModifiersBuilder_ == null) { + tableModifiers_ = null; + } else { + tableModifiers_ = null; + tableModifiersBuilder_ = null; + } + if (readOptionsBuilder_ == null) { + readOptions_ = null; + } else { + readOptions_ = null; + readOptionsBuilder_ = null; + } + if (streamsBuilder_ == null) { + streams_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + streamsBuilder_.clear(); + } + schemaCase_ = 0; + schema_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ReadSession.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession build() { + com.google.cloud.bigquery.storage.v1.ReadSession result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession buildPartial() { + com.google.cloud.bigquery.storage.v1.ReadSession result = + new com.google.cloud.bigquery.storage.v1.ReadSession(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.build(); + } + result.dataFormat_ = dataFormat_; + if (schemaCase_ == 4) { + if (avroSchemaBuilder_ == null) { + result.schema_ = schema_; + } else { + result.schema_ = avroSchemaBuilder_.build(); + } + } + if (schemaCase_ == 5) { + if (arrowSchemaBuilder_ == null) { + result.schema_ = schema_; + } else { + result.schema_ = arrowSchemaBuilder_.build(); + } + } + result.table_ = table_; + if (tableModifiersBuilder_ == null) { + result.tableModifiers_ = tableModifiers_; + } else { + result.tableModifiers_ = tableModifiersBuilder_.build(); + } + if (readOptionsBuilder_ == null) { + result.readOptions_ = readOptions_; + } else { + result.readOptions_ = readOptionsBuilder_.build(); + } + if (streamsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + streams_ = java.util.Collections.unmodifiableList(streams_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.streams_ = streams_; + } else { + result.streams_ = streamsBuilder_.build(); + } + result.schemaCase_ = schemaCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ReadSession) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ReadSession) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ReadSession other) { + if (other == com.google.cloud.bigquery.storage.v1.ReadSession.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + if (other.dataFormat_ != 0) { + setDataFormatValue(other.getDataFormatValue()); + } + if (!other.getTable().isEmpty()) { + table_ = other.table_; + onChanged(); + } + if (other.hasTableModifiers()) { + mergeTableModifiers(other.getTableModifiers()); + } + if (other.hasReadOptions()) { + mergeReadOptions(other.getReadOptions()); + } + if (streamsBuilder_ == null) { + if (!other.streams_.isEmpty()) { + if (streams_.isEmpty()) { + streams_ = other.streams_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStreamsIsMutable(); + streams_.addAll(other.streams_); + } + onChanged(); + } + } else { + if (!other.streams_.isEmpty()) { + if (streamsBuilder_.isEmpty()) { + streamsBuilder_.dispose(); + streamsBuilder_ = null; + streams_ = other.streams_; + bitField0_ = (bitField0_ & ~0x00000001); + streamsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStreamsFieldBuilder() + : null; + } else { + streamsBuilder_.addAllMessages(other.streams_); + } + } + } + switch (other.getSchemaCase()) { + case AVRO_SCHEMA: + { + mergeAvroSchema(other.getAvroSchema()); + break; + } + case ARROW_SCHEMA: + { + mergeArrowSchema(other.getArrowSchema()); + break; + } + case SCHEMA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ReadSession parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.bigquery.storage.v1.ReadSession) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int schemaCase_ = 0; + private java.lang.Object schema_; + + public SchemaCase getSchemaCase() { + return SchemaCase.forNumber(schemaCase_); + } + + public Builder clearSchema() { + schemaCase_ = 0; + schema_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Unique identifier for the session, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Unique identifier for the session, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Unique identifier for the session, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Unique identifier for the session, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Unique identifier for the session, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * Output only. Time at which the session becomes invalid. After this time, subsequent
+     * requests to read this Session will return errors. The expire_time is
+     * automatically assigned and currently cannot be specified or updated.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + private int dataFormat_ = 0; + /** + * + * + *
+     * Immutable. Data format of the output data.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+     * Immutable. Data format of the output data.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormatValue(int value) { + dataFormat_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Data format of the output data.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The dataFormat. + */ + public com.google.cloud.bigquery.storage.v1.DataFormat getDataFormat() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.storage.v1.DataFormat result = + com.google.cloud.bigquery.storage.v1.DataFormat.valueOf(dataFormat_); + return result == null ? com.google.cloud.bigquery.storage.v1.DataFormat.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Immutable. Data format of the output data.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormat(com.google.cloud.bigquery.storage.v1.DataFormat value) { + if (value == null) { + throw new NullPointerException(); + } + + dataFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Data format of the output data.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataFormat() { + + dataFormat_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.AvroSchema, + com.google.cloud.bigquery.storage.v1.AvroSchema.Builder, + com.google.cloud.bigquery.storage.v1.AvroSchemaOrBuilder> + avroSchemaBuilder_; + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the avroSchema field is set. + */ + public boolean hasAvroSchema() { + return schemaCase_ == 4; + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The avroSchema. + */ + public com.google.cloud.bigquery.storage.v1.AvroSchema getAvroSchema() { + if (avroSchemaBuilder_ == null) { + if (schemaCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance(); + } else { + if (schemaCase_ == 4) { + return avroSchemaBuilder_.getMessage(); + } + return com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAvroSchema(com.google.cloud.bigquery.storage.v1.AvroSchema value) { + if (avroSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + onChanged(); + } else { + avroSchemaBuilder_.setMessage(value); + } + schemaCase_ = 4; + return this; + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAvroSchema( + com.google.cloud.bigquery.storage.v1.AvroSchema.Builder builderForValue) { + if (avroSchemaBuilder_ == null) { + schema_ = builderForValue.build(); + onChanged(); + } else { + avroSchemaBuilder_.setMessage(builderForValue.build()); + } + schemaCase_ = 4; + return this; + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeAvroSchema(com.google.cloud.bigquery.storage.v1.AvroSchema value) { + if (avroSchemaBuilder_ == null) { + if (schemaCase_ == 4 + && schema_ != com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance()) { + schema_ = + com.google.cloud.bigquery.storage.v1.AvroSchema.newBuilder( + (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_) + .mergeFrom(value) + .buildPartial(); + } else { + schema_ = value; + } + onChanged(); + } else { + if (schemaCase_ == 4) { + avroSchemaBuilder_.mergeFrom(value); + } + avroSchemaBuilder_.setMessage(value); + } + schemaCase_ = 4; + return this; + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAvroSchema() { + if (avroSchemaBuilder_ == null) { + if (schemaCase_ == 4) { + schemaCase_ = 0; + schema_ = null; + onChanged(); + } + } else { + if (schemaCase_ == 4) { + schemaCase_ = 0; + schema_ = null; + } + avroSchemaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.AvroSchema.Builder getAvroSchemaBuilder() { + return getAvroSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.AvroSchemaOrBuilder getAvroSchemaOrBuilder() { + if ((schemaCase_ == 4) && (avroSchemaBuilder_ != null)) { + return avroSchemaBuilder_.getMessageOrBuilder(); + } else { + if (schemaCase_ == 4) { + return (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Avro schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.AvroSchema, + com.google.cloud.bigquery.storage.v1.AvroSchema.Builder, + com.google.cloud.bigquery.storage.v1.AvroSchemaOrBuilder> + getAvroSchemaFieldBuilder() { + if (avroSchemaBuilder_ == null) { + if (!(schemaCase_ == 4)) { + schema_ = com.google.cloud.bigquery.storage.v1.AvroSchema.getDefaultInstance(); + } + avroSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.AvroSchema, + com.google.cloud.bigquery.storage.v1.AvroSchema.Builder, + com.google.cloud.bigquery.storage.v1.AvroSchemaOrBuilder>( + (com.google.cloud.bigquery.storage.v1.AvroSchema) schema_, + getParentForChildren(), + isClean()); + schema_ = null; + } + schemaCase_ = 4; + onChanged(); + ; + return avroSchemaBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ArrowSchema, + com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder, + com.google.cloud.bigquery.storage.v1.ArrowSchemaOrBuilder> + arrowSchemaBuilder_; + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the arrowSchema field is set. + */ + public boolean hasArrowSchema() { + return schemaCase_ == 5; + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The arrowSchema. + */ + public com.google.cloud.bigquery.storage.v1.ArrowSchema getArrowSchema() { + if (arrowSchemaBuilder_ == null) { + if (schemaCase_ == 5) { + return (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance(); + } else { + if (schemaCase_ == 5) { + return arrowSchemaBuilder_.getMessage(); + } + return com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setArrowSchema(com.google.cloud.bigquery.storage.v1.ArrowSchema value) { + if (arrowSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + onChanged(); + } else { + arrowSchemaBuilder_.setMessage(value); + } + schemaCase_ = 5; + return this; + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setArrowSchema( + com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder builderForValue) { + if (arrowSchemaBuilder_ == null) { + schema_ = builderForValue.build(); + onChanged(); + } else { + arrowSchemaBuilder_.setMessage(builderForValue.build()); + } + schemaCase_ = 5; + return this; + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeArrowSchema(com.google.cloud.bigquery.storage.v1.ArrowSchema value) { + if (arrowSchemaBuilder_ == null) { + if (schemaCase_ == 5 + && schema_ != com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance()) { + schema_ = + com.google.cloud.bigquery.storage.v1.ArrowSchema.newBuilder( + (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_) + .mergeFrom(value) + .buildPartial(); + } else { + schema_ = value; + } + onChanged(); + } else { + if (schemaCase_ == 5) { + arrowSchemaBuilder_.mergeFrom(value); + } + arrowSchemaBuilder_.setMessage(value); + } + schemaCase_ = 5; + return this; + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearArrowSchema() { + if (arrowSchemaBuilder_ == null) { + if (schemaCase_ == 5) { + schemaCase_ = 0; + schema_ = null; + onChanged(); + } + } else { + if (schemaCase_ == 5) { + schemaCase_ = 0; + schema_ = null; + } + arrowSchemaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder getArrowSchemaBuilder() { + return getArrowSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ArrowSchemaOrBuilder getArrowSchemaOrBuilder() { + if ((schemaCase_ == 5) && (arrowSchemaBuilder_ != null)) { + return arrowSchemaBuilder_.getMessageOrBuilder(); + } else { + if (schemaCase_ == 5) { + return (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_; + } + return com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. Arrow schema.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ArrowSchema, + com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder, + com.google.cloud.bigquery.storage.v1.ArrowSchemaOrBuilder> + getArrowSchemaFieldBuilder() { + if (arrowSchemaBuilder_ == null) { + if (!(schemaCase_ == 5)) { + schema_ = com.google.cloud.bigquery.storage.v1.ArrowSchema.getDefaultInstance(); + } + arrowSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ArrowSchema, + com.google.cloud.bigquery.storage.v1.ArrowSchema.Builder, + com.google.cloud.bigquery.storage.v1.ArrowSchemaOrBuilder>( + (com.google.cloud.bigquery.storage.v1.ArrowSchema) schema_, + getParentForChildren(), + isClean()); + schema_ = null; + } + schemaCase_ = 5; + onChanged(); + ; + return arrowSchemaBuilder_; + } + + private java.lang.Object table_ = ""; + /** + * + * + *
+     * Immutable. Table that this ReadSession is reading from, in the form
+     * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+     * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The table. + */ + public java.lang.String getTable() { + java.lang.Object ref = table_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + table_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Table that this ReadSession is reading from, in the form
+     * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+     * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for table. + */ + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Table that this ReadSession is reading from, in the form
+     * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+     * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The table to set. + * @return This builder for chaining. + */ + public Builder setTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + table_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Table that this ReadSession is reading from, in the form
+     * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+     * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTable() { + + table_ = getDefaultInstance().getTable(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Table that this ReadSession is reading from, in the form
+     * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+     * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for table to set. + * @return This builder for chaining. + */ + public Builder setTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + table_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers tableModifiers_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiersOrBuilder> + tableModifiersBuilder_; + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tableModifiers field is set. + */ + public boolean hasTableModifiers() { + return tableModifiersBuilder_ != null || tableModifiers_ != null; + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tableModifiers. + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers getTableModifiers() { + if (tableModifiersBuilder_ == null) { + return tableModifiers_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.getDefaultInstance() + : tableModifiers_; + } else { + return tableModifiersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTableModifiers( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers value) { + if (tableModifiersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tableModifiers_ = value; + onChanged(); + } else { + tableModifiersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTableModifiers( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder builderForValue) { + if (tableModifiersBuilder_ == null) { + tableModifiers_ = builderForValue.build(); + onChanged(); + } else { + tableModifiersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTableModifiers( + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers value) { + if (tableModifiersBuilder_ == null) { + if (tableModifiers_ != null) { + tableModifiers_ = + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.newBuilder( + tableModifiers_) + .mergeFrom(value) + .buildPartial(); + } else { + tableModifiers_ = value; + } + onChanged(); + } else { + tableModifiersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTableModifiers() { + if (tableModifiersBuilder_ == null) { + tableModifiers_ = null; + onChanged(); + } else { + tableModifiers_ = null; + tableModifiersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder + getTableModifiersBuilder() { + + onChanged(); + return getTableModifiersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiersOrBuilder + getTableModifiersOrBuilder() { + if (tableModifiersBuilder_ != null) { + return tableModifiersBuilder_.getMessageOrBuilder(); + } else { + return tableModifiers_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.getDefaultInstance() + : tableModifiers_; + } + } + /** + * + * + *
+     * Optional. Any modifiers which are applied when reading from the specified table.
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiersOrBuilder> + getTableModifiersFieldBuilder() { + if (tableModifiersBuilder_ == null) { + tableModifiersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.Builder, + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiersOrBuilder>( + getTableModifiers(), getParentForChildren(), isClean()); + tableModifiers_ = null; + } + return tableModifiersBuilder_; + } + + private com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions readOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptionsOrBuilder> + readOptionsBuilder_; + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readOptions field is set. + */ + public boolean hasReadOptions() { + return readOptionsBuilder_ != null || readOptions_ != null; + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readOptions. + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions getReadOptions() { + if (readOptionsBuilder_ == null) { + return readOptions_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.getDefaultInstance() + : readOptions_; + } else { + return readOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadOptions( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions value) { + if (readOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readOptions_ = value; + onChanged(); + } else { + readOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadOptions( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder builderForValue) { + if (readOptionsBuilder_ == null) { + readOptions_ = builderForValue.build(); + onChanged(); + } else { + readOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadOptions( + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions value) { + if (readOptionsBuilder_ == null) { + if (readOptions_ != null) { + readOptions_ = + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.newBuilder( + readOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + readOptions_ = value; + } + onChanged(); + } else { + readOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadOptions() { + if (readOptionsBuilder_ == null) { + readOptions_ = null; + onChanged(); + } else { + readOptions_ = null; + readOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder + getReadOptionsBuilder() { + + onChanged(); + return getReadOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptionsOrBuilder + getReadOptionsOrBuilder() { + if (readOptionsBuilder_ != null) { + return readOptionsBuilder_.getMessageOrBuilder(); + } else { + return readOptions_ == null + ? com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.getDefaultInstance() + : readOptions_; + } + } + /** + * + * + *
+     * Optional. Read options for this session (e.g. column selection, filters).
+     * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptionsOrBuilder> + getReadOptionsFieldBuilder() { + if (readOptionsBuilder_ == null) { + readOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.Builder, + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptionsOrBuilder>( + getReadOptions(), getParentForChildren(), isClean()); + readOptions_ = null; + } + return readOptionsBuilder_; + } + + private java.util.List streams_ = + java.util.Collections.emptyList(); + + private void ensureStreamsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + streams_ = + new java.util.ArrayList(streams_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder> + streamsBuilder_; + + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getStreamsList() { + if (streamsBuilder_ == null) { + return java.util.Collections.unmodifiableList(streams_); + } else { + return streamsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getStreamsCount() { + if (streamsBuilder_ == null) { + return streams_.size(); + } else { + return streamsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadStream getStreams(int index) { + if (streamsBuilder_ == null) { + return streams_.get(index); + } else { + return streamsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStreams(int index, com.google.cloud.bigquery.storage.v1.ReadStream value) { + if (streamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStreamsIsMutable(); + streams_.set(index, value); + onChanged(); + } else { + streamsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStreams( + int index, com.google.cloud.bigquery.storage.v1.ReadStream.Builder builderForValue) { + if (streamsBuilder_ == null) { + ensureStreamsIsMutable(); + streams_.set(index, builderForValue.build()); + onChanged(); + } else { + streamsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStreams(com.google.cloud.bigquery.storage.v1.ReadStream value) { + if (streamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStreamsIsMutable(); + streams_.add(value); + onChanged(); + } else { + streamsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStreams(int index, com.google.cloud.bigquery.storage.v1.ReadStream value) { + if (streamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStreamsIsMutable(); + streams_.add(index, value); + onChanged(); + } else { + streamsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStreams( + com.google.cloud.bigquery.storage.v1.ReadStream.Builder builderForValue) { + if (streamsBuilder_ == null) { + ensureStreamsIsMutable(); + streams_.add(builderForValue.build()); + onChanged(); + } else { + streamsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStreams( + int index, com.google.cloud.bigquery.storage.v1.ReadStream.Builder builderForValue) { + if (streamsBuilder_ == null) { + ensureStreamsIsMutable(); + streams_.add(index, builderForValue.build()); + onChanged(); + } else { + streamsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllStreams( + java.lang.Iterable values) { + if (streamsBuilder_ == null) { + ensureStreamsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, streams_); + onChanged(); + } else { + streamsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStreams() { + if (streamsBuilder_ == null) { + streams_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + streamsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeStreams(int index) { + if (streamsBuilder_ == null) { + ensureStreamsIsMutable(); + streams_.remove(index); + onChanged(); + } else { + streamsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadStream.Builder getStreamsBuilder(int index) { + return getStreamsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getStreamsOrBuilder(int index) { + if (streamsBuilder_ == null) { + return streams_.get(index); + } else { + return streamsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStreamsOrBuilderList() { + if (streamsBuilder_ != null) { + return streamsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(streams_); + } + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadStream.Builder addStreamsBuilder() { + return getStreamsFieldBuilder() + .addBuilder(com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.storage.v1.ReadStream.Builder addStreamsBuilder(int index) { + return getStreamsFieldBuilder() + .addBuilder(index, com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of streams created with the session.
+     * At least one stream is created with the session. In the future, larger
+     * request_stream_count values *may* result in this list being unpopulated,
+     * in that case, the user will need to use a List method to get the streams
+     * instead, which is not yet available.
+     * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStreamsBuilderList() { + return getStreamsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder> + getStreamsFieldBuilder() { + if (streamsBuilder_ == null) { + streamsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder>( + streams_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + streams_ = null; + } + return streamsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ReadSession) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ReadSession) + private static final com.google.cloud.bigquery.storage.v1.ReadSession DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ReadSession(); + } + + public static com.google.cloud.bigquery.storage.v1.ReadSession getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadSession parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadSession(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadSession getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSessionOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSessionOrBuilder.java new file mode 100644 index 0000000000..97794cef9a --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSessionOrBuilder.java @@ -0,0 +1,406 @@ +/* + * 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; + +public interface ReadSessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ReadSession) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Unique identifier for the session, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Unique identifier for the session, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Time at which the session becomes invalid. After this time, subsequent
+   * requests to read this Session will return errors. The expire_time is
+   * automatically assigned and currently cannot be specified or updated.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Output only. Time at which the session becomes invalid. After this time, subsequent
+   * requests to read this Session will return errors. The expire_time is
+   * automatically assigned and currently cannot be specified or updated.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Output only. Time at which the session becomes invalid. After this time, subsequent
+   * requests to read this Session will return errors. The expire_time is
+   * automatically assigned and currently cannot be specified or updated.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Immutable. Data format of the output data.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + int getDataFormatValue(); + /** + * + * + *
+   * Immutable. Data format of the output data.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.DataFormat data_format = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The dataFormat. + */ + com.google.cloud.bigquery.storage.v1.DataFormat getDataFormat(); + + /** + * + * + *
+   * Output only. Avro schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the avroSchema field is set. + */ + boolean hasAvroSchema(); + /** + * + * + *
+   * Output only. Avro schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The avroSchema. + */ + com.google.cloud.bigquery.storage.v1.AvroSchema getAvroSchema(); + /** + * + * + *
+   * Output only. Avro schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.AvroSchema avro_schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.bigquery.storage.v1.AvroSchemaOrBuilder getAvroSchemaOrBuilder(); + + /** + * + * + *
+   * Output only. Arrow schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the arrowSchema field is set. + */ + boolean hasArrowSchema(); + /** + * + * + *
+   * Output only. Arrow schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The arrowSchema. + */ + com.google.cloud.bigquery.storage.v1.ArrowSchema getArrowSchema(); + /** + * + * + *
+   * Output only. Arrow schema.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ArrowSchema arrow_schema = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.bigquery.storage.v1.ArrowSchemaOrBuilder getArrowSchemaOrBuilder(); + + /** + * + * + *
+   * Immutable. Table that this ReadSession is reading from, in the form
+   * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+   * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The table. + */ + java.lang.String getTable(); + /** + * + * + *
+   * Immutable. Table that this ReadSession is reading from, in the form
+   * `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
+   * 
+ * + * + * string table = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for table. + */ + com.google.protobuf.ByteString getTableBytes(); + + /** + * + * + *
+   * Optional. Any modifiers which are applied when reading from the specified table.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tableModifiers field is set. + */ + boolean hasTableModifiers(); + /** + * + * + *
+   * Optional. Any modifiers which are applied when reading from the specified table.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tableModifiers. + */ + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers getTableModifiers(); + /** + * + * + *
+   * Optional. Any modifiers which are applied when reading from the specified table.
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableModifiers table_modifiers = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.bigquery.storage.v1.ReadSession.TableModifiersOrBuilder + getTableModifiersOrBuilder(); + + /** + * + * + *
+   * Optional. Read options for this session (e.g. column selection, filters).
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readOptions field is set. + */ + boolean hasReadOptions(); + /** + * + * + *
+   * Optional. Read options for this session (e.g. column selection, filters).
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readOptions. + */ + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions getReadOptions(); + /** + * + * + *
+   * Optional. Read options for this session (e.g. column selection, filters).
+   * 
+ * + * + * .google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions read_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptionsOrBuilder + getReadOptionsOrBuilder(); + + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getStreamsList(); + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.bigquery.storage.v1.ReadStream getStreams(int index); + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getStreamsCount(); + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getStreamsOrBuilderList(); + /** + * + * + *
+   * Output only. A list of streams created with the session.
+   * At least one stream is created with the session. In the future, larger
+   * request_stream_count values *may* result in this list being unpopulated,
+   * in that case, the user will need to use a List method to get the streams
+   * instead, which is not yet available.
+   * 
+ * + * + * repeated .google.cloud.bigquery.storage.v1.ReadStream streams = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getStreamsOrBuilder(int index); + + public com.google.cloud.bigquery.storage.v1.ReadSession.SchemaCase getSchemaCase(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStream.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStream.java new file mode 100644 index 0000000000..bd960bd7fa --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStream.java @@ -0,0 +1,644 @@ +/* + * 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; + +/** + * + * + *
+ * Information about a single stream that gets data out of the storage system.
+ * Most of the information about `ReadStream` instances is aggregated, making
+ * `ReadStream` lightweight.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadStream} + */ +public final class ReadStream extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ReadStream) + ReadStreamOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadStream.newBuilder() to construct. + private ReadStream(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadStream() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadStream(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadStream( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadStream_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadStream_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadStream.class, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Name of the stream, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the stream, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ReadStream)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ReadStream other = + (com.google.cloud.bigquery.storage.v1.ReadStream) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.ReadStream prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information about a single stream that gets data out of the storage system.
+   * Most of the information about `ReadStream` instances is aggregated, making
+   * `ReadStream` lightweight.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ReadStream} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ReadStream) + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadStream_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadStream_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ReadStream.class, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.ReadStream.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StreamProto + .internal_static_google_cloud_bigquery_storage_v1_ReadStream_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadStream getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadStream build() { + com.google.cloud.bigquery.storage.v1.ReadStream result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadStream buildPartial() { + com.google.cloud.bigquery.storage.v1.ReadStream result = + new com.google.cloud.bigquery.storage.v1.ReadStream(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ReadStream) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ReadStream) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ReadStream other) { + if (other == com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ReadStream parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.bigquery.storage.v1.ReadStream) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Name of the stream, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the stream, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the stream, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the stream, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the stream, in the form
+     * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ReadStream) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ReadStream) + private static final com.google.cloud.bigquery.storage.v1.ReadStream DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ReadStream(); + } + + public static com.google.cloud.bigquery.storage.v1.ReadStream getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadStream parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadStream(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ReadStream getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStreamOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStreamOrBuilder.java new file mode 100644 index 0000000000..ded71e14ee --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadStreamOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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; + +public interface ReadStreamOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ReadStream) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the stream, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Name of the stream, in the form
+   * `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequest.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequest.java new file mode 100644 index 0000000000..f4ba015ecd --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequest.java @@ -0,0 +1,765 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Request message for `SplitReadStream`.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.SplitReadStreamRequest} + */ +public final class SplitReadStreamRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.SplitReadStreamRequest) + SplitReadStreamRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SplitReadStreamRequest.newBuilder() to construct. + private SplitReadStreamRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SplitReadStreamRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SplitReadStreamRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SplitReadStreamRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 17: + { + fraction_ = input.readDouble(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.class, + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the stream to split.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the stream to split.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FRACTION_FIELD_NUMBER = 2; + private double fraction_; + /** + * + * + *
+   * A value in the range (0.0, 1.0) that specifies the fractional point at
+   * which the original stream should be split. The actual split point is
+   * evaluated on pre-filtered rows, so if a filter is provided, then there is
+   * no guarantee that the division of the rows between the new child streams
+   * will be proportional to this fractional value. Additionally, because the
+   * server-side unit for assigning data is collections of rows, this fraction
+   * will always map to a data storage boundary on the server side.
+   * 
+ * + * double fraction = 2; + * + * @return The fraction. + */ + public double getFraction() { + return fraction_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (fraction_ != 0D) { + output.writeDouble(2, fraction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (fraction_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, fraction_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest other = + (com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (java.lang.Double.doubleToLongBits(getFraction()) + != java.lang.Double.doubleToLongBits(other.getFraction())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FRACTION_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFraction())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `SplitReadStream`.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.SplitReadStreamRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.SplitReadStreamRequest) + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.class, + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + fraction_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest build() { + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest buildPartial() { + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest result = + new com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest(this); + result.name_ = name_; + result.fraction_ = fraction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest other) { + if (other == com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getFraction() != 0D) { + setFraction(other.getFraction()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the stream to split.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the stream to split.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the stream to split.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the stream to split.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the stream to split.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private double fraction_; + /** + * + * + *
+     * A value in the range (0.0, 1.0) that specifies the fractional point at
+     * which the original stream should be split. The actual split point is
+     * evaluated on pre-filtered rows, so if a filter is provided, then there is
+     * no guarantee that the division of the rows between the new child streams
+     * will be proportional to this fractional value. Additionally, because the
+     * server-side unit for assigning data is collections of rows, this fraction
+     * will always map to a data storage boundary on the server side.
+     * 
+ * + * double fraction = 2; + * + * @return The fraction. + */ + public double getFraction() { + return fraction_; + } + /** + * + * + *
+     * A value in the range (0.0, 1.0) that specifies the fractional point at
+     * which the original stream should be split. The actual split point is
+     * evaluated on pre-filtered rows, so if a filter is provided, then there is
+     * no guarantee that the division of the rows between the new child streams
+     * will be proportional to this fractional value. Additionally, because the
+     * server-side unit for assigning data is collections of rows, this fraction
+     * will always map to a data storage boundary on the server side.
+     * 
+ * + * double fraction = 2; + * + * @param value The fraction to set. + * @return This builder for chaining. + */ + public Builder setFraction(double value) { + + fraction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A value in the range (0.0, 1.0) that specifies the fractional point at
+     * which the original stream should be split. The actual split point is
+     * evaluated on pre-filtered rows, so if a filter is provided, then there is
+     * no guarantee that the division of the rows between the new child streams
+     * will be proportional to this fractional value. Additionally, because the
+     * server-side unit for assigning data is collections of rows, this fraction
+     * will always map to a data storage boundary on the server side.
+     * 
+ * + * double fraction = 2; + * + * @return This builder for chaining. + */ + public Builder clearFraction() { + + fraction_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.SplitReadStreamRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.SplitReadStreamRequest) + private static final com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest(); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SplitReadStreamRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SplitReadStreamRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequestOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequestOrBuilder.java new file mode 100644 index 0000000000..9a7e2a7913 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamRequestOrBuilder.java @@ -0,0 +1,73 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface SplitReadStreamRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.SplitReadStreamRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the stream to split.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the stream to split.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * A value in the range (0.0, 1.0) that specifies the fractional point at
+   * which the original stream should be split. The actual split point is
+   * evaluated on pre-filtered rows, so if a filter is provided, then there is
+   * no guarantee that the division of the rows between the new child streams
+   * will be proportional to this fractional value. Additionally, because the
+   * server-side unit for assigning data is collections of rows, this fraction
+   * will always map to a data storage boundary on the server side.
+   * 
+ * + * double fraction = 2; + * + * @return The fraction. + */ + double getFraction(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponse.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponse.java new file mode 100644 index 0000000000..0e80d230c3 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponse.java @@ -0,0 +1,1046 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Response message for `SplitReadStream`.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.SplitReadStreamResponse} + */ +public final class SplitReadStreamResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.SplitReadStreamResponse) + SplitReadStreamResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SplitReadStreamResponse.newBuilder() to construct. + private SplitReadStreamResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SplitReadStreamResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SplitReadStreamResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SplitReadStreamResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.bigquery.storage.v1.ReadStream.Builder subBuilder = null; + if (primaryStream_ != null) { + subBuilder = primaryStream_.toBuilder(); + } + primaryStream_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ReadStream.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(primaryStream_); + primaryStream_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.bigquery.storage.v1.ReadStream.Builder subBuilder = null; + if (remainderStream_ != null) { + subBuilder = remainderStream_.toBuilder(); + } + remainderStream_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.ReadStream.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(remainderStream_); + remainderStream_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.class, + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.Builder.class); + } + + public static final int PRIMARY_STREAM_FIELD_NUMBER = 1; + private com.google.cloud.bigquery.storage.v1.ReadStream primaryStream_; + /** + * + * + *
+   * Primary stream, which contains the beginning portion of
+   * |original_stream|. An empty value indicates that the original stream can no
+   * longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * + * @return Whether the primaryStream field is set. + */ + public boolean hasPrimaryStream() { + return primaryStream_ != null; + } + /** + * + * + *
+   * Primary stream, which contains the beginning portion of
+   * |original_stream|. An empty value indicates that the original stream can no
+   * longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * + * @return The primaryStream. + */ + public com.google.cloud.bigquery.storage.v1.ReadStream getPrimaryStream() { + return primaryStream_ == null + ? com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance() + : primaryStream_; + } + /** + * + * + *
+   * Primary stream, which contains the beginning portion of
+   * |original_stream|. An empty value indicates that the original stream can no
+   * longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + public com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getPrimaryStreamOrBuilder() { + return getPrimaryStream(); + } + + public static final int REMAINDER_STREAM_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.storage.v1.ReadStream remainderStream_; + /** + * + * + *
+   * Remainder stream, which contains the tail of |original_stream|. An empty
+   * value indicates that the original stream can no longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * + * @return Whether the remainderStream field is set. + */ + public boolean hasRemainderStream() { + return remainderStream_ != null; + } + /** + * + * + *
+   * Remainder stream, which contains the tail of |original_stream|. An empty
+   * value indicates that the original stream can no longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * + * @return The remainderStream. + */ + public com.google.cloud.bigquery.storage.v1.ReadStream getRemainderStream() { + return remainderStream_ == null + ? com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance() + : remainderStream_; + } + /** + * + * + *
+   * Remainder stream, which contains the tail of |original_stream|. An empty
+   * value indicates that the original stream can no longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + public com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getRemainderStreamOrBuilder() { + return getRemainderStream(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (primaryStream_ != null) { + output.writeMessage(1, getPrimaryStream()); + } + if (remainderStream_ != null) { + output.writeMessage(2, getRemainderStream()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (primaryStream_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPrimaryStream()); + } + if (remainderStream_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRemainderStream()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse other = + (com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse) obj; + + if (hasPrimaryStream() != other.hasPrimaryStream()) return false; + if (hasPrimaryStream()) { + if (!getPrimaryStream().equals(other.getPrimaryStream())) return false; + } + if (hasRemainderStream() != other.hasRemainderStream()) return false; + if (hasRemainderStream()) { + if (!getRemainderStream().equals(other.getRemainderStream())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPrimaryStream()) { + hash = (37 * hash) + PRIMARY_STREAM_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryStream().hashCode(); + } + if (hasRemainderStream()) { + hash = (37 * hash) + REMAINDER_STREAM_FIELD_NUMBER; + hash = (53 * hash) + getRemainderStream().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for `SplitReadStream`.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.SplitReadStreamResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.SplitReadStreamResponse) + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.class, + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (primaryStreamBuilder_ == null) { + primaryStream_ = null; + } else { + primaryStream_ = null; + primaryStreamBuilder_ = null; + } + if (remainderStreamBuilder_ == null) { + remainderStream_ = null; + } else { + remainderStream_ = null; + remainderStreamBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse build() { + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse buildPartial() { + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse result = + new com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse(this); + if (primaryStreamBuilder_ == null) { + result.primaryStream_ = primaryStream_; + } else { + result.primaryStream_ = primaryStreamBuilder_.build(); + } + if (remainderStreamBuilder_ == null) { + result.remainderStream_ = remainderStream_; + } else { + result.remainderStream_ = remainderStreamBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse other) { + if (other + == com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse.getDefaultInstance()) + return this; + if (other.hasPrimaryStream()) { + mergePrimaryStream(other.getPrimaryStream()); + } + if (other.hasRemainderStream()) { + mergeRemainderStream(other.getRemainderStream()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.bigquery.storage.v1.ReadStream primaryStream_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder> + primaryStreamBuilder_; + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * + * @return Whether the primaryStream field is set. + */ + public boolean hasPrimaryStream() { + return primaryStreamBuilder_ != null || primaryStream_ != null; + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * + * @return The primaryStream. + */ + public com.google.cloud.bigquery.storage.v1.ReadStream getPrimaryStream() { + if (primaryStreamBuilder_ == null) { + return primaryStream_ == null + ? com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance() + : primaryStream_; + } else { + return primaryStreamBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + public Builder setPrimaryStream(com.google.cloud.bigquery.storage.v1.ReadStream value) { + if (primaryStreamBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + primaryStream_ = value; + onChanged(); + } else { + primaryStreamBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + public Builder setPrimaryStream( + com.google.cloud.bigquery.storage.v1.ReadStream.Builder builderForValue) { + if (primaryStreamBuilder_ == null) { + primaryStream_ = builderForValue.build(); + onChanged(); + } else { + primaryStreamBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + public Builder mergePrimaryStream(com.google.cloud.bigquery.storage.v1.ReadStream value) { + if (primaryStreamBuilder_ == null) { + if (primaryStream_ != null) { + primaryStream_ = + com.google.cloud.bigquery.storage.v1.ReadStream.newBuilder(primaryStream_) + .mergeFrom(value) + .buildPartial(); + } else { + primaryStream_ = value; + } + onChanged(); + } else { + primaryStreamBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + public Builder clearPrimaryStream() { + if (primaryStreamBuilder_ == null) { + primaryStream_ = null; + onChanged(); + } else { + primaryStream_ = null; + primaryStreamBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + public com.google.cloud.bigquery.storage.v1.ReadStream.Builder getPrimaryStreamBuilder() { + + onChanged(); + return getPrimaryStreamFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + public com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getPrimaryStreamOrBuilder() { + if (primaryStreamBuilder_ != null) { + return primaryStreamBuilder_.getMessageOrBuilder(); + } else { + return primaryStream_ == null + ? com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance() + : primaryStream_; + } + } + /** + * + * + *
+     * Primary stream, which contains the beginning portion of
+     * |original_stream|. An empty value indicates that the original stream can no
+     * longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder> + getPrimaryStreamFieldBuilder() { + if (primaryStreamBuilder_ == null) { + primaryStreamBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder>( + getPrimaryStream(), getParentForChildren(), isClean()); + primaryStream_ = null; + } + return primaryStreamBuilder_; + } + + private com.google.cloud.bigquery.storage.v1.ReadStream remainderStream_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder> + remainderStreamBuilder_; + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * + * @return Whether the remainderStream field is set. + */ + public boolean hasRemainderStream() { + return remainderStreamBuilder_ != null || remainderStream_ != null; + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * + * @return The remainderStream. + */ + public com.google.cloud.bigquery.storage.v1.ReadStream getRemainderStream() { + if (remainderStreamBuilder_ == null) { + return remainderStream_ == null + ? com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance() + : remainderStream_; + } else { + return remainderStreamBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + public Builder setRemainderStream(com.google.cloud.bigquery.storage.v1.ReadStream value) { + if (remainderStreamBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + remainderStream_ = value; + onChanged(); + } else { + remainderStreamBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + public Builder setRemainderStream( + com.google.cloud.bigquery.storage.v1.ReadStream.Builder builderForValue) { + if (remainderStreamBuilder_ == null) { + remainderStream_ = builderForValue.build(); + onChanged(); + } else { + remainderStreamBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + public Builder mergeRemainderStream(com.google.cloud.bigquery.storage.v1.ReadStream value) { + if (remainderStreamBuilder_ == null) { + if (remainderStream_ != null) { + remainderStream_ = + com.google.cloud.bigquery.storage.v1.ReadStream.newBuilder(remainderStream_) + .mergeFrom(value) + .buildPartial(); + } else { + remainderStream_ = value; + } + onChanged(); + } else { + remainderStreamBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + public Builder clearRemainderStream() { + if (remainderStreamBuilder_ == null) { + remainderStream_ = null; + onChanged(); + } else { + remainderStream_ = null; + remainderStreamBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + public com.google.cloud.bigquery.storage.v1.ReadStream.Builder getRemainderStreamBuilder() { + + onChanged(); + return getRemainderStreamFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + public com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getRemainderStreamOrBuilder() { + if (remainderStreamBuilder_ != null) { + return remainderStreamBuilder_.getMessageOrBuilder(); + } else { + return remainderStream_ == null + ? com.google.cloud.bigquery.storage.v1.ReadStream.getDefaultInstance() + : remainderStream_; + } + } + /** + * + * + *
+     * Remainder stream, which contains the tail of |original_stream|. An empty
+     * value indicates that the original stream can no longer be split.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder> + getRemainderStreamFieldBuilder() { + if (remainderStreamBuilder_ == null) { + remainderStreamBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.ReadStream, + com.google.cloud.bigquery.storage.v1.ReadStream.Builder, + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder>( + getRemainderStream(), getParentForChildren(), isClean()); + remainderStream_ = null; + } + return remainderStreamBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.SplitReadStreamResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.SplitReadStreamResponse) + private static final com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse(); + } + + public static com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SplitReadStreamResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SplitReadStreamResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.SplitReadStreamResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponseOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponseOrBuilder.java new file mode 100644 index 0000000000..282ad5342c --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/SplitReadStreamResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface SplitReadStreamResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.SplitReadStreamResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Primary stream, which contains the beginning portion of
+   * |original_stream|. An empty value indicates that the original stream can no
+   * longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * + * @return Whether the primaryStream field is set. + */ + boolean hasPrimaryStream(); + /** + * + * + *
+   * Primary stream, which contains the beginning portion of
+   * |original_stream|. An empty value indicates that the original stream can no
+   * longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + * + * @return The primaryStream. + */ + com.google.cloud.bigquery.storage.v1.ReadStream getPrimaryStream(); + /** + * + * + *
+   * Primary stream, which contains the beginning portion of
+   * |original_stream|. An empty value indicates that the original stream can no
+   * longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream primary_stream = 1; + */ + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getPrimaryStreamOrBuilder(); + + /** + * + * + *
+   * Remainder stream, which contains the tail of |original_stream|. An empty
+   * value indicates that the original stream can no longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * + * @return Whether the remainderStream field is set. + */ + boolean hasRemainderStream(); + /** + * + * + *
+   * Remainder stream, which contains the tail of |original_stream|. An empty
+   * value indicates that the original stream can no longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + * + * @return The remainderStream. + */ + com.google.cloud.bigquery.storage.v1.ReadStream getRemainderStream(); + /** + * + * + *
+   * Remainder stream, which contains the tail of |original_stream|. An empty
+   * value indicates that the original stream can no longer be split.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.ReadStream remainder_stream = 2; + */ + com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getRemainderStreamOrBuilder(); +} 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 new file mode 100644 index 0000000000..48e0ce1b8d --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java @@ -0,0 +1,231 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public final class StorageProto { + private StorageProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ThrottleState_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ThrottleState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_StreamStats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_StreamStats_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/cloud/bigquery/storage/v1/stora" + + "ge.proto\022 google.cloud.bigquery.storage." + + "v1\032\034google/api/annotations.proto\032\027google" + + "/api/client.proto\032\037google/api/field_beha" + + "vior.proto\032\031google/api/resource.proto\032,g" + + "oogle/cloud/bigquery/storage/v1/arrow.pr" + + "oto\032+google/cloud/bigquery/storage/v1/av" + + "ro.proto\032-google/cloud/bigquery/storage/" + + "v1/stream.proto\"\303\001\n\030CreateReadSessionReq" + + "uest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudresou" + + "rcemanager.googleapis.com/Project\022H\n\014rea" + + "d_session\030\002 \001(\0132-.google.cloud.bigquery." + + "storage.v1.ReadSessionB\003\340A\002\022\030\n\020max_strea" + + "m_count\030\003 \001(\005\"i\n\017ReadRowsRequest\022F\n\013read" + + "_stream\030\001 \001(\tB1\340A\002\372A+\n)bigquerystorage.g" + + "oogleapis.com/ReadStream\022\016\n\006offset\030\002 \001(\003" + + "\")\n\rThrottleState\022\030\n\020throttle_percent\030\001 " + + "\001(\005\"\227\001\n\013StreamStats\022H\n\010progress\030\002 \001(\01326." + + "google.cloud.bigquery.storage.v1.StreamS" + + "tats.Progress\032>\n\010Progress\022\031\n\021at_response" + + "_start\030\001 \001(\001\022\027\n\017at_response_end\030\002 \001(\001\"\307\002" + + "\n\020ReadRowsResponse\022?\n\tavro_rows\030\003 \001(\0132*." + + "google.cloud.bigquery.storage.v1.AvroRow" + + "sH\000\022P\n\022arrow_record_batch\030\004 \001(\01322.google" + + ".cloud.bigquery.storage.v1.ArrowRecordBa" + + "tchH\000\022\021\n\trow_count\030\006 \001(\003\022<\n\005stats\030\002 \001(\0132" + + "-.google.cloud.bigquery.storage.v1.Strea" + + "mStats\022G\n\016throttle_state\030\005 \001(\0132/.google." + + "cloud.bigquery.storage.v1.ThrottleStateB" + + "\006\n\004rows\"k\n\026SplitReadStreamRequest\022?\n\004nam" + + "e\030\001 \001(\tB1\340A\002\372A+\n)bigquerystorage.googlea" + + "pis.com/ReadStream\022\020\n\010fraction\030\002 \001(\001\"\247\001\n" + + "\027SplitReadStreamResponse\022D\n\016primary_stre" + + "am\030\001 \001(\0132,.google.cloud.bigquery.storage" + + ".v1.ReadStream\022F\n\020remainder_stream\030\002 \001(\013" + + "2,.google.cloud.bigquery.storage.v1.Read" + + "Stream2\306\006\n\014BigQueryRead\022\351\001\n\021CreateReadSe" + + "ssion\022:.google.cloud.bigquery.storage.v1" + + ".CreateReadSessionRequest\032-.google.cloud" + + ".bigquery.storage.v1.ReadSession\"i\202\323\344\223\002<" + + "\"7/v1/{read_session.table=projects/*/dat" + + "asets/*/tables/*}:\001*\332A$parent,read_sessi" + + "on,max_stream_count\022\317\001\n\010ReadRows\0221.googl" + + "e.cloud.bigquery.storage.v1.ReadRowsRequ" + + "est\0322.google.cloud.bigquery.storage.v1.R" + + "eadRowsResponse\"Z\202\323\344\223\002?\022=/v1/{read_strea" + + "m=projects/*/locations/*/sessions/*/stre" + + "ams/*}\332A\022read_stream,offset0\001\022\306\001\n\017SplitR" + + "eadStream\0228.google.cloud.bigquery.storag" + + "e.v1.SplitReadStreamRequest\0329.google.clo" + + "ud.bigquery.storage.v1.SplitReadStreamRe" + + "sponse\">\202\323\344\223\0028\0226/v1/{name=projects/*/loc" + + "ations/*/sessions/*/streams/*}\032\256\001\312A\036bigq" + + "uerystorage.googleapis.com\322A\211\001https://ww" + + "w.googleapis.com/auth/bigquery,https://w" + + "ww.googleapis.com/auth/bigquery.readonly" + + ",https://www.googleapis.com/auth/cloud-p" + + "latformB\177\n$com.google.cloud.bigquery.sto" + + "rage.v1B\014StorageProtoP\001ZGgoogle.golang.o" + + "rg/genproto/googleapis/cloud/bigquery/st" + + "orage/v1;storageb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.bigquery.storage.v1.ArrowProto.getDescriptor(), + com.google.cloud.bigquery.storage.v1.AvroProto.getDescriptor(), + com.google.cloud.bigquery.storage.v1.StreamProto.getDescriptor(), + }); + internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_CreateReadSessionRequest_descriptor, + new java.lang.String[] { + "Parent", "ReadSession", "MaxStreamCount", + }); + internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ReadRowsRequest_descriptor, + new java.lang.String[] { + "ReadStream", "Offset", + }); + internal_static_google_cloud_bigquery_storage_v1_ThrottleState_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_bigquery_storage_v1_ThrottleState_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ThrottleState_descriptor, + new java.lang.String[] { + "ThrottlePercent", + }); + internal_static_google_cloud_bigquery_storage_v1_StreamStats_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_bigquery_storage_v1_StreamStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_StreamStats_descriptor, + new java.lang.String[] { + "Progress", + }); + internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_descriptor = + internal_static_google_cloud_bigquery_storage_v1_StreamStats_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_descriptor, + new java.lang.String[] { + "AtResponseStart", "AtResponseEnd", + }); + internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ReadRowsResponse_descriptor, + new java.lang.String[] { + "AvroRows", "ArrowRecordBatch", "RowCount", "Stats", "ThrottleState", "Rows", + }); + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamRequest_descriptor, + new java.lang.String[] { + "Name", "Fraction", + }); + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_SplitReadStreamResponse_descriptor, + new java.lang.String[] { + "PrimaryStream", "RemainderStream", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.bigquery.storage.v1.ArrowProto.getDescriptor(); + com.google.cloud.bigquery.storage.v1.AvroProto.getDescriptor(); + com.google.cloud.bigquery.storage.v1.StreamProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 0000000000..323fb785b6 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java @@ -0,0 +1,164 @@ +/* + * 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; + +public final class StreamProto { + private StreamProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ReadSession_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_ReadStream_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_ReadStream_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/bigquery/storage/v1/strea" + + "m.proto\022 google.cloud.bigquery.storage.v" + + "1\032\037google/api/field_behavior.proto\032\031goog" + + "le/api/resource.proto\032,google/cloud/bigq" + + "uery/storage/v1/arrow.proto\032+google/clou" + + "d/bigquery/storage/v1/avro.proto\032\037google" + + "/protobuf/timestamp.proto\"\347\006\n\013ReadSessio" + + "n\022\021\n\004name\030\001 \001(\tB\003\340A\003\0224\n\013expire_time\030\002 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\022F\n\013da" + + "ta_format\030\003 \001(\0162,.google.cloud.bigquery." + + "storage.v1.DataFormatB\003\340A\005\022H\n\013avro_schem" + + "a\030\004 \001(\0132,.google.cloud.bigquery.storage." + + "v1.AvroSchemaB\003\340A\003H\000\022J\n\014arrow_schema\030\005 \001" + + "(\0132-.google.cloud.bigquery.storage.v1.Ar" + + "rowSchemaB\003\340A\003H\000\0224\n\005table\030\006 \001(\tB%\340A\005\372A\037\n" + + "\035bigquery.googleapis.com/Table\022Z\n\017table_" + + "modifiers\030\007 \001(\0132<.google.cloud.bigquery." + + "storage.v1.ReadSession.TableModifiersB\003\340" + + "A\001\022Y\n\014read_options\030\010 \001(\0132>.google.cloud." + + "bigquery.storage.v1.ReadSession.TableRea" + + "dOptionsB\003\340A\001\022B\n\007streams\030\n \003(\0132,.google." + + "cloud.bigquery.storage.v1.ReadStreamB\003\340A" + + "\003\032C\n\016TableModifiers\0221\n\rsnapshot_time\030\001 \001" + + "(\0132\032.google.protobuf.Timestamp\032D\n\020TableR" + + "eadOptions\022\027\n\017selected_fields\030\001 \003(\t\022\027\n\017r" + + "ow_restriction\030\002 \001(\t:k\352Ah\n*bigquerystora" + + "ge.googleapis.com/ReadSession\022:projects/" + + "{project}/locations/{location}/sessions/" + + "{session}B\010\n\006schema\"\234\001\n\nReadStream\022\021\n\004na" + + "me\030\001 \001(\tB\003\340A\003:{\352Ax\n)bigquerystorage.goog" + + "leapis.com/ReadStream\022Kprojects/{project" + + "}/locations/{location}/sessions/{session" + + "}/streams/{stream}*>\n\nDataFormat\022\033\n\027DATA" + + "_FORMAT_UNSPECIFIED\020\000\022\010\n\004AVRO\020\001\022\t\n\005ARROW" + + "\020\002B~\n$com.google.cloud.bigquery.storage." + + "v1B\013StreamProtoP\001ZGgoogle.golang.org/gen" + + "proto/googleapis/cloud/bigquery/storage/" + + "v1;storageb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.bigquery.storage.v1.ArrowProto.getDescriptor(), + com.google.cloud.bigquery.storage.v1.AvroProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_storage_v1_ReadSession_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor, + new java.lang.String[] { + "Name", + "ExpireTime", + "DataFormat", + "AvroSchema", + "ArrowSchema", + "Table", + "TableModifiers", + "ReadOptions", + "Streams", + "Schema", + }); + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_descriptor = + internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_descriptor, + new java.lang.String[] { + "SnapshotTime", + }); + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_descriptor = + internal_static_google_cloud_bigquery_storage_v1_ReadSession_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableReadOptions_descriptor, + new java.lang.String[] { + "SelectedFields", "RowRestriction", + }); + internal_static_google_cloud_bigquery_storage_v1_ReadStream_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_storage_v1_ReadStream_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_ReadStream_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.bigquery.storage.v1.ArrowProto.getDescriptor(); + com.google.cloud.bigquery.storage.v1.AvroProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStats.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStats.java new file mode 100644 index 0000000000..5710d42b3a --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStats.java @@ -0,0 +1,1424 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Estimated stream statistics for a given Stream.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.StreamStats} + */ +public final class StreamStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.StreamStats) + StreamStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamStats.newBuilder() to construct. + private StreamStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamStats(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamStats( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder subBuilder = null; + if (progress_ != null) { + subBuilder = progress_.toBuilder(); + } + progress_ = + input.readMessage( + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progress_); + progress_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.StreamStats.class, + com.google.cloud.bigquery.storage.v1.StreamStats.Builder.class); + } + + public interface ProgressOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.StreamStats.Progress) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The fraction of rows assigned to the stream that have been processed by
+     * the server so far, not including the rows in the current response
+     * message.
+     * This value, along with `at_response_end`, can be used to interpolate
+     * the progress made as the rows in the message are being processed using
+     * the following formula: `at_response_start + (at_response_end -
+     * at_response_start) * rows_processed_from_response / rows_in_response`.
+     * Note that if a filter is provided, the `at_response_end` value of the
+     * previous response may not necessarily be equal to the
+     * `at_response_start` value of the current response.
+     * 
+ * + * double at_response_start = 1; + * + * @return The atResponseStart. + */ + double getAtResponseStart(); + + /** + * + * + *
+     * Similar to `at_response_start`, except that this value includes the
+     * rows in the current response.
+     * 
+ * + * double at_response_end = 2; + * + * @return The atResponseEnd. + */ + double getAtResponseEnd(); + } + /** Protobuf type {@code google.cloud.bigquery.storage.v1.StreamStats.Progress} */ + public static final class Progress extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.StreamStats.Progress) + ProgressOrBuilder { + private static final long serialVersionUID = 0L; + // Use Progress.newBuilder() to construct. + private Progress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Progress() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Progress(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Progress( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + atResponseStart_ = input.readDouble(); + break; + } + case 17: + { + atResponseEnd_ = input.readDouble(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.class, + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder.class); + } + + public static final int AT_RESPONSE_START_FIELD_NUMBER = 1; + private double atResponseStart_; + /** + * + * + *
+     * The fraction of rows assigned to the stream that have been processed by
+     * the server so far, not including the rows in the current response
+     * message.
+     * This value, along with `at_response_end`, can be used to interpolate
+     * the progress made as the rows in the message are being processed using
+     * the following formula: `at_response_start + (at_response_end -
+     * at_response_start) * rows_processed_from_response / rows_in_response`.
+     * Note that if a filter is provided, the `at_response_end` value of the
+     * previous response may not necessarily be equal to the
+     * `at_response_start` value of the current response.
+     * 
+ * + * double at_response_start = 1; + * + * @return The atResponseStart. + */ + public double getAtResponseStart() { + return atResponseStart_; + } + + public static final int AT_RESPONSE_END_FIELD_NUMBER = 2; + private double atResponseEnd_; + /** + * + * + *
+     * Similar to `at_response_start`, except that this value includes the
+     * rows in the current response.
+     * 
+ * + * double at_response_end = 2; + * + * @return The atResponseEnd. + */ + public double getAtResponseEnd() { + return atResponseEnd_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (atResponseStart_ != 0D) { + output.writeDouble(1, atResponseStart_); + } + if (atResponseEnd_ != 0D) { + output.writeDouble(2, atResponseEnd_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (atResponseStart_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, atResponseStart_); + } + if (atResponseEnd_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, atResponseEnd_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.StreamStats.Progress)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.StreamStats.Progress other = + (com.google.cloud.bigquery.storage.v1.StreamStats.Progress) obj; + + if (java.lang.Double.doubleToLongBits(getAtResponseStart()) + != java.lang.Double.doubleToLongBits(other.getAtResponseStart())) return false; + if (java.lang.Double.doubleToLongBits(getAtResponseEnd()) + != java.lang.Double.doubleToLongBits(other.getAtResponseEnd())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AT_RESPONSE_START_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getAtResponseStart())); + hash = (37 * hash) + AT_RESPONSE_END_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getAtResponseEnd())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.storage.v1.StreamStats.Progress prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.bigquery.storage.v1.StreamStats.Progress} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.StreamStats.Progress) + com.google.cloud.bigquery.storage.v1.StreamStats.ProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.class, + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.StreamStats.Progress.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + atResponseStart_ = 0D; + + atResponseEnd_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_Progress_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats.Progress getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.StreamStats.Progress.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats.Progress build() { + com.google.cloud.bigquery.storage.v1.StreamStats.Progress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats.Progress buildPartial() { + com.google.cloud.bigquery.storage.v1.StreamStats.Progress result = + new com.google.cloud.bigquery.storage.v1.StreamStats.Progress(this); + result.atResponseStart_ = atResponseStart_; + result.atResponseEnd_ = atResponseEnd_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.StreamStats.Progress) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.StreamStats.Progress) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.StreamStats.Progress other) { + if (other == com.google.cloud.bigquery.storage.v1.StreamStats.Progress.getDefaultInstance()) + return this; + if (other.getAtResponseStart() != 0D) { + setAtResponseStart(other.getAtResponseStart()); + } + if (other.getAtResponseEnd() != 0D) { + setAtResponseEnd(other.getAtResponseEnd()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.StreamStats.Progress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.StreamStats.Progress) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private double atResponseStart_; + /** + * + * + *
+       * The fraction of rows assigned to the stream that have been processed by
+       * the server so far, not including the rows in the current response
+       * message.
+       * This value, along with `at_response_end`, can be used to interpolate
+       * the progress made as the rows in the message are being processed using
+       * the following formula: `at_response_start + (at_response_end -
+       * at_response_start) * rows_processed_from_response / rows_in_response`.
+       * Note that if a filter is provided, the `at_response_end` value of the
+       * previous response may not necessarily be equal to the
+       * `at_response_start` value of the current response.
+       * 
+ * + * double at_response_start = 1; + * + * @return The atResponseStart. + */ + public double getAtResponseStart() { + return atResponseStart_; + } + /** + * + * + *
+       * The fraction of rows assigned to the stream that have been processed by
+       * the server so far, not including the rows in the current response
+       * message.
+       * This value, along with `at_response_end`, can be used to interpolate
+       * the progress made as the rows in the message are being processed using
+       * the following formula: `at_response_start + (at_response_end -
+       * at_response_start) * rows_processed_from_response / rows_in_response`.
+       * Note that if a filter is provided, the `at_response_end` value of the
+       * previous response may not necessarily be equal to the
+       * `at_response_start` value of the current response.
+       * 
+ * + * double at_response_start = 1; + * + * @param value The atResponseStart to set. + * @return This builder for chaining. + */ + public Builder setAtResponseStart(double value) { + + atResponseStart_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The fraction of rows assigned to the stream that have been processed by
+       * the server so far, not including the rows in the current response
+       * message.
+       * This value, along with `at_response_end`, can be used to interpolate
+       * the progress made as the rows in the message are being processed using
+       * the following formula: `at_response_start + (at_response_end -
+       * at_response_start) * rows_processed_from_response / rows_in_response`.
+       * Note that if a filter is provided, the `at_response_end` value of the
+       * previous response may not necessarily be equal to the
+       * `at_response_start` value of the current response.
+       * 
+ * + * double at_response_start = 1; + * + * @return This builder for chaining. + */ + public Builder clearAtResponseStart() { + + atResponseStart_ = 0D; + onChanged(); + return this; + } + + private double atResponseEnd_; + /** + * + * + *
+       * Similar to `at_response_start`, except that this value includes the
+       * rows in the current response.
+       * 
+ * + * double at_response_end = 2; + * + * @return The atResponseEnd. + */ + public double getAtResponseEnd() { + return atResponseEnd_; + } + /** + * + * + *
+       * Similar to `at_response_start`, except that this value includes the
+       * rows in the current response.
+       * 
+ * + * double at_response_end = 2; + * + * @param value The atResponseEnd to set. + * @return This builder for chaining. + */ + public Builder setAtResponseEnd(double value) { + + atResponseEnd_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Similar to `at_response_start`, except that this value includes the
+       * rows in the current response.
+       * 
+ * + * double at_response_end = 2; + * + * @return This builder for chaining. + */ + public Builder clearAtResponseEnd() { + + atResponseEnd_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.StreamStats.Progress) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.StreamStats.Progress) + private static final com.google.cloud.bigquery.storage.v1.StreamStats.Progress DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.StreamStats.Progress(); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats.Progress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Progress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Progress(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats.Progress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PROGRESS_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.storage.v1.StreamStats.Progress progress_; + /** + * + * + *
+   * Represents the progress of the current stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progress_ != null; + } + /** + * + * + *
+   * Represents the progress of the current stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * + * @return The progress. + */ + public com.google.cloud.bigquery.storage.v1.StreamStats.Progress getProgress() { + return progress_ == null + ? com.google.cloud.bigquery.storage.v1.StreamStats.Progress.getDefaultInstance() + : progress_; + } + /** + * + * + *
+   * Represents the progress of the current stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + public com.google.cloud.bigquery.storage.v1.StreamStats.ProgressOrBuilder getProgressOrBuilder() { + return getProgress(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (progress_ != null) { + output.writeMessage(2, getProgress()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (progress_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgress()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.StreamStats)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.StreamStats other = + (com.google.cloud.bigquery.storage.v1.StreamStats) obj; + + if (hasProgress() != other.hasProgress()) return false; + if (hasProgress()) { + if (!getProgress().equals(other.getProgress())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProgress()) { + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.StreamStats prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Estimated stream statistics for a given Stream.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.StreamStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.StreamStats) + com.google.cloud.bigquery.storage.v1.StreamStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.StreamStats.class, + com.google.cloud.bigquery.storage.v1.StreamStats.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.StreamStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (progressBuilder_ == null) { + progress_ = null; + } else { + progress_ = null; + progressBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_StreamStats_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.StreamStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats build() { + com.google.cloud.bigquery.storage.v1.StreamStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats buildPartial() { + com.google.cloud.bigquery.storage.v1.StreamStats result = + new com.google.cloud.bigquery.storage.v1.StreamStats(this); + if (progressBuilder_ == null) { + result.progress_ = progress_; + } else { + result.progress_ = progressBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.StreamStats) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.StreamStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.StreamStats other) { + if (other == com.google.cloud.bigquery.storage.v1.StreamStats.getDefaultInstance()) + return this; + if (other.hasProgress()) { + mergeProgress(other.getProgress()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.StreamStats parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.bigquery.storage.v1.StreamStats) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.bigquery.storage.v1.StreamStats.Progress progress_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.StreamStats.Progress, + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder, + com.google.cloud.bigquery.storage.v1.StreamStats.ProgressOrBuilder> + progressBuilder_; + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progressBuilder_ != null || progress_ != null; + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * + * @return The progress. + */ + public com.google.cloud.bigquery.storage.v1.StreamStats.Progress getProgress() { + if (progressBuilder_ == null) { + return progress_ == null + ? com.google.cloud.bigquery.storage.v1.StreamStats.Progress.getDefaultInstance() + : progress_; + } else { + return progressBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + public Builder setProgress(com.google.cloud.bigquery.storage.v1.StreamStats.Progress value) { + if (progressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progress_ = value; + onChanged(); + } else { + progressBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + public Builder setProgress( + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder builderForValue) { + if (progressBuilder_ == null) { + progress_ = builderForValue.build(); + onChanged(); + } else { + progressBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + public Builder mergeProgress(com.google.cloud.bigquery.storage.v1.StreamStats.Progress value) { + if (progressBuilder_ == null) { + if (progress_ != null) { + progress_ = + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.newBuilder(progress_) + .mergeFrom(value) + .buildPartial(); + } else { + progress_ = value; + } + onChanged(); + } else { + progressBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + public Builder clearProgress() { + if (progressBuilder_ == null) { + progress_ = null; + onChanged(); + } else { + progress_ = null; + progressBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + public com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder getProgressBuilder() { + + onChanged(); + return getProgressFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + public com.google.cloud.bigquery.storage.v1.StreamStats.ProgressOrBuilder + getProgressOrBuilder() { + if (progressBuilder_ != null) { + return progressBuilder_.getMessageOrBuilder(); + } else { + return progress_ == null + ? com.google.cloud.bigquery.storage.v1.StreamStats.Progress.getDefaultInstance() + : progress_; + } + } + /** + * + * + *
+     * Represents the progress of the current stream.
+     * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.StreamStats.Progress, + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder, + com.google.cloud.bigquery.storage.v1.StreamStats.ProgressOrBuilder> + getProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.storage.v1.StreamStats.Progress, + com.google.cloud.bigquery.storage.v1.StreamStats.Progress.Builder, + com.google.cloud.bigquery.storage.v1.StreamStats.ProgressOrBuilder>( + getProgress(), getParentForChildren(), isClean()); + progress_ = null; + } + return progressBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.StreamStats) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.StreamStats) + private static final com.google.cloud.bigquery.storage.v1.StreamStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.StreamStats(); + } + + public static com.google.cloud.bigquery.storage.v1.StreamStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamStats(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.StreamStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStatsOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStatsOrBuilder.java new file mode 100644 index 0000000000..aeaa0d4f33 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamStatsOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface StreamStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.StreamStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Represents the progress of the current stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * + * @return Whether the progress field is set. + */ + boolean hasProgress(); + /** + * + * + *
+   * Represents the progress of the current stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + * + * @return The progress. + */ + com.google.cloud.bigquery.storage.v1.StreamStats.Progress getProgress(); + /** + * + * + *
+   * Represents the progress of the current stream.
+   * 
+ * + * .google.cloud.bigquery.storage.v1.StreamStats.Progress progress = 2; + */ + com.google.cloud.bigquery.storage.v1.StreamStats.ProgressOrBuilder getProgressOrBuilder(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleState.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleState.java new file mode 100644 index 0000000000..61d6488e78 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleState.java @@ -0,0 +1,548 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +/** + * + * + *
+ * Information on if the current connection is being throttled.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ThrottleState} + */ +public final class ThrottleState extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1.ThrottleState) + ThrottleStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use ThrottleState.newBuilder() to construct. + private ThrottleState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ThrottleState() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ThrottleState(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ThrottleState( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + throttlePercent_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ThrottleState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ThrottleState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ThrottleState.class, + com.google.cloud.bigquery.storage.v1.ThrottleState.Builder.class); + } + + public static final int THROTTLE_PERCENT_FIELD_NUMBER = 1; + private int throttlePercent_; + /** + * + * + *
+   * How much this connection is being throttled. Zero means no throttling,
+   * 100 means fully throttled.
+   * 
+ * + * int32 throttle_percent = 1; + * + * @return The throttlePercent. + */ + public int getThrottlePercent() { + return throttlePercent_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (throttlePercent_ != 0) { + output.writeInt32(1, throttlePercent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (throttlePercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, throttlePercent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.storage.v1.ThrottleState)) { + return super.equals(obj); + } + com.google.cloud.bigquery.storage.v1.ThrottleState other = + (com.google.cloud.bigquery.storage.v1.ThrottleState) obj; + + if (getThrottlePercent() != other.getThrottlePercent()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + THROTTLE_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getThrottlePercent(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.storage.v1.ThrottleState prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information on if the current connection is being throttled.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.storage.v1.ThrottleState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1.ThrottleState) + com.google.cloud.bigquery.storage.v1.ThrottleStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ThrottleState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ThrottleState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.storage.v1.ThrottleState.class, + com.google.cloud.bigquery.storage.v1.ThrottleState.Builder.class); + } + + // Construct using com.google.cloud.bigquery.storage.v1.ThrottleState.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + throttlePercent_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_ThrottleState_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ThrottleState getDefaultInstanceForType() { + return com.google.cloud.bigquery.storage.v1.ThrottleState.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ThrottleState build() { + com.google.cloud.bigquery.storage.v1.ThrottleState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ThrottleState buildPartial() { + com.google.cloud.bigquery.storage.v1.ThrottleState result = + new com.google.cloud.bigquery.storage.v1.ThrottleState(this); + result.throttlePercent_ = throttlePercent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.storage.v1.ThrottleState) { + return mergeFrom((com.google.cloud.bigquery.storage.v1.ThrottleState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ThrottleState other) { + if (other == com.google.cloud.bigquery.storage.v1.ThrottleState.getDefaultInstance()) + return this; + if (other.getThrottlePercent() != 0) { + setThrottlePercent(other.getThrottlePercent()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.storage.v1.ThrottleState parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.storage.v1.ThrottleState) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int throttlePercent_; + /** + * + * + *
+     * How much this connection is being throttled. Zero means no throttling,
+     * 100 means fully throttled.
+     * 
+ * + * int32 throttle_percent = 1; + * + * @return The throttlePercent. + */ + public int getThrottlePercent() { + return throttlePercent_; + } + /** + * + * + *
+     * How much this connection is being throttled. Zero means no throttling,
+     * 100 means fully throttled.
+     * 
+ * + * int32 throttle_percent = 1; + * + * @param value The throttlePercent to set. + * @return This builder for chaining. + */ + public Builder setThrottlePercent(int value) { + + throttlePercent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How much this connection is being throttled. Zero means no throttling,
+     * 100 means fully throttled.
+     * 
+ * + * int32 throttle_percent = 1; + * + * @return This builder for chaining. + */ + public Builder clearThrottlePercent() { + + throttlePercent_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1.ThrottleState) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1.ThrottleState) + private static final com.google.cloud.bigquery.storage.v1.ThrottleState DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.storage.v1.ThrottleState(); + } + + public static com.google.cloud.bigquery.storage.v1.ThrottleState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ThrottleState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ThrottleState(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.ThrottleState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleStateOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleStateOrBuilder.java new file mode 100644 index 0000000000..2a6497bc37 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ThrottleStateOrBuilder.java @@ -0,0 +1,39 @@ +/* + * 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/storage.proto + +package com.google.cloud.bigquery.storage.v1; + +public interface ThrottleStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.ThrottleState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * How much this connection is being throttled. Zero means no throttling,
+   * 100 means fully throttled.
+   * 
+ * + * int32 throttle_percent = 1; + * + * @return The throttlePercent. + */ + int getThrottlePercent(); +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/arrow.proto b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/arrow.proto new file mode 100644 index 0000000000..2f64cf2a3b --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/arrow.proto @@ -0,0 +1,43 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "ArrowProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; + +// Arrow schema as specified in +// https://arrow.apache.org/docs/python/api/datatypes.html +// and serialized to bytes using IPC: +// https://arrow.apache.org/docs/ipc.html. +// +// See code samples on how this message can be deserialized. +message ArrowSchema { + // IPC serialized Arrow schema. + bytes serialized_schema = 1; +} + +// Arrow RecordBatch. +message ArrowRecordBatch { + // IPC-serialized Arrow RecordBatch. + bytes serialized_record_batch = 1; + + // The count of rows in `serialized_record_batch`. + int64 row_count = 2; +} diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/avro.proto b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/avro.proto new file mode 100644 index 0000000000..ea25e02e6b --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/avro.proto @@ -0,0 +1,39 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "AvroProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; + +// Avro schema. +message AvroSchema { + // Json serialized schema, as described at + // https://avro.apache.org/docs/1.8.1/spec.html. + string schema = 1; +} + +// Avro rows. +message AvroRows { + // Binary serialized rows in a block. + bytes serialized_binary_rows = 1; + + // The count of rows in the returning block. + int64 row_count = 2; +} 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 new file mode 100644 index 0000000000..185412aaba --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto @@ -0,0 +1,230 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/storage/v1/arrow.proto"; +import "google/cloud/bigquery/storage/v1/avro.proto"; +import "google/cloud/bigquery/storage/v1/stream.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "StorageProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; + +// BigQuery Read API. +// +// The Read API can be used to read data from BigQuery. +service BigQueryRead { + option (google.api.default_host) = "bigquerystorage.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/bigquery.readonly," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new read session. A read session divides the contents of a + // BigQuery table into one or more streams, which can then be used to read + // data from the table. The read session also specifies properties of the + // data to be read, such as a list of columns or a push-down filter describing + // the rows to be returned. + // + // A particular row can be read by at most one stream. When the caller has + // reached the end of each stream in the session, then all the data in the + // table has been read. + // + // Data is assigned to each stream such that roughly the same number of + // rows can be read from each stream. Because the server-side unit for + // assigning data is collections of rows, the API does not guarantee that + // each stream will return the same number or rows. Additionally, the + // limits are enforced based on the number of pre-filtered rows, so some + // filters can lead to lopsided assignments. + // + // Read sessions automatically expire 24 hours after they are created and do + // not require manual clean-up by the caller. + rpc CreateReadSession(CreateReadSessionRequest) returns (ReadSession) { + option (google.api.http) = { + post: "/v1/{read_session.table=projects/*/datasets/*/tables/*}" + body: "*" + }; + option (google.api.method_signature) = "parent,read_session,max_stream_count"; + } + + // Reads rows from the stream in the format prescribed by the ReadSession. + // Each response contains one or more table rows, up to a maximum of 100 MiB + // per response; read requests which attempt to read individual rows larger + // than 100 MiB will fail. + // + // Each request also returns a set of stream statistics reflecting the current + // state of the stream. + rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) { + option (google.api.http) = { + get: "/v1/{read_stream=projects/*/locations/*/sessions/*/streams/*}" + }; + option (google.api.method_signature) = "read_stream,offset"; + } + + // Splits a given `ReadStream` into two `ReadStream` objects. These + // `ReadStream` objects are referred to as the primary and the residual + // streams of the split. The original `ReadStream` can still be read from in + // the same manner as before. Both of the returned `ReadStream` objects can + // also be read from, and the rows returned by both child streams will be + // the same as the rows read from the original stream. + // + // Moreover, the two child streams will be allocated back-to-back in the + // original `ReadStream`. Concretely, it is guaranteed that for streams + // original, primary, and residual, that original[0-j] = primary[0-j] and + // original[j-n] = residual[0-m] once the streams have been read to + // completion. + rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sessions/*/streams/*}" + }; + } +} + +// Request message for `CreateReadSession`. +message CreateReadSessionRequest { + // Required. The request project that owns the session, in the form of + // `projects/{project_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Session to be created. + ReadSession read_session = 2 [(google.api.field_behavior) = REQUIRED]; + + // Max initial number of streams. If unset or zero, the server will + // provide a value of streams so as to produce reasonable throughput. Must be + // non-negative. The number of streams may be lower than the requested number, + // depending on the amount parallelism that is reasonable for the table. Error + // will be returned if the max count is greater than the current system + // max limit of 1,000. + // + // Streams must be read starting from offset 0. + int32 max_stream_count = 3; +} + +// Request message for `ReadRows`. +message ReadRowsRequest { + // Required. Stream to read rows from. + string read_stream = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/ReadStream" + } + ]; + + // The offset requested must be less than the last row read from Read. + // Requesting a larger offset is undefined. If not specified, start reading + // from offset zero. + int64 offset = 2; +} + +// Information on if the current connection is being throttled. +message ThrottleState { + // How much this connection is being throttled. Zero means no throttling, + // 100 means fully throttled. + int32 throttle_percent = 1; +} + +// Estimated stream statistics for a given Stream. +message StreamStats { + message Progress { + // The fraction of rows assigned to the stream that have been processed by + // the server so far, not including the rows in the current response + // message. + // + // This value, along with `at_response_end`, can be used to interpolate + // the progress made as the rows in the message are being processed using + // the following formula: `at_response_start + (at_response_end - + // at_response_start) * rows_processed_from_response / rows_in_response`. + // + // Note that if a filter is provided, the `at_response_end` value of the + // previous response may not necessarily be equal to the + // `at_response_start` value of the current response. + double at_response_start = 1; + + // Similar to `at_response_start`, except that this value includes the + // rows in the current response. + double at_response_end = 2; + } + + // Represents the progress of the current stream. + Progress progress = 2; +} + +// Response from calling `ReadRows` may include row data, progress and +// throttling information. +message ReadRowsResponse { + // Row data is returned in format specified during session creation. + oneof rows { + // Serialized row data in AVRO format. + AvroRows avro_rows = 3; + + // Serialized row data in Arrow RecordBatch format. + ArrowRecordBatch arrow_record_batch = 4; + } + + // Number of serialized rows in the rows block. + int64 row_count = 6; + + // Statistics for the stream. + StreamStats stats = 2; + + // Throttling state. If unset, the latest response still describes + // the current throttling status. + ThrottleState throttle_state = 5; +} + +// Request message for `SplitReadStream`. +message SplitReadStreamRequest { + // Required. Name of the stream to split. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/ReadStream" + } + ]; + + // A value in the range (0.0, 1.0) that specifies the fractional point at + // which the original stream should be split. The actual split point is + // evaluated on pre-filtered rows, so if a filter is provided, then there is + // no guarantee that the division of the rows between the new child streams + // will be proportional to this fractional value. Additionally, because the + // server-side unit for assigning data is collections of rows, this fraction + // will always map to a data storage boundary on the server side. + double fraction = 2; +} + +// Response message for `SplitReadStream`. +message SplitReadStreamResponse { + // Primary stream, which contains the beginning portion of + // |original_stream|. An empty value indicates that the original stream can no + // longer be split. + ReadStream primary_stream = 1; + + // Remainder stream, which contains the tail of |original_stream|. An empty + // value indicates that the original stream can no longer be split. + ReadStream remainder_stream = 2; +} 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 new file mode 100644 index 0000000000..7b356b2ad0 --- /dev/null +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto @@ -0,0 +1,136 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/storage/v1/arrow.proto"; +import "google/cloud/bigquery/storage/v1/avro.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "StreamProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; + +// Data format for input or output data. +enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0; + + // Avro is a standard open source row based file format. + // See https://avro.apache.org/ for more details. + AVRO = 1; + + // Arrow is a standard open source column-based message format. + // See https://arrow.apache.org/ for more details. + ARROW = 2; +} + +// Information about the ReadSession. +message ReadSession { + option (google.api.resource) = { + type: "bigquerystorage.googleapis.com/ReadSession" + pattern: "projects/{project}/locations/{location}/sessions/{session}" + }; + + // Additional attributes when reading a table. + message TableModifiers { + // The snapshot time of the table. If not set, interpreted as now. + google.protobuf.Timestamp snapshot_time = 1; + } + + // Options dictating how we read a table. + message TableReadOptions { + // Names of the fields in the table that should be read. If empty, all + // fields will be read. If the specified field is a nested field, all + // the sub-fields in the field will be selected. The output field order is + // unrelated to the order of fields in selected_fields. + repeated string selected_fields = 1; + + // SQL text filtering statement, similar to a WHERE clause in a query. + // Currently, only a single predicate that is a comparison between a column + // and a constant value is supported. Aggregates are not supported. + // + // Examples: "int_field > 5" + // "date_field = CAST('2014-9-27' as DATE)" + // "nullable_field is not NULL" + // "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" + // "numeric_field BETWEEN 1.0 AND 5.0" + string row_restriction = 2; + } + + // Output only. Unique identifier for the session, in the form + // `projects/{project_id}/locations/{location}/sessions/{session_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the session becomes invalid. After this time, subsequent + // requests to read this Session will return errors. The expire_time is + // automatically assigned and currently cannot be specified or updated. + google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Data format of the output data. + DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // The schema for the read. If read_options.selected_fields is set, the + // schema may be different from the table schema as it will only contain + // the selected fields. + oneof schema { + // Output only. Avro schema. + AvroSchema avro_schema = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Arrow schema. + ArrowSchema arrow_schema = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Immutable. Table that this ReadSession is reading from, in the form + // `projects/{project_id}/datasets/{dataset_id}/tables/{table_id} + string table = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "bigquery.googleapis.com/Table" + } + ]; + + // Optional. Any modifiers which are applied when reading from the specified table. + TableModifiers table_modifiers = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Read options for this session (e.g. column selection, filters). + TableReadOptions read_options = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A list of streams created with the session. + // + // At least one stream is created with the session. In the future, larger + // request_stream_count values *may* result in this list being unpopulated, + // in that case, the user will need to use a List method to get the streams + // instead, which is not yet available. + repeated ReadStream streams = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about a single stream that gets data out of the storage system. +// Most of the information about `ReadStream` instances is aggregated, making +// `ReadStream` lightweight. +message ReadStream { + option (google.api.resource) = { + type: "bigquerystorage.googleapis.com/ReadStream" + pattern: "projects/{project}/locations/{location}/sessions/{session}/streams/{stream}" + }; + + // Output only. Name of the stream, in the form + // `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/synth.metadata b/synth.metadata index f1385018d8..d68616923f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-02-05T08:41:56.941775Z", + "updateTime": "2020-02-06T19:14:00.130766Z", "sources": [ { "generator": { @@ -12,32 +12,39 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a8ed9d921fdddc61d8467bfd7c1668f0ad90435c", - "internalRef": "293257997" + "sha": "4cdfe8278cb6f308106580d70648001c9146e759", + "internalRef": "293614782" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a8ed9d921fdddc61d8467bfd7c1668f0ad90435c", - "internalRef": "293257997" + "sha": "4cdfe8278cb6f308106580d70648001c9146e759", + "internalRef": "293614782" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a8ed9d921fdddc61d8467bfd7c1668f0ad90435c", - "internalRef": "293257997", - "log": "a8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\nb5cbe4a4ba64ab19e6627573ff52057a1657773d\nSecurityCenter v1p1beta1: move file-level option on top to workaround protobuf.js bug.\n\nPiperOrigin-RevId: 292647187\n\nb224b317bf20c6a4fbc5030b4a969c3147f27ad3\nAdds API definitions for bigqueryreservation v1beta1.\n\nPiperOrigin-RevId: 292634722\n\nc1468702f9b17e20dd59007c0804a089b83197d2\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 292626173\n\nffdfa4f55ab2f0afc11d0eb68f125ccbd5e404bd\nvision: v1p3beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605599\n\n78f61482cd028fc1d9892aa5d89d768666a954cd\nvision: v1p1beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605125\n\n60bb5a294a604fd1778c7ec87b265d13a7106171\nvision: v1p2beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604980\n\n3bcf7aa79d45eb9ec29ab9036e9359ea325a7fc3\nvision: v1p4beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604656\n\n2717b8a1c762b26911b45ecc2e4ee01d98401b28\nFix dataproc artman client library generation.\n\nPiperOrigin-RevId: 292555664\n\n7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7\nAdd Dataproc Autoscaling API to V1.\n\nPiperOrigin-RevId: 292450564\n\n5d932b2c1be3a6ef487d094e3cf5c0673d0241dd\n- Improve documentation\n- Add a client_id field to StreamingPullRequest\n\nPiperOrigin-RevId: 292434036\n\neaff9fa8edec3e914995ce832b087039c5417ea7\nmonitoring: v3 publish annotations and client retry config\n\nPiperOrigin-RevId: 292425288\n\n70958bab8c5353870d31a23fb2c40305b050d3fe\nBigQuery Storage Read API v1 clients.\n\nPiperOrigin-RevId: 292407644\n\n7a15e7fe78ff4b6d5c9606a3264559e5bde341d1\nUpdate backend proto for Google Cloud Endpoints\n\nPiperOrigin-RevId: 292391607\n\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" + "sha": "4cdfe8278cb6f308106580d70648001c9146e759", + "internalRef": "293614782" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4cdfe8278cb6f308106580d70648001c9146e759", + "internalRef": "293614782" } }, { "template": { "name": "java_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], @@ -68,6 +75,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "bigquery-storage", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index b28fab69de..f26792db18 100644 --- a/synth.py +++ b/synth.py @@ -20,7 +20,7 @@ gapic = gcp.GAPICGenerator() service = 'bigquerystorage' -versions = ['v1beta1', 'v1beta2', 'v1alpha2'] +versions = ['v1beta1', 'v1beta2', 'v1alpha2', 'v1'] for version in versions: java.bazel_library( diff --git a/versions.txt b/versions.txt index f899a65d8f..ca769cace0 100644 --- a/versions.txt +++ b/versions.txt @@ -4,7 +4,9 @@ proto-google-cloud-bigquerystorage-v1alpha2:0.87.0:0.87.1-SNAPSHOT proto-google-cloud-bigquerystorage-v1beta1:0.87.0:0.87.1-SNAPSHOT proto-google-cloud-bigquerystorage-v1beta2:0.87.0:0.87.1-SNAPSHOT +proto-google-cloud-bigquerystorage-v1:0.87.0:0.87.1-SNAPSHOT grpc-google-cloud-bigquerystorage-v1alpha2:0.87.0:0.87.1-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta1:0.87.0:0.87.1-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta2:0.87.0:0.87.1-SNAPSHOT +grpc-google-cloud-bigquerystorage-v1:0.87.0:0.87.1-SNAPSHOT google-cloud-bigquerystorage:0.122.0-beta:0.122.1-beta-SNAPSHOT