Skip to content

Commit 07727ff

Browse files
kmjungchingor13
authored andcommitted
---
yaml --- r: 12031 b: refs/heads/autosynth-datastore c: 5f29ea2 h: refs/heads/master i: 12029: f144d7f 12027: 69cb88d 12023: a288ff4 12015: 5d1db33 11999: f57e3a9 11967: c1c283b 11903: af66ef8 11775: 2f6c203
1 parent 87f998c commit 07727ff

11 files changed

Lines changed: 2142 additions & 1 deletion

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ refs/heads/autosynth-bigquerystorage: 99aee05df348f39d98b6fb23c292006f1d2a6c28
129129
refs/heads/autosynth-bigtable: cd831a28dff2ba4d733608b871a1523a463e7380
130130
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
131131
refs/heads/autosynth-containeranalysis: 781fdb430a60f9a6491f116e31e4e10118157bdb
132-
refs/heads/autosynth-datastore: 25016131f77f3038df3ca754fc784412bd1c162f
132+
refs/heads/autosynth-datastore: 5f29ea236c301f33e4d40bd0acb1718e03b54ba9
133133
refs/heads/autosynth-dialogflow: c6bde02c8a8e063a32f9eaf63b2b9fe5e4895d8a
134134
refs/heads/autosynth-errorreporting: 518a442405c822492ed1c139e89e3e3d1804e29c
135135
refs/heads/autosynth-firestore: 450623a0568a156847a97f05d0ea5aeeeeaca698

branches/autosynth-datastore/google-cloud-clients/google-cloud-bigquerystorage/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@
5757
<version>4.12</version>
5858
<scope>test</scope>
5959
</dependency>
60+
<dependency>
61+
<groupId>org.mockito</groupId>
62+
<artifactId>mockito-all</artifactId>
63+
<scope>test</scope>
64+
</dependency>
65+
<dependency>
66+
<groupId>com.google.truth</groupId>
67+
<artifactId>truth</artifactId>
68+
<scope>test</scope>
69+
</dependency>
70+
<dependency>
71+
<groupId>io.grpc</groupId>
72+
<artifactId>grpc-testing</artifactId>
73+
<scope>test</scope>
74+
</dependency>
6075
<dependency>
6176
<groupId>com.google.api</groupId>
6277
<artifactId>gax</artifactId>

branches/autosynth-datastore/google-cloud-clients/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BigQueryStorageClient.java

Lines changed: 613 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
/*
2+
* Copyright 2018 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.cloud.bigquery.storage.v1beta1;
17+
18+
import com.google.api.core.ApiFunction;
19+
import com.google.api.core.BetaApi;
20+
import com.google.api.gax.core.GoogleCredentialsProvider;
21+
import com.google.api.gax.core.InstantiatingExecutorProvider;
22+
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
23+
import com.google.api.gax.rpc.ApiClientHeaderProvider;
24+
import com.google.api.gax.rpc.ClientContext;
25+
import com.google.api.gax.rpc.ClientSettings;
26+
import com.google.api.gax.rpc.ServerStreamingCallSettings;
27+
import com.google.api.gax.rpc.TransportChannelProvider;
28+
import com.google.api.gax.rpc.UnaryCallSettings;
29+
import com.google.cloud.bigquery.storage.v1beta1.Storage.BatchCreateReadSessionStreamsRequest;
30+
import com.google.cloud.bigquery.storage.v1beta1.Storage.BatchCreateReadSessionStreamsResponse;
31+
import com.google.cloud.bigquery.storage.v1beta1.Storage.CreateReadSessionRequest;
32+
import com.google.cloud.bigquery.storage.v1beta1.Storage.FinalizeStreamRequest;
33+
import com.google.cloud.bigquery.storage.v1beta1.Storage.ReadRowsRequest;
34+
import com.google.cloud.bigquery.storage.v1beta1.Storage.ReadRowsResponse;
35+
import com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession;
36+
import com.google.cloud.bigquery.storage.v1beta1.Storage.SplitReadStreamRequest;
37+
import com.google.cloud.bigquery.storage.v1beta1.Storage.SplitReadStreamResponse;
38+
import com.google.cloud.bigquery.storage.v1beta1.stub.EnhancedBigQueryStorageStubSettings;
39+
import com.google.protobuf.Empty;
40+
import java.io.IOException;
41+
import java.util.List;
42+
43+
/**
44+
* Settings class to configure an instance of {@link BigQueryStorageClient}.
45+
*
46+
* <p>The default instance has everything set to sensible defaults:
47+
*
48+
* <ul>
49+
* <li>The default service address (bigquerystorage.googleapis.com) and default port (443) are
50+
* used.
51+
* <li>Credentials are acquired automatically through Application Default Credentials.
52+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
53+
* </ul>
54+
*
55+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
56+
* build() is called, the tree of builders is called to create the complete settings object. For
57+
* example, to set the total timeout of createReadSession to 30 seconds:
58+
*
59+
* <pre>
60+
* <code>
61+
* BigQueryStorageSettings.Builder settingsBuilder = BaseBigQueryStorageSettings.newBuilder();
62+
* settingsBuilder.createReadSessionSettings().getRetrySettings().toBuilder()
63+
* .setTotalTimeout(Duration.ofSeconds(30));
64+
* BaseBigQueryStorageSettings settings = settingsBuilder.build();
65+
* </code>
66+
* </pre>
67+
*/
68+
@BetaApi
69+
public class BigQueryStorageSettings extends ClientSettings<BigQueryStorageSettings> {
70+
71+
/** Returns the object with the settings used for calls to createReadSession. */
72+
public UnaryCallSettings<CreateReadSessionRequest, ReadSession> createReadSessionSettings() {
73+
return getTypedStubSettings().createReadSessionSettings();
74+
}
75+
76+
/** Returns the object with the settings used for calls to readRows. */
77+
public ServerStreamingCallSettings<ReadRowsRequest, ReadRowsResponse> readRowsSettings() {
78+
return getTypedStubSettings().readRowsSettings();
79+
}
80+
81+
/** Returns the object with the settings used for calls to batchCreateReadSessionStreams. */
82+
public UnaryCallSettings<
83+
BatchCreateReadSessionStreamsRequest, BatchCreateReadSessionStreamsResponse>
84+
batchCreateReadSessionStreamsSettings() {
85+
return getTypedStubSettings().batchCreateReadSessionStreamsSettings();
86+
}
87+
88+
/** Returns the object with the settings used for calls to finalizeStream. */
89+
public UnaryCallSettings<FinalizeStreamRequest, Empty> finalizeStreamSettings() {
90+
return getTypedStubSettings().finalizeStreamSettings();
91+
}
92+
93+
/** Returns the object with the settings used for calls to splitReadStream. */
94+
public UnaryCallSettings<SplitReadStreamRequest, SplitReadStreamResponse>
95+
splitReadStreamSettings() {
96+
return getTypedStubSettings().splitReadStreamSettings();
97+
}
98+
99+
EnhancedBigQueryStorageStubSettings getTypedStubSettings() {
100+
return (EnhancedBigQueryStorageStubSettings) getStubSettings();
101+
}
102+
103+
public static final BigQueryStorageSettings create(EnhancedBigQueryStorageStubSettings settings)
104+
throws IOException {
105+
return new BigQueryStorageSettings.Builder(settings.toBuilder()).build();
106+
}
107+
108+
/** Returns a builder for the default ExecutorProvider for this service. */
109+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
110+
return EnhancedBigQueryStorageStubSettings.defaultExecutorProviderBuilder();
111+
}
112+
113+
/** Returns the default service endpoint. */
114+
public static String getDefaultEndpoint() {
115+
return EnhancedBigQueryStorageStubSettings.getDefaultEndpoint();
116+
}
117+
118+
/** Returns the default service scopes. */
119+
public static List<String> getDefaultServiceScopes() {
120+
return EnhancedBigQueryStorageStubSettings.getDefaultServiceScopes();
121+
}
122+
123+
/** Returns a builder for the default credentials for this service. */
124+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
125+
return EnhancedBigQueryStorageStubSettings.defaultCredentialsProviderBuilder();
126+
}
127+
128+
/** Returns a builder for the default ChannelProvider for this service. */
129+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
130+
return EnhancedBigQueryStorageStubSettings.defaultGrpcTransportProviderBuilder();
131+
}
132+
133+
public static TransportChannelProvider defaultTransportChannelProvider() {
134+
return EnhancedBigQueryStorageStubSettings.defaultTransportChannelProvider();
135+
}
136+
137+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
138+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
139+
return EnhancedBigQueryStorageStubSettings.defaultApiClientHeaderProviderBuilder();
140+
}
141+
142+
/** Returns a new builder for this class. */
143+
public static Builder newBuilder() {
144+
return Builder.createDefault();
145+
}
146+
147+
/** Returns a new builder for this class. */
148+
public static Builder newBuilder(ClientContext clientContext) {
149+
return new Builder(clientContext);
150+
}
151+
152+
/** Returns a builder containing all the values of this settings class. */
153+
public Builder toBuilder() {
154+
return new Builder(this);
155+
}
156+
157+
protected BigQueryStorageSettings(Builder settingsBuilder) throws IOException {
158+
super(settingsBuilder);
159+
}
160+
161+
/** Builder for BigQueryStorageSettings. */
162+
public static class Builder extends ClientSettings.Builder<BigQueryStorageSettings, Builder> {
163+
protected Builder() throws IOException {
164+
this((ClientContext) null);
165+
}
166+
167+
protected Builder(ClientContext clientContext) {
168+
super(EnhancedBigQueryStorageStubSettings.newBuilder(clientContext));
169+
}
170+
171+
private static Builder createDefault() {
172+
return new Builder(EnhancedBigQueryStorageStubSettings.newBuilder());
173+
}
174+
175+
protected Builder(BigQueryStorageSettings settings) {
176+
super(settings.getStubSettings().toBuilder());
177+
}
178+
179+
protected Builder(EnhancedBigQueryStorageStubSettings.Builder stubSettings) {
180+
super(stubSettings);
181+
}
182+
183+
public EnhancedBigQueryStorageStubSettings.Builder getStubSettingsBuilder() {
184+
return ((EnhancedBigQueryStorageStubSettings.Builder) getStubSettings());
185+
}
186+
187+
// NEXT_MAJOR_VER: remove 'throws Exception'
188+
/**
189+
* Applies the given settings updater function to all of the unary API methods in this service.
190+
*
191+
* <p>Note: This method does not support applying settings to streaming methods.
192+
*/
193+
public Builder applyToAllUnaryMethods(
194+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
195+
super.applyToAllUnaryMethods(
196+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
197+
return this;
198+
}
199+
200+
/** Returns the builder for the settings used for calls to createReadSession. */
201+
public UnaryCallSettings.Builder<CreateReadSessionRequest, ReadSession>
202+
createReadSessionSettings() {
203+
return getStubSettingsBuilder().createReadSessionSettings();
204+
}
205+
206+
/** Returns the builder for the settings used for calls to readRows. */
207+
public ServerStreamingCallSettings.Builder<ReadRowsRequest, ReadRowsResponse>
208+
readRowsSettings() {
209+
return getStubSettingsBuilder().readRowsSettings();
210+
}
211+
212+
/** Returns the builder for the settings used for calls to batchCreateReadSessionStreams. */
213+
public UnaryCallSettings.Builder<
214+
BatchCreateReadSessionStreamsRequest, BatchCreateReadSessionStreamsResponse>
215+
batchCreateReadSessionStreamsSettings() {
216+
return getStubSettingsBuilder().batchCreateReadSessionStreamsSettings();
217+
}
218+
219+
/** Returns the builder for the settings used for calls to finalizeStream. */
220+
public UnaryCallSettings.Builder<FinalizeStreamRequest, Empty> finalizeStreamSettings() {
221+
return getStubSettingsBuilder().finalizeStreamSettings();
222+
}
223+
224+
/** Returns the builder for the settings used for calls to splitReadStream. */
225+
public UnaryCallSettings.Builder<SplitReadStreamRequest, SplitReadStreamResponse>
226+
splitReadStreamSettings() {
227+
return getStubSettingsBuilder().splitReadStreamSettings();
228+
}
229+
230+
@Override
231+
public BigQueryStorageSettings build() throws IOException {
232+
return new BigQueryStorageSettings(this);
233+
}
234+
}
235+
}

0 commit comments

Comments
 (0)