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

Commit 8cbdde7

Browse files
feat: update the Dataproc V1 API client library
This includes the following: 1. The new start and stop cluster methods. 2. The ability to specify a metastore config in a cluster. 3. The ability to specify a (BETA) GKE cluster when creating a Dataproc cluster. 4. The ability to configure the behavior for private IPv6 cluster networking. 5. The ability to specify node affinity groups for clusters. 6. The ability to specify shielded VM configurations for clusters. 7. Support for service-account based secure multi-tenancy. 8. The ability to specify cluster labels for picking which cluster should run a job. 9. Components for DOCKER, DRUID, FLINK, HBASE, RANGER, and SOLR 10. The ability to specify a DAG timeout for workflows. Committer: @ojarjur PiperOrigin-RevId: 367518225 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Apr 8 15:22:23 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 439f098cb730af18c8ae4e65971ea3badf45138a Source-Link: googleapis/googleapis@439f098
1 parent a208e54 commit 8cbdde7

File tree

81 files changed

+15700
-1034
lines changed

Some content is hidden

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

81 files changed

+15700
-1034
lines changed

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

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,172 @@ public final UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallabl
448448
return stub.updateClusterCallable();
449449
}
450450

451+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
452+
/**
453+
* Stops a cluster in a project.
454+
*
455+
* <p>Sample code:
456+
*
457+
* <pre>{@code
458+
* try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
459+
* StopClusterRequest request =
460+
* StopClusterRequest.newBuilder()
461+
* .setProjectId("projectId-894832108")
462+
* .setRegion("region-934795532")
463+
* .setClusterName("clusterName-1141738587")
464+
* .setClusterUuid("clusterUuid-1141510955")
465+
* .setRequestId("requestId693933066")
466+
* .build();
467+
* Cluster response = clusterControllerClient.stopClusterAsync(request).get();
468+
* }
469+
* }</pre>
470+
*
471+
* @param request The request object containing all of the parameters for the API call.
472+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
473+
*/
474+
public final OperationFuture<Cluster, ClusterOperationMetadata> stopClusterAsync(
475+
StopClusterRequest request) {
476+
return stopClusterOperationCallable().futureCall(request);
477+
}
478+
479+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
480+
/**
481+
* Stops a cluster in a project.
482+
*
483+
* <p>Sample code:
484+
*
485+
* <pre>{@code
486+
* try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
487+
* StopClusterRequest request =
488+
* StopClusterRequest.newBuilder()
489+
* .setProjectId("projectId-894832108")
490+
* .setRegion("region-934795532")
491+
* .setClusterName("clusterName-1141738587")
492+
* .setClusterUuid("clusterUuid-1141510955")
493+
* .setRequestId("requestId693933066")
494+
* .build();
495+
* OperationFuture<Cluster, ClusterOperationMetadata> future =
496+
* clusterControllerClient.stopClusterOperationCallable().futureCall(request);
497+
* // Do something.
498+
* Cluster response = future.get();
499+
* }
500+
* }</pre>
501+
*/
502+
public final OperationCallable<StopClusterRequest, Cluster, ClusterOperationMetadata>
503+
stopClusterOperationCallable() {
504+
return stub.stopClusterOperationCallable();
505+
}
506+
507+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
508+
/**
509+
* Stops a cluster in a project.
510+
*
511+
* <p>Sample code:
512+
*
513+
* <pre>{@code
514+
* try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
515+
* StopClusterRequest request =
516+
* StopClusterRequest.newBuilder()
517+
* .setProjectId("projectId-894832108")
518+
* .setRegion("region-934795532")
519+
* .setClusterName("clusterName-1141738587")
520+
* .setClusterUuid("clusterUuid-1141510955")
521+
* .setRequestId("requestId693933066")
522+
* .build();
523+
* ApiFuture<Operation> future =
524+
* clusterControllerClient.stopClusterCallable().futureCall(request);
525+
* // Do something.
526+
* Operation response = future.get();
527+
* }
528+
* }</pre>
529+
*/
530+
public final UnaryCallable<StopClusterRequest, Operation> stopClusterCallable() {
531+
return stub.stopClusterCallable();
532+
}
533+
534+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
535+
/**
536+
* Starts a cluster in a project.
537+
*
538+
* <p>Sample code:
539+
*
540+
* <pre>{@code
541+
* try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
542+
* StartClusterRequest request =
543+
* StartClusterRequest.newBuilder()
544+
* .setProjectId("projectId-894832108")
545+
* .setRegion("region-934795532")
546+
* .setClusterName("clusterName-1141738587")
547+
* .setClusterUuid("clusterUuid-1141510955")
548+
* .setRequestId("requestId693933066")
549+
* .build();
550+
* Cluster response = clusterControllerClient.startClusterAsync(request).get();
551+
* }
552+
* }</pre>
553+
*
554+
* @param request The request object containing all of the parameters for the API call.
555+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
556+
*/
557+
public final OperationFuture<Cluster, ClusterOperationMetadata> startClusterAsync(
558+
StartClusterRequest request) {
559+
return startClusterOperationCallable().futureCall(request);
560+
}
561+
562+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
563+
/**
564+
* Starts a cluster in a project.
565+
*
566+
* <p>Sample code:
567+
*
568+
* <pre>{@code
569+
* try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
570+
* StartClusterRequest request =
571+
* StartClusterRequest.newBuilder()
572+
* .setProjectId("projectId-894832108")
573+
* .setRegion("region-934795532")
574+
* .setClusterName("clusterName-1141738587")
575+
* .setClusterUuid("clusterUuid-1141510955")
576+
* .setRequestId("requestId693933066")
577+
* .build();
578+
* OperationFuture<Cluster, ClusterOperationMetadata> future =
579+
* clusterControllerClient.startClusterOperationCallable().futureCall(request);
580+
* // Do something.
581+
* Cluster response = future.get();
582+
* }
583+
* }</pre>
584+
*/
585+
public final OperationCallable<StartClusterRequest, Cluster, ClusterOperationMetadata>
586+
startClusterOperationCallable() {
587+
return stub.startClusterOperationCallable();
588+
}
589+
590+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
591+
/**
592+
* Starts a cluster in a project.
593+
*
594+
* <p>Sample code:
595+
*
596+
* <pre>{@code
597+
* try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
598+
* StartClusterRequest request =
599+
* StartClusterRequest.newBuilder()
600+
* .setProjectId("projectId-894832108")
601+
* .setRegion("region-934795532")
602+
* .setClusterName("clusterName-1141738587")
603+
* .setClusterUuid("clusterUuid-1141510955")
604+
* .setRequestId("requestId693933066")
605+
* .build();
606+
* ApiFuture<Operation> future =
607+
* clusterControllerClient.startClusterCallable().futureCall(request);
608+
* // Do something.
609+
* Operation response = future.get();
610+
* }
611+
* }</pre>
612+
*/
613+
public final UnaryCallable<StartClusterRequest, Operation> startClusterCallable() {
614+
return stub.startClusterCallable();
615+
}
616+
451617
// AUTO-GENERATED DOCUMENTATION AND METHOD.
452618
/**
453619
* Deletes a cluster in a project. The returned

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,28 @@ public UnaryCallSettings<UpdateClusterRequest, Operation> updateClusterSettings(
9494
return ((ClusterControllerStubSettings) getStubSettings()).updateClusterOperationSettings();
9595
}
9696

97+
/** Returns the object with the settings used for calls to stopCluster. */
98+
public UnaryCallSettings<StopClusterRequest, Operation> stopClusterSettings() {
99+
return ((ClusterControllerStubSettings) getStubSettings()).stopClusterSettings();
100+
}
101+
102+
/** Returns the object with the settings used for calls to stopCluster. */
103+
public OperationCallSettings<StopClusterRequest, Cluster, ClusterOperationMetadata>
104+
stopClusterOperationSettings() {
105+
return ((ClusterControllerStubSettings) getStubSettings()).stopClusterOperationSettings();
106+
}
107+
108+
/** Returns the object with the settings used for calls to startCluster. */
109+
public UnaryCallSettings<StartClusterRequest, Operation> startClusterSettings() {
110+
return ((ClusterControllerStubSettings) getStubSettings()).startClusterSettings();
111+
}
112+
113+
/** Returns the object with the settings used for calls to startCluster. */
114+
public OperationCallSettings<StartClusterRequest, Cluster, ClusterOperationMetadata>
115+
startClusterOperationSettings() {
116+
return ((ClusterControllerStubSettings) getStubSettings()).startClusterOperationSettings();
117+
}
118+
97119
/** Returns the object with the settings used for calls to deleteCluster. */
98120
public UnaryCallSettings<DeleteClusterRequest, Operation> deleteClusterSettings() {
99121
return ((ClusterControllerStubSettings) getStubSettings()).deleteClusterSettings();
@@ -248,6 +270,28 @@ public UnaryCallSettings.Builder<UpdateClusterRequest, Operation> updateClusterS
248270
return getStubSettingsBuilder().updateClusterOperationSettings();
249271
}
250272

273+
/** Returns the builder for the settings used for calls to stopCluster. */
274+
public UnaryCallSettings.Builder<StopClusterRequest, Operation> stopClusterSettings() {
275+
return getStubSettingsBuilder().stopClusterSettings();
276+
}
277+
278+
/** Returns the builder for the settings used for calls to stopCluster. */
279+
public OperationCallSettings.Builder<StopClusterRequest, Cluster, ClusterOperationMetadata>
280+
stopClusterOperationSettings() {
281+
return getStubSettingsBuilder().stopClusterOperationSettings();
282+
}
283+
284+
/** Returns the builder for the settings used for calls to startCluster. */
285+
public UnaryCallSettings.Builder<StartClusterRequest, Operation> startClusterSettings() {
286+
return getStubSettingsBuilder().startClusterSettings();
287+
}
288+
289+
/** Returns the builder for the settings used for calls to startCluster. */
290+
public OperationCallSettings.Builder<StartClusterRequest, Cluster, ClusterOperationMetadata>
291+
startClusterOperationSettings() {
292+
return getStubSettingsBuilder().startClusterOperationSettings();
293+
}
294+
251295
/** Returns the builder for the settings used for calls to deleteCluster. */
252296
public UnaryCallSettings.Builder<DeleteClusterRequest, Operation> deleteClusterSettings() {
253297
return getStubSettingsBuilder().deleteClusterSettings();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public final OperationFuture<Empty, WorkflowMetadata> instantiateWorkflowTemplat
647647
* </ul>
648648
*
649649
* @param parameters Optional. Map from parameter names to values that should be used for those
650-
* parameters. Values may not exceed 100 characters.
650+
* parameters. Values may not exceed 1000 characters.
651651
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
652652
*/
653653
public final OperationFuture<Empty, WorkflowMetadata> instantiateWorkflowTemplateAsync(
@@ -708,7 +708,7 @@ public final OperationFuture<Empty, WorkflowMetadata> instantiateWorkflowTemplat
708708
* </ul>
709709
*
710710
* @param parameters Optional. Map from parameter names to values that should be used for those
711-
* parameters. Values may not exceed 100 characters.
711+
* parameters. Values may not exceed 1000 characters.
712712
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
713713
*/
714714
public final OperationFuture<Empty, WorkflowMetadata> instantiateWorkflowTemplateAsync(

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
"ListClusters": {
5050
"methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"]
5151
},
52+
"StartCluster": {
53+
"methods": ["startClusterAsync", "startClusterOperationCallable", "startClusterCallable"]
54+
},
55+
"StopCluster": {
56+
"methods": ["stopClusterAsync", "stopClusterOperationCallable", "stopClusterCallable"]
57+
},
5258
"UpdateCluster": {
5359
"methods": ["updateClusterAsync", "updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"]
5460
}

google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import com.google.cloud.dataproc.v1.GetClusterRequest;
3131
import com.google.cloud.dataproc.v1.ListClustersRequest;
3232
import com.google.cloud.dataproc.v1.ListClustersResponse;
33+
import com.google.cloud.dataproc.v1.StartClusterRequest;
34+
import com.google.cloud.dataproc.v1.StopClusterRequest;
3335
import com.google.cloud.dataproc.v1.UpdateClusterRequest;
3436
import com.google.longrunning.Operation;
3537
import com.google.longrunning.stub.OperationsStub;
@@ -67,6 +69,24 @@ public UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallable() {
6769
throw new UnsupportedOperationException("Not implemented: updateClusterCallable()");
6870
}
6971

72+
public OperationCallable<StopClusterRequest, Cluster, ClusterOperationMetadata>
73+
stopClusterOperationCallable() {
74+
throw new UnsupportedOperationException("Not implemented: stopClusterOperationCallable()");
75+
}
76+
77+
public UnaryCallable<StopClusterRequest, Operation> stopClusterCallable() {
78+
throw new UnsupportedOperationException("Not implemented: stopClusterCallable()");
79+
}
80+
81+
public OperationCallable<StartClusterRequest, Cluster, ClusterOperationMetadata>
82+
startClusterOperationCallable() {
83+
throw new UnsupportedOperationException("Not implemented: startClusterOperationCallable()");
84+
}
85+
86+
public UnaryCallable<StartClusterRequest, Operation> startClusterCallable() {
87+
throw new UnsupportedOperationException("Not implemented: startClusterCallable()");
88+
}
89+
7090
public OperationCallable<DeleteClusterRequest, Empty, ClusterOperationMetadata>
7191
deleteClusterOperationCallable() {
7292
throw new UnsupportedOperationException("Not implemented: deleteClusterOperationCallable()");

0 commit comments

Comments
 (0)