Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 4556a3f

Browse files
feat: Add support for dataproc BatchController service (#719)
* feat: Add support for dataproc BatchController service PiperOrigin-RevId: 404333740 Source-Link: googleapis/googleapis@5088bd7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/44b870783c1943771bcdec748ae4d5208c3d7f0e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDRiODcwNzgzYzE5NDM3NzFiY2RlYzc0OGFlNGQ1MjA4YzNkN2YwZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 51cd3d2 commit 4556a3f

35 files changed

+25082
-0
lines changed

google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerClient.java

Lines changed: 732 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
/*
2+
* Copyright 2021 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+
17+
package com.google.cloud.dataproc.v1;
18+
19+
import static com.google.cloud.dataproc.v1.BatchControllerClient.ListBatchesPagedResponse;
20+
21+
import com.google.api.core.ApiFunction;
22+
import com.google.api.core.BetaApi;
23+
import com.google.api.gax.core.GoogleCredentialsProvider;
24+
import com.google.api.gax.core.InstantiatingExecutorProvider;
25+
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
26+
import com.google.api.gax.rpc.ApiClientHeaderProvider;
27+
import com.google.api.gax.rpc.ClientContext;
28+
import com.google.api.gax.rpc.ClientSettings;
29+
import com.google.api.gax.rpc.OperationCallSettings;
30+
import com.google.api.gax.rpc.PagedCallSettings;
31+
import com.google.api.gax.rpc.TransportChannelProvider;
32+
import com.google.api.gax.rpc.UnaryCallSettings;
33+
import com.google.cloud.dataproc.v1.stub.BatchControllerStubSettings;
34+
import com.google.longrunning.Operation;
35+
import com.google.protobuf.Empty;
36+
import java.io.IOException;
37+
import java.util.List;
38+
import javax.annotation.Generated;
39+
40+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
41+
/**
42+
* Settings class to configure an instance of {@link BatchControllerClient}.
43+
*
44+
* <p>The default instance has everything set to sensible defaults:
45+
*
46+
* <ul>
47+
* <li>The default service address (dataproc.googleapis.com) and default port (443) are used.
48+
* <li>Credentials are acquired automatically through Application Default Credentials.
49+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
50+
* </ul>
51+
*
52+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
53+
* build() is called, the tree of builders is called to create the complete settings object.
54+
*
55+
* <p>For example, to set the total timeout of getBatch to 30 seconds:
56+
*
57+
* <pre>{@code
58+
* BatchControllerSettings.Builder batchControllerSettingsBuilder =
59+
* BatchControllerSettings.newBuilder();
60+
* batchControllerSettingsBuilder
61+
* .getBatchSettings()
62+
* .setRetrySettings(
63+
* batchControllerSettingsBuilder
64+
* .getBatchSettings()
65+
* .getRetrySettings()
66+
* .toBuilder()
67+
* .setTotalTimeout(Duration.ofSeconds(30))
68+
* .build());
69+
* BatchControllerSettings batchControllerSettings = batchControllerSettingsBuilder.build();
70+
* }</pre>
71+
*/
72+
@Generated("by gapic-generator-java")
73+
public class BatchControllerSettings extends ClientSettings<BatchControllerSettings> {
74+
75+
/** Returns the object with the settings used for calls to createBatch. */
76+
public UnaryCallSettings<CreateBatchRequest, Operation> createBatchSettings() {
77+
return ((BatchControllerStubSettings) getStubSettings()).createBatchSettings();
78+
}
79+
80+
/** Returns the object with the settings used for calls to createBatch. */
81+
public OperationCallSettings<CreateBatchRequest, Batch, BatchOperationMetadata>
82+
createBatchOperationSettings() {
83+
return ((BatchControllerStubSettings) getStubSettings()).createBatchOperationSettings();
84+
}
85+
86+
/** Returns the object with the settings used for calls to getBatch. */
87+
public UnaryCallSettings<GetBatchRequest, Batch> getBatchSettings() {
88+
return ((BatchControllerStubSettings) getStubSettings()).getBatchSettings();
89+
}
90+
91+
/** Returns the object with the settings used for calls to listBatches. */
92+
public PagedCallSettings<ListBatchesRequest, ListBatchesResponse, ListBatchesPagedResponse>
93+
listBatchesSettings() {
94+
return ((BatchControllerStubSettings) getStubSettings()).listBatchesSettings();
95+
}
96+
97+
/** Returns the object with the settings used for calls to deleteBatch. */
98+
public UnaryCallSettings<DeleteBatchRequest, Empty> deleteBatchSettings() {
99+
return ((BatchControllerStubSettings) getStubSettings()).deleteBatchSettings();
100+
}
101+
102+
public static final BatchControllerSettings create(BatchControllerStubSettings stub)
103+
throws IOException {
104+
return new BatchControllerSettings.Builder(stub.toBuilder()).build();
105+
}
106+
107+
/** Returns a builder for the default ExecutorProvider for this service. */
108+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
109+
return BatchControllerStubSettings.defaultExecutorProviderBuilder();
110+
}
111+
112+
/** Returns the default service endpoint. */
113+
public static String getDefaultEndpoint() {
114+
return BatchControllerStubSettings.getDefaultEndpoint();
115+
}
116+
117+
/** Returns the default service scopes. */
118+
public static List<String> getDefaultServiceScopes() {
119+
return BatchControllerStubSettings.getDefaultServiceScopes();
120+
}
121+
122+
/** Returns a builder for the default credentials for this service. */
123+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
124+
return BatchControllerStubSettings.defaultCredentialsProviderBuilder();
125+
}
126+
127+
/** Returns a builder for the default ChannelProvider for this service. */
128+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
129+
return BatchControllerStubSettings.defaultGrpcTransportProviderBuilder();
130+
}
131+
132+
public static TransportChannelProvider defaultTransportChannelProvider() {
133+
return BatchControllerStubSettings.defaultTransportChannelProvider();
134+
}
135+
136+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
137+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
138+
return BatchControllerStubSettings.defaultApiClientHeaderProviderBuilder();
139+
}
140+
141+
/** Returns a new builder for this class. */
142+
public static Builder newBuilder() {
143+
return Builder.createDefault();
144+
}
145+
146+
/** Returns a new builder for this class. */
147+
public static Builder newBuilder(ClientContext clientContext) {
148+
return new Builder(clientContext);
149+
}
150+
151+
/** Returns a builder containing all the values of this settings class. */
152+
public Builder toBuilder() {
153+
return new Builder(this);
154+
}
155+
156+
protected BatchControllerSettings(Builder settingsBuilder) throws IOException {
157+
super(settingsBuilder);
158+
}
159+
160+
/** Builder for BatchControllerSettings. */
161+
public static class Builder extends ClientSettings.Builder<BatchControllerSettings, Builder> {
162+
163+
protected Builder() throws IOException {
164+
this(((ClientContext) null));
165+
}
166+
167+
protected Builder(ClientContext clientContext) {
168+
super(BatchControllerStubSettings.newBuilder(clientContext));
169+
}
170+
171+
protected Builder(BatchControllerSettings settings) {
172+
super(settings.getStubSettings().toBuilder());
173+
}
174+
175+
protected Builder(BatchControllerStubSettings.Builder stubSettings) {
176+
super(stubSettings);
177+
}
178+
179+
private static Builder createDefault() {
180+
return new Builder(BatchControllerStubSettings.newBuilder());
181+
}
182+
183+
public BatchControllerStubSettings.Builder getStubSettingsBuilder() {
184+
return ((BatchControllerStubSettings.Builder) getStubSettings());
185+
}
186+
187+
/**
188+
* Applies the given settings updater function to all of the unary API methods in this service.
189+
*
190+
* <p>Note: This method does not support applying settings to streaming methods.
191+
*/
192+
public Builder applyToAllUnaryMethods(
193+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
194+
super.applyToAllUnaryMethods(
195+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
196+
return this;
197+
}
198+
199+
/** Returns the builder for the settings used for calls to createBatch. */
200+
public UnaryCallSettings.Builder<CreateBatchRequest, Operation> createBatchSettings() {
201+
return getStubSettingsBuilder().createBatchSettings();
202+
}
203+
204+
/** Returns the builder for the settings used for calls to createBatch. */
205+
public OperationCallSettings.Builder<CreateBatchRequest, Batch, BatchOperationMetadata>
206+
createBatchOperationSettings() {
207+
return getStubSettingsBuilder().createBatchOperationSettings();
208+
}
209+
210+
/** Returns the builder for the settings used for calls to getBatch. */
211+
public UnaryCallSettings.Builder<GetBatchRequest, Batch> getBatchSettings() {
212+
return getStubSettingsBuilder().getBatchSettings();
213+
}
214+
215+
/** Returns the builder for the settings used for calls to listBatches. */
216+
public PagedCallSettings.Builder<
217+
ListBatchesRequest, ListBatchesResponse, ListBatchesPagedResponse>
218+
listBatchesSettings() {
219+
return getStubSettingsBuilder().listBatchesSettings();
220+
}
221+
222+
/** Returns the builder for the settings used for calls to deleteBatch. */
223+
public UnaryCallSettings.Builder<DeleteBatchRequest, Empty> deleteBatchSettings() {
224+
return getStubSettingsBuilder().deleteBatchSettings();
225+
}
226+
227+
@Override
228+
public BatchControllerSettings build() throws IOException {
229+
return new BatchControllerSettings(this);
230+
}
231+
}
232+
}

google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/gapic_metadata.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,27 @@
2929
}
3030
}
3131
},
32+
"BatchController": {
33+
"clients": {
34+
"grpc": {
35+
"libraryClient": "BatchControllerClient",
36+
"rpcs": {
37+
"CreateBatch": {
38+
"methods": ["createBatchAsync", "createBatchAsync", "createBatchAsync", "createBatchOperationCallable", "createBatchCallable"]
39+
},
40+
"DeleteBatch": {
41+
"methods": ["deleteBatch", "deleteBatch", "deleteBatch", "deleteBatchCallable"]
42+
},
43+
"GetBatch": {
44+
"methods": ["getBatch", "getBatch", "getBatch", "getBatchCallable"]
45+
},
46+
"ListBatches": {
47+
"methods": ["listBatches", "listBatches", "listBatches", "listBatchesPagedCallable", "listBatchesCallable"]
48+
}
49+
}
50+
}
51+
}
52+
},
3253
"ClusterController": {
3354
"clients": {
3455
"grpc": {

google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@
3333
* }
3434
* }</pre>
3535
*
36+
* <p>======================= BatchControllerClient =======================
37+
*
38+
* <p>Service Description: The BatchController provides methods to manage batch workloads.
39+
*
40+
* <p>Sample for BatchControllerClient:
41+
*
42+
* <pre>{@code
43+
* try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
44+
* BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
45+
* Batch response = batchControllerClient.getBatch(name);
46+
* }
47+
* }</pre>
48+
*
3649
* <p>======================= ClusterControllerClient =======================
3750
*
3851
* <p>Service Description: The ClusterControllerService provides methods to manage clusters of
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright 2021 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+
17+
package com.google.cloud.dataproc.v1.stub;
18+
19+
import static com.google.cloud.dataproc.v1.BatchControllerClient.ListBatchesPagedResponse;
20+
21+
import com.google.api.gax.core.BackgroundResource;
22+
import com.google.api.gax.rpc.OperationCallable;
23+
import com.google.api.gax.rpc.UnaryCallable;
24+
import com.google.cloud.dataproc.v1.Batch;
25+
import com.google.cloud.dataproc.v1.BatchOperationMetadata;
26+
import com.google.cloud.dataproc.v1.CreateBatchRequest;
27+
import com.google.cloud.dataproc.v1.DeleteBatchRequest;
28+
import com.google.cloud.dataproc.v1.GetBatchRequest;
29+
import com.google.cloud.dataproc.v1.ListBatchesRequest;
30+
import com.google.cloud.dataproc.v1.ListBatchesResponse;
31+
import com.google.longrunning.Operation;
32+
import com.google.longrunning.stub.OperationsStub;
33+
import com.google.protobuf.Empty;
34+
import javax.annotation.Generated;
35+
36+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
37+
/**
38+
* Base stub class for the BatchController service API.
39+
*
40+
* <p>This class is for advanced usage and reflects the underlying API directly.
41+
*/
42+
@Generated("by gapic-generator-java")
43+
public abstract class BatchControllerStub implements BackgroundResource {
44+
45+
public OperationsStub getOperationsStub() {
46+
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
47+
}
48+
49+
public OperationCallable<CreateBatchRequest, Batch, BatchOperationMetadata>
50+
createBatchOperationCallable() {
51+
throw new UnsupportedOperationException("Not implemented: createBatchOperationCallable()");
52+
}
53+
54+
public UnaryCallable<CreateBatchRequest, Operation> createBatchCallable() {
55+
throw new UnsupportedOperationException("Not implemented: createBatchCallable()");
56+
}
57+
58+
public UnaryCallable<GetBatchRequest, Batch> getBatchCallable() {
59+
throw new UnsupportedOperationException("Not implemented: getBatchCallable()");
60+
}
61+
62+
public UnaryCallable<ListBatchesRequest, ListBatchesPagedResponse> listBatchesPagedCallable() {
63+
throw new UnsupportedOperationException("Not implemented: listBatchesPagedCallable()");
64+
}
65+
66+
public UnaryCallable<ListBatchesRequest, ListBatchesResponse> listBatchesCallable() {
67+
throw new UnsupportedOperationException("Not implemented: listBatchesCallable()");
68+
}
69+
70+
public UnaryCallable<DeleteBatchRequest, Empty> deleteBatchCallable() {
71+
throw new UnsupportedOperationException("Not implemented: deleteBatchCallable()");
72+
}
73+
74+
@Override
75+
public abstract void close();
76+
}

0 commit comments

Comments
 (0)