Skip to content

Commit 6e23c3a

Browse files
feat: [dataproc] support min_num_instances for primary worker and InstanceFlexibilityPolicy for secondary worker (#9775)
* feat: support min_num_instances for primary worker and InstanceFlexibilityPolicy for secondary worker PiperOrigin-RevId: 559135594 Source-Link: googleapis/googleapis@4a5a6fd Source-Link: https://github.com/googleapis/googleapis-gen/commit/5c911261f00257f768a8a323aa1a3e483640c1d2 Copy-Tag: eyJwIjoiamF2YS1kYXRhcHJvYy8uT3dsQm90LnlhbWwiLCJoIjoiNWM5MTEyNjFmMDAyNTdmNzY4YThhMzIzYWExYTNlNDgzNjQwYzFkMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add missing iam dependency --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Alice Li <[email protected]>
1 parent 87fc3d3 commit 6e23c3a

107 files changed

Lines changed: 15704 additions & 637 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

java-dataproc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.21.0</version>
23+
<version>26.22.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
195195
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
196196
[stability-image]: https://img.shields.io/badge/stability-stable-green
197197
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-dataproc.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-dataproc/4.19.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-dataproc/4.20.0
199199
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
200200
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
201201
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-dataproc/google-cloud-dataproc/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
<groupId>com.google.guava</groupId>
5050
<artifactId>guava</artifactId>
5151
</dependency>
52+
<dependency>
53+
<groupId>com.google.api.grpc</groupId>
54+
<artifactId>grpc-google-iam-v1</artifactId>
55+
</dependency>
5256
<dependency>
5357
<groupId>com.google.api</groupId>
5458
<artifactId>gax</artifactId>

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

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
import com.google.cloud.dataproc.v1.stub.AutoscalingPolicyServiceStub;
2828
import com.google.cloud.dataproc.v1.stub.AutoscalingPolicyServiceStubSettings;
2929
import com.google.common.util.concurrent.MoreExecutors;
30+
import com.google.iam.v1.GetIamPolicyRequest;
31+
import com.google.iam.v1.Policy;
32+
import com.google.iam.v1.SetIamPolicyRequest;
33+
import com.google.iam.v1.TestIamPermissionsRequest;
34+
import com.google.iam.v1.TestIamPermissionsResponse;
3035
import com.google.protobuf.Empty;
3136
import java.io.IOException;
3237
import java.util.List;
@@ -1011,6 +1016,224 @@ public final void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request
10111016
return stub.deleteAutoscalingPolicyCallable();
10121017
}
10131018

1019+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1020+
/**
1021+
* Sets the access control policy on the specified resource. Replacesany existing policy.
1022+
*
1023+
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
1024+
*
1025+
* <p>Sample code:
1026+
*
1027+
* <pre>{@code
1028+
* // This snippet has been automatically generated and should be regarded as a code template only.
1029+
* // It will require modifications to work:
1030+
* // - It may require correct/in-range values for request initialization.
1031+
* // - It may require specifying regional endpoints when creating the service client as shown in
1032+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1033+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
1034+
* AutoscalingPolicyServiceClient.create()) {
1035+
* SetIamPolicyRequest request =
1036+
* SetIamPolicyRequest.newBuilder()
1037+
* .setResource(
1038+
* AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
1039+
* "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
1040+
* .toString())
1041+
* .setPolicy(Policy.newBuilder().build())
1042+
* .setUpdateMask(FieldMask.newBuilder().build())
1043+
* .build();
1044+
* Policy response = autoscalingPolicyServiceClient.setIamPolicy(request);
1045+
* }
1046+
* }</pre>
1047+
*
1048+
* @param request The request object containing all of the parameters for the API call.
1049+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1050+
*/
1051+
public final Policy setIamPolicy(SetIamPolicyRequest request) {
1052+
return setIamPolicyCallable().call(request);
1053+
}
1054+
1055+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1056+
/**
1057+
* Sets the access control policy on the specified resource. Replacesany existing policy.
1058+
*
1059+
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
1060+
*
1061+
* <p>Sample code:
1062+
*
1063+
* <pre>{@code
1064+
* // This snippet has been automatically generated and should be regarded as a code template only.
1065+
* // It will require modifications to work:
1066+
* // - It may require correct/in-range values for request initialization.
1067+
* // - It may require specifying regional endpoints when creating the service client as shown in
1068+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1069+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
1070+
* AutoscalingPolicyServiceClient.create()) {
1071+
* SetIamPolicyRequest request =
1072+
* SetIamPolicyRequest.newBuilder()
1073+
* .setResource(
1074+
* AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
1075+
* "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
1076+
* .toString())
1077+
* .setPolicy(Policy.newBuilder().build())
1078+
* .setUpdateMask(FieldMask.newBuilder().build())
1079+
* .build();
1080+
* ApiFuture<Policy> future =
1081+
* autoscalingPolicyServiceClient.setIamPolicyCallable().futureCall(request);
1082+
* // Do something.
1083+
* Policy response = future.get();
1084+
* }
1085+
* }</pre>
1086+
*/
1087+
public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
1088+
return stub.setIamPolicyCallable();
1089+
}
1090+
1091+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1092+
/**
1093+
* Gets the access control policy for a resource. Returns an empty policyif the resource exists
1094+
* and does not have a policy set.
1095+
*
1096+
* <p>Sample code:
1097+
*
1098+
* <pre>{@code
1099+
* // This snippet has been automatically generated and should be regarded as a code template only.
1100+
* // It will require modifications to work:
1101+
* // - It may require correct/in-range values for request initialization.
1102+
* // - It may require specifying regional endpoints when creating the service client as shown in
1103+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1104+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
1105+
* AutoscalingPolicyServiceClient.create()) {
1106+
* GetIamPolicyRequest request =
1107+
* GetIamPolicyRequest.newBuilder()
1108+
* .setResource(
1109+
* AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
1110+
* "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
1111+
* .toString())
1112+
* .setOptions(GetPolicyOptions.newBuilder().build())
1113+
* .build();
1114+
* Policy response = autoscalingPolicyServiceClient.getIamPolicy(request);
1115+
* }
1116+
* }</pre>
1117+
*
1118+
* @param request The request object containing all of the parameters for the API call.
1119+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1120+
*/
1121+
public final Policy getIamPolicy(GetIamPolicyRequest request) {
1122+
return getIamPolicyCallable().call(request);
1123+
}
1124+
1125+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1126+
/**
1127+
* Gets the access control policy for a resource. Returns an empty policyif the resource exists
1128+
* and does not have a policy set.
1129+
*
1130+
* <p>Sample code:
1131+
*
1132+
* <pre>{@code
1133+
* // This snippet has been automatically generated and should be regarded as a code template only.
1134+
* // It will require modifications to work:
1135+
* // - It may require correct/in-range values for request initialization.
1136+
* // - It may require specifying regional endpoints when creating the service client as shown in
1137+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1138+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
1139+
* AutoscalingPolicyServiceClient.create()) {
1140+
* GetIamPolicyRequest request =
1141+
* GetIamPolicyRequest.newBuilder()
1142+
* .setResource(
1143+
* AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
1144+
* "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
1145+
* .toString())
1146+
* .setOptions(GetPolicyOptions.newBuilder().build())
1147+
* .build();
1148+
* ApiFuture<Policy> future =
1149+
* autoscalingPolicyServiceClient.getIamPolicyCallable().futureCall(request);
1150+
* // Do something.
1151+
* Policy response = future.get();
1152+
* }
1153+
* }</pre>
1154+
*/
1155+
public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
1156+
return stub.getIamPolicyCallable();
1157+
}
1158+
1159+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1160+
/**
1161+
* Returns permissions that a caller has on the specified resource. If theresource does not exist,
1162+
* this will return an empty set ofpermissions, not a `NOT_FOUND` error.
1163+
*
1164+
* <p>Note: This operation is designed to be used for buildingpermission-aware UIs and
1165+
* command-line tools, not for authorizationchecking. This operation may "fail open" without
1166+
* warning.
1167+
*
1168+
* <p>Sample code:
1169+
*
1170+
* <pre>{@code
1171+
* // This snippet has been automatically generated and should be regarded as a code template only.
1172+
* // It will require modifications to work:
1173+
* // - It may require correct/in-range values for request initialization.
1174+
* // - It may require specifying regional endpoints when creating the service client as shown in
1175+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1176+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
1177+
* AutoscalingPolicyServiceClient.create()) {
1178+
* TestIamPermissionsRequest request =
1179+
* TestIamPermissionsRequest.newBuilder()
1180+
* .setResource(
1181+
* AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
1182+
* "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
1183+
* .toString())
1184+
* .addAllPermissions(new ArrayList<String>())
1185+
* .build();
1186+
* TestIamPermissionsResponse response =
1187+
* autoscalingPolicyServiceClient.testIamPermissions(request);
1188+
* }
1189+
* }</pre>
1190+
*
1191+
* @param request The request object containing all of the parameters for the API call.
1192+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1193+
*/
1194+
public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
1195+
return testIamPermissionsCallable().call(request);
1196+
}
1197+
1198+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1199+
/**
1200+
* Returns permissions that a caller has on the specified resource. If theresource does not exist,
1201+
* this will return an empty set ofpermissions, not a `NOT_FOUND` error.
1202+
*
1203+
* <p>Note: This operation is designed to be used for buildingpermission-aware UIs and
1204+
* command-line tools, not for authorizationchecking. This operation may "fail open" without
1205+
* warning.
1206+
*
1207+
* <p>Sample code:
1208+
*
1209+
* <pre>{@code
1210+
* // This snippet has been automatically generated and should be regarded as a code template only.
1211+
* // It will require modifications to work:
1212+
* // - It may require correct/in-range values for request initialization.
1213+
* // - It may require specifying regional endpoints when creating the service client as shown in
1214+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1215+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
1216+
* AutoscalingPolicyServiceClient.create()) {
1217+
* TestIamPermissionsRequest request =
1218+
* TestIamPermissionsRequest.newBuilder()
1219+
* .setResource(
1220+
* AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
1221+
* "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
1222+
* .toString())
1223+
* .addAllPermissions(new ArrayList<String>())
1224+
* .build();
1225+
* ApiFuture<TestIamPermissionsResponse> future =
1226+
* autoscalingPolicyServiceClient.testIamPermissionsCallable().futureCall(request);
1227+
* // Do something.
1228+
* TestIamPermissionsResponse response = future.get();
1229+
* }
1230+
* }</pre>
1231+
*/
1232+
public final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
1233+
testIamPermissionsCallable() {
1234+
return stub.testIamPermissionsCallable();
1235+
}
1236+
10141237
@Override
10151238
public final void close() {
10161239
stub.close();

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
import com.google.api.gax.rpc.TransportChannelProvider;
3232
import com.google.api.gax.rpc.UnaryCallSettings;
3333
import com.google.cloud.dataproc.v1.stub.AutoscalingPolicyServiceStubSettings;
34+
import com.google.iam.v1.GetIamPolicyRequest;
35+
import com.google.iam.v1.Policy;
36+
import com.google.iam.v1.SetIamPolicyRequest;
37+
import com.google.iam.v1.TestIamPermissionsRequest;
38+
import com.google.iam.v1.TestIamPermissionsResponse;
3439
import com.google.protobuf.Empty;
3540
import java.io.IOException;
3641
import java.util.List;
@@ -116,6 +121,22 @@ public class AutoscalingPolicyServiceSettings
116121
.deleteAutoscalingPolicySettings();
117122
}
118123

124+
/** Returns the object with the settings used for calls to setIamPolicy. */
125+
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
126+
return ((AutoscalingPolicyServiceStubSettings) getStubSettings()).setIamPolicySettings();
127+
}
128+
129+
/** Returns the object with the settings used for calls to getIamPolicy. */
130+
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
131+
return ((AutoscalingPolicyServiceStubSettings) getStubSettings()).getIamPolicySettings();
132+
}
133+
134+
/** Returns the object with the settings used for calls to testIamPermissions. */
135+
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
136+
testIamPermissionsSettings() {
137+
return ((AutoscalingPolicyServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
138+
}
139+
119140
public static final AutoscalingPolicyServiceSettings create(
120141
AutoscalingPolicyServiceStubSettings stub) throws IOException {
121142
return new AutoscalingPolicyServiceSettings.Builder(stub.toBuilder()).build();
@@ -265,6 +286,22 @@ public Builder applyToAllUnaryMethods(
265286
return getStubSettingsBuilder().deleteAutoscalingPolicySettings();
266287
}
267288

289+
/** Returns the builder for the settings used for calls to setIamPolicy. */
290+
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
291+
return getStubSettingsBuilder().setIamPolicySettings();
292+
}
293+
294+
/** Returns the builder for the settings used for calls to getIamPolicy. */
295+
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
296+
return getStubSettingsBuilder().getIamPolicySettings();
297+
}
298+
299+
/** Returns the builder for the settings used for calls to testIamPermissions. */
300+
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
301+
testIamPermissionsSettings() {
302+
return getStubSettingsBuilder().testIamPermissionsSettings();
303+
}
304+
268305
@Override
269306
public AutoscalingPolicyServiceSettings build() throws IOException {
270307
return new AutoscalingPolicyServiceSettings(this);

0 commit comments

Comments
 (0)