From bef1b0d43ffa90cf27303a87ce8e020083512841 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 10 Jul 2020 10:26:29 -0700 Subject: [PATCH] fix: migrate to grpc_service_config (#248) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e9c50d75-a1ba-4ad3-a81e-eb3c5e7845ef/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 320442976 Source-Link: https://github.com/googleapis/googleapis/commit/ec05fa81a492c84fbe5b85341738ced42604ce68 PiperOrigin-RevId: 320442657 Source-Link: https://github.com/googleapis/googleapis/commit/979372fbeb700c51b1569c438fad3e199a2c12d5 --- .../v1/AutoscalingPolicyServiceClient.java | 151 +-- .../v1/AutoscalingPolicyServiceSettings.java | 32 +- .../dataproc/v1/ClusterControllerClient.java | 276 +++--- .../v1/ClusterControllerSettings.java | 46 +- .../dataproc/v1/JobControllerClient.java | 226 ++--- .../dataproc/v1/JobControllerSettings.java | 52 +- .../v1/WorkflowTemplateServiceClient.java | 878 ++++++++--------- .../v1/WorkflowTemplateServiceSettings.java | 50 +- .../cloud/dataproc/v1/package-info.java | 3 +- .../v1/stub/AutoscalingPolicyServiceStub.java | 10 +- .../AutoscalingPolicyServiceStubSettings.java | 192 +++- .../v1/stub/ClusterControllerStub.java | 20 +- .../stub/ClusterControllerStubSettings.java | 156 +-- .../GrpcAutoscalingPolicyServiceStub.java | 72 +- .../v1/stub/GrpcClusterControllerStub.java | 70 +- .../v1/stub/GrpcJobControllerStub.java | 72 +- .../stub/GrpcWorkflowTemplateServiceStub.java | 142 +-- .../dataproc/v1/stub/JobControllerStub.java | 22 +- .../v1/stub/JobControllerStubSettings.java | 244 +++-- .../v1/stub/WorkflowTemplateServiceStub.java | 18 +- .../WorkflowTemplateServiceStubSettings.java | 158 ++-- .../v1beta2/ClusterControllerClient.java | 268 +++--- .../v1beta2/ClusterControllerSettings.java | 46 +- .../dataproc/v1beta2/JobControllerClient.java | 226 ++--- .../v1beta2/JobControllerSettings.java | 52 +- .../WorkflowTemplateServiceClient.java | 890 +++++++++--------- .../WorkflowTemplateServiceSettings.java | 50 +- .../AutoscalingPolicyServiceStubSettings.java | 138 ++- .../v1beta2/stub/ClusterControllerStub.java | 20 +- .../stub/ClusterControllerStubSettings.java | 190 ++-- .../stub/GrpcClusterControllerStub.java | 70 +- .../v1beta2/stub/GrpcJobControllerStub.java | 72 +- .../stub/GrpcWorkflowTemplateServiceStub.java | 142 +-- .../v1beta2/stub/JobControllerStub.java | 22 +- .../stub/JobControllerStubSettings.java | 248 +++-- .../stub/WorkflowTemplateServiceStub.java | 18 +- .../WorkflowTemplateServiceStubSettings.java | 176 ++-- .../AutoscalingPolicyServiceClientTest.java | 30 +- .../v1/ClusterControllerClientTest.java | 104 +- .../dataproc/v1/JobControllerClientTest.java | 124 +-- .../v1/WorkflowTemplateServiceClientTest.java | 208 ++-- .../v1beta2/ClusterControllerClientTest.java | 104 +- .../v1beta2/JobControllerClientTest.java | 128 +-- .../WorkflowTemplateServiceClientTest.java | 208 ++-- synth.metadata | 10 +- 45 files changed, 3456 insertions(+), 2978 deletions(-) diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java index 198afa73..42681501 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java @@ -44,8 +44,9 @@ *
  * 
  * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
  *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- *   AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+ *   AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy);
  * }
  * 
  * 
@@ -157,80 +158,6 @@ public AutoscalingPolicyServiceStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates (replaces) autoscaling policy. - * - *

Disabled check for update_mask, because all updates will be full replacements. - * - *

Sample code: - * - *


-   * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
-   *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
-   *   AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
-   * }
-   * 
- * - * @param policy Required. The updated autoscaling policy. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) { - UpdateAutoscalingPolicyRequest request = - UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build(); - return updateAutoscalingPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates (replaces) autoscaling policy. - * - *

Disabled check for update_mask, because all updates will be full replacements. - * - *

Sample code: - * - *


-   * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
-   *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
-   *   UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
-   *     .setPolicy(policy)
-   *     .build();
-   *   AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(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 AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) { - return updateAutoscalingPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates (replaces) autoscaling policy. - * - *

Disabled check for update_mask, because all updates will be full replacements. - * - *

Sample code: - * - *


-   * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
-   *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
-   *   UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
-   *     .setPolicy(policy)
-   *     .build();
-   *   ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
-   *   // Do something
-   *   AutoscalingPolicy response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - updateAutoscalingPolicyCallable() { - return stub.updateAutoscalingPolicyCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates new autoscaling policy. @@ -376,6 +303,80 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe return stub.createAutoscalingPolicyCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates (replaces) autoscaling policy. + * + *

Disabled check for update_mask, because all updates will be full replacements. + * + *

Sample code: + * + *


+   * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+   *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+   *   AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+   * }
+   * 
+ * + * @param policy Required. The updated autoscaling policy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) { + UpdateAutoscalingPolicyRequest request = + UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build(); + return updateAutoscalingPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates (replaces) autoscaling policy. + * + *

Disabled check for update_mask, because all updates will be full replacements. + * + *

Sample code: + * + *


+   * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+   *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+   *   UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
+   *     .setPolicy(policy)
+   *     .build();
+   *   AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(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 AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) { + return updateAutoscalingPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates (replaces) autoscaling policy. + * + *

Disabled check for update_mask, because all updates will be full replacements. + * + *

Sample code: + * + *


+   * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+   *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+   *   UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
+   *   // Do something
+   *   AutoscalingPolicy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateAutoscalingPolicyCallable() { + return stub.updateAutoscalingPolicyCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Retrieves autoscaling policy. diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java index 5bd24dff..36d59fbf 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java @@ -49,16 +49,16 @@ *

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 updateAutoscalingPolicy to 30 seconds: + *

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

  * 
  * AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder =
  *     AutoscalingPolicyServiceSettings.newBuilder();
  * autoscalingPolicyServiceSettingsBuilder
- *     .updateAutoscalingPolicySettings()
+ *     .createAutoscalingPolicySettings()
  *     .setRetrySettings(
- *         autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ *         autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
@@ -69,13 +69,6 @@
 @BetaApi
 public class AutoscalingPolicyServiceSettings
     extends ClientSettings {
-  /** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
-  public UnaryCallSettings
-      updateAutoscalingPolicySettings() {
-    return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
-        .updateAutoscalingPolicySettings();
-  }
-
   /** Returns the object with the settings used for calls to createAutoscalingPolicy. */
   public UnaryCallSettings
       createAutoscalingPolicySettings() {
@@ -83,6 +76,13 @@ public class AutoscalingPolicyServiceSettings
         .createAutoscalingPolicySettings();
   }
 
+  /** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
+  public UnaryCallSettings
+      updateAutoscalingPolicySettings() {
+    return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
+        .updateAutoscalingPolicySettings();
+  }
+
   /** Returns the object with the settings used for calls to getAutoscalingPolicy. */
   public UnaryCallSettings
       getAutoscalingPolicySettings() {
@@ -205,18 +205,18 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
-    /** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
-    public UnaryCallSettings.Builder
-        updateAutoscalingPolicySettings() {
-      return getStubSettingsBuilder().updateAutoscalingPolicySettings();
-    }
-
     /** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
     public UnaryCallSettings.Builder
         createAutoscalingPolicySettings() {
       return getStubSettingsBuilder().createAutoscalingPolicySettings();
     }
 
+    /** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
+    public UnaryCallSettings.Builder
+        updateAutoscalingPolicySettings() {
+      return getStubSettingsBuilder().updateAutoscalingPolicySettings();
+    }
+
     /** Returns the builder for the settings used for calls to getAutoscalingPolicy. */
     public UnaryCallSettings.Builder
         getAutoscalingPolicySettings() {
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
index bc3c3a40..9731463b 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
@@ -591,6 +591,144 @@ public final UnaryCallable deleteClusterCallabl
     return stub.deleteClusterCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Gets cluster diagnostic information. The returned
+   * [Operation.metadata][google.longrunning.Operation.metadata] will be
+   * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
+   * After the operation completes, [Operation.response][google.longrunning.Operation.response]
+   * contains
+   * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
+   *
+   * 

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
+   * }
+   * 
+ * + * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs + * to. + * @param region Required. The Dataproc region in which to handle the request. + * @param clusterName Required. The cluster name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture diagnoseClusterAsync( + String projectId, String region, String clusterName) { + DiagnoseClusterRequest request = + DiagnoseClusterRequest.newBuilder() + .setProjectId(projectId) + .setRegion(region) + .setClusterName(clusterName) + .build(); + return diagnoseClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets cluster diagnostic information. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + * After the operation completes, [Operation.response][google.longrunning.Operation.response] + * contains + * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + * + *

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setClusterName(clusterName)
+   *     .build();
+   *   clusterControllerClient.diagnoseClusterAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture diagnoseClusterAsync( + DiagnoseClusterRequest request) { + return diagnoseClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets cluster diagnostic information. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + * After the operation completes, [Operation.response][google.longrunning.Operation.response] + * contains + * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + * + *

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setClusterName(clusterName)
+   *     .build();
+   *   OperationFuture<Empty, DiagnoseClusterResults> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + diagnoseClusterOperationCallable() { + return stub.diagnoseClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets cluster diagnostic information. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + * After the operation completes, [Operation.response][google.longrunning.Operation.response] + * contains + * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + * + *

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setClusterName(clusterName)
+   *     .build();
+   *   ApiFuture<Operation> future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable diagnoseClusterCallable() { + return stub.diagnoseClusterCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets the resource representation for a cluster in a project. @@ -836,144 +974,6 @@ public final UnaryCallable listCluste return stub.listClustersCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains - * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
-   * }
-   * 
- * - * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs - * to. - * @param region Required. The Dataproc region in which to handle the request. - * @param clusterName Required. The cluster name. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture diagnoseClusterAsync( - String projectId, String region, String clusterName) { - DiagnoseClusterRequest request = - DiagnoseClusterRequest.newBuilder() - .setProjectId(projectId) - .setRegion(region) - .setClusterName(clusterName) - .build(); - return diagnoseClusterAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains - * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setClusterName(clusterName)
-   *     .build();
-   *   clusterControllerClient.diagnoseClusterAsync(request).get();
-   * }
-   * 
- * - * @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 - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture diagnoseClusterAsync( - DiagnoseClusterRequest request) { - return diagnoseClusterOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains - * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setClusterName(clusterName)
-   *     .build();
-   *   OperationFuture<Empty, DiagnoseClusterResults> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - diagnoseClusterOperationCallable() { - return stub.diagnoseClusterOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains - * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setClusterName(clusterName)
-   *     .build();
-   *   ApiFuture<Operation> future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable diagnoseClusterCallable() { - return stub.diagnoseClusterCallable(); - } - @Override public final void close() { stub.close(); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java index 8fb9b070..497b0bb7 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java @@ -109,17 +109,6 @@ public UnaryCallSettings deleteClusterSettings( return ((ClusterControllerStubSettings) getStubSettings()).deleteClusterOperationSettings(); } - /** Returns the object with the settings used for calls to getCluster. */ - public UnaryCallSettings getClusterSettings() { - return ((ClusterControllerStubSettings) getStubSettings()).getClusterSettings(); - } - - /** Returns the object with the settings used for calls to listClusters. */ - public PagedCallSettings - listClustersSettings() { - return ((ClusterControllerStubSettings) getStubSettings()).listClustersSettings(); - } - /** Returns the object with the settings used for calls to diagnoseCluster. */ public UnaryCallSettings diagnoseClusterSettings() { return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterSettings(); @@ -133,6 +122,17 @@ public UnaryCallSettings diagnoseClusterSetti return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterOperationSettings(); } + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((ClusterControllerStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return ((ClusterControllerStubSettings) getStubSettings()).listClustersSettings(); + } + public static final ClusterControllerSettings create(ClusterControllerStubSettings stub) throws IOException { return new ClusterControllerSettings.Builder(stub.toBuilder()).build(); @@ -269,18 +269,6 @@ public UnaryCallSettings.Builder deleteClusterS return getStubSettingsBuilder().deleteClusterOperationSettings(); } - /** Returns the builder for the settings used for calls to getCluster. */ - public UnaryCallSettings.Builder getClusterSettings() { - return getStubSettingsBuilder().getClusterSettings(); - } - - /** Returns the builder for the settings used for calls to listClusters. */ - public PagedCallSettings.Builder< - ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> - listClustersSettings() { - return getStubSettingsBuilder().listClustersSettings(); - } - /** Returns the builder for the settings used for calls to diagnoseCluster. */ public UnaryCallSettings.Builder diagnoseClusterSettings() { return getStubSettingsBuilder().diagnoseClusterSettings(); @@ -294,6 +282,18 @@ public UnaryCallSettings.Builder diagnoseClus return getStubSettingsBuilder().diagnoseClusterOperationSettings(); } + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getStubSettingsBuilder().getClusterSettings(); + } + + /** Returns the builder for the settings used for calls to listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return getStubSettingsBuilder().listClustersSettings(); + } + @Override public ClusterControllerSettings build() throws IOException { return new ClusterControllerSettings(this); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java index 7b7c5377..51856e4c 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java @@ -252,6 +252,119 @@ public final UnaryCallable submitJobCallable() { return stub.submitJobCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
+   * }
+   * 
+ * + * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param region Required. The Dataproc region in which to handle the request. + * @param job Required. The job resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture submitJobAsOperationAsync( + String projectId, String region, Job job) { + SubmitJobRequest request = + SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build(); + return submitJobAsOperationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setJob(job)
+   *     .build();
+   *   Job response = jobControllerClient.submitJobAsOperationAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture submitJobAsOperationAsync( + SubmitJobRequest request) { + return submitJobAsOperationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setJob(job)
+   *     .build();
+   *   OperationFuture<Job, JobMetadata> future = jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + submitJobAsOperationOperationCallable() { + return stub.submitJobAsOperationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setJob(job)
+   *     .build();
+   *   ApiFuture<Operation> future = jobControllerClient.submitJobAsOperationCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable submitJobAsOperationCallable() { + return stub.submitJobAsOperationCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets the resource representation for a job in a project. @@ -726,119 +839,6 @@ public final UnaryCallable deleteJobCallable() { return stub.deleteJobCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
-   * }
-   * 
- * - * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param region Required. The Dataproc region in which to handle the request. - * @param job Required. The job resource. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture submitJobAsOperationAsync( - String projectId, String region, Job job) { - SubmitJobRequest request = - SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build(); - return submitJobAsOperationAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setJob(job)
-   *     .build();
-   *   Job response = jobControllerClient.submitJobAsOperationAsync(request).get();
-   * }
-   * 
- * - * @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 - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture submitJobAsOperationAsync( - SubmitJobRequest request) { - return submitJobAsOperationOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setJob(job)
-   *     .build();
-   *   OperationFuture<Job, JobMetadata> future = jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
-   *   // Do something
-   *   Job response = future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - submitJobAsOperationOperationCallable() { - return stub.submitJobAsOperationOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setJob(job)
-   *     .build();
-   *   ApiFuture<Operation> future = jobControllerClient.submitJobAsOperationCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable submitJobAsOperationCallable() { - return stub.submitJobAsOperationCallable(); - } - @Override public final void close() { stub.close(); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java index c4b3fe2b..7f3f2964 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java @@ -75,6 +75,19 @@ public UnaryCallSettings submitJobSettings() { return ((JobControllerStubSettings) getStubSettings()).submitJobSettings(); } + /** Returns the object with the settings used for calls to submitJobAsOperation. */ + public UnaryCallSettings submitJobAsOperationSettings() { + return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationSettings(); + } + + /** Returns the object with the settings used for calls to submitJobAsOperation. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + submitJobAsOperationOperationSettings() { + return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationOperationSettings(); + } + /** Returns the object with the settings used for calls to getJob. */ public UnaryCallSettings getJobSettings() { return ((JobControllerStubSettings) getStubSettings()).getJobSettings(); @@ -101,19 +114,6 @@ public UnaryCallSettings deleteJobSettings() { return ((JobControllerStubSettings) getStubSettings()).deleteJobSettings(); } - /** Returns the object with the settings used for calls to submitJobAsOperation. */ - public UnaryCallSettings submitJobAsOperationSettings() { - return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationSettings(); - } - - /** Returns the object with the settings used for calls to submitJobAsOperation. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - submitJobAsOperationOperationSettings() { - return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationOperationSettings(); - } - public static final JobControllerSettings create(JobControllerStubSettings stub) throws IOException { return new JobControllerSettings.Builder(stub.toBuilder()).build(); @@ -216,6 +216,19 @@ public UnaryCallSettings.Builder submitJobSettings() { return getStubSettingsBuilder().submitJobSettings(); } + /** Returns the builder for the settings used for calls to submitJobAsOperation. */ + public UnaryCallSettings.Builder submitJobAsOperationSettings() { + return getStubSettingsBuilder().submitJobAsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to submitJobAsOperation. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + submitJobAsOperationOperationSettings() { + return getStubSettingsBuilder().submitJobAsOperationOperationSettings(); + } + /** Returns the builder for the settings used for calls to getJob. */ public UnaryCallSettings.Builder getJobSettings() { return getStubSettingsBuilder().getJobSettings(); @@ -242,19 +255,6 @@ public UnaryCallSettings.Builder deleteJobSettings() { return getStubSettingsBuilder().deleteJobSettings(); } - /** Returns the builder for the settings used for calls to submitJobAsOperation. */ - public UnaryCallSettings.Builder submitJobAsOperationSettings() { - return getStubSettingsBuilder().submitJobAsOperationSettings(); - } - - /** Returns the builder for the settings used for calls to submitJobAsOperation. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - submitJobAsOperationOperationSettings() { - return getStubSettingsBuilder().submitJobAsOperationOperationSettings(); - } - @Override public JobControllerSettings build() throws IOException { return new JobControllerSettings(this); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java index ec3d964c..87932168 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java @@ -177,261 +177,250 @@ public final OperationsClient getOperationsClient() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates new workflow template. + * Instantiates a template and begins execution. * - *

Sample code: + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. * - *


-   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
-   * }
-   * 
+ *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * - * @param parent Required. The resource name of the region or location, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,create`, the resource name of the region - * has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.create`, the resource name of the - * location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The Dataproc workflow template to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final WorkflowTemplate createWorkflowTemplate( - RegionName parent, WorkflowTemplate template) { - CreateWorkflowTemplateRequest request = - CreateWorkflowTemplateRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setTemplate(template) - .build(); - return createWorkflowTemplate(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates new workflow template. + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
    * }
    * 
* - * @param parent Required. The resource name of the region or location, as described in + * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,create`, the resource name of the region - * has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.create`, the resource name of the - * location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The Dataproc workflow template to create. + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate createWorkflowTemplate( - LocationName parent, WorkflowTemplate template) { - CreateWorkflowTemplateRequest request = - CreateWorkflowTemplateRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setTemplate(template) + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + WorkflowTemplateName name) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() + .setName(name == null ? null : name.toString()) .build(); - return createWorkflowTemplate(request); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates new workflow template. + * Instantiates a template and begins execution. * - *

Sample code: + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. * - *


-   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent.toString(), template);
-   * }
-   * 
+ *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * - * @param parent Required. The resource name of the region or location, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,create`, the resource name of the region - * has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.create`, the resource name of the - * location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The Dataproc workflow template to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) { - CreateWorkflowTemplateRequest request = - CreateWorkflowTemplateRequest.newBuilder().setParent(parent).setTemplate(template).build(); - return createWorkflowTemplate(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates new workflow template. + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
-   *     .build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request);
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name Required. The resource name of the workflow template, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request) { - return createWorkflowTemplateCallable().call(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + String name) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder().setName(name).build(); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates new workflow template. + * Instantiates a template and begins execution. * - *

Sample code: + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. * - *


-   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
-   *     .build();
-   *   ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request);
-   *   // Do something
-   *   WorkflowTemplate response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - createWorkflowTemplateCallable() { - return stub.createWorkflowTemplateCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Retrieves the latest workflow template. + *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * - *

Can retrieve previously instantiated template by specifying optional version parameter. + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
+   *   Map<String, String> parameters = new HashMap<>();
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
    * }
    * 
* * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @param parameters Optional. Map from parameter names to values that should be used for those + * parameters. Values may not exceed 100 characters. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) { - GetWorkflowTemplateRequest request = - GetWorkflowTemplateRequest.newBuilder() + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + WorkflowTemplateName name, Map parameters) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() .setName(name == null ? null : name.toString()) + .putAllParameters(parameters) .build(); - return getWorkflowTemplate(request); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the latest workflow template. + * Instantiates a template and begins execution. * - *

Can retrieve previously instantiated template by specifying optional version parameter. + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. + * + *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + * + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
+   *   Map<String, String> parameters = new HashMap<>();
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
    * }
    * 
* * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @param parameters Optional. Map from parameter names to values that should be used for those + * parameters. Values may not exceed 100 characters. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate getWorkflowTemplate(String name) { - GetWorkflowTemplateRequest request = - GetWorkflowTemplateRequest.newBuilder().setName(name).build(); - return getWorkflowTemplate(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + String name, Map parameters) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() + .setName(name) + .putAllParameters(parameters) + .build(); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the latest workflow template. - * - *

Can retrieve previously instantiated template by specifying optional version parameter. + * Instantiates a template and begins execution. * - *

Sample code: + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. * - *


-   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
-   * }
-   * 
+ *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * - * @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 WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request) { - return getWorkflowTemplateCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Retrieves the latest workflow template. + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). * - *

Can retrieve previously instantiated template by specifying optional version parameter. + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
-   *   // Do something
-   *   WorkflowTemplate response = future.get();
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get();
    * }
    * 
+ * + * @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 UnaryCallable - getWorkflowTemplateCallable() { - return stub.getWorkflowTemplateCallable(); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + InstantiateWorkflowTemplateRequest request) { + return instantiateWorkflowTemplateOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -459,29 +448,19 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req *

    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
+   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateWorkflowTemplateOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param name Required. The resource name of the workflow template, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - WorkflowTemplateName name) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return instantiateWorkflowTemplateAsync(request); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + instantiateWorkflowTemplateOperationCallable() { + return stub.instantiateWorkflowTemplateOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -509,33 +488,29 @@ public final OperationFuture instantiateWorkflowTemplat *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
+   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param name Required. The resource name of the workflow template, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - String name) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder().setName(name).build(); - return instantiateWorkflowTemplateAsync(request); + public final UnaryCallable + instantiateWorkflowTemplateCallable() { + return stub.instantiateWorkflowTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -556,40 +531,42 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   Map<String, String> parameters = new HashMap<>();
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
    * }
    * 
* - * @param name Required. The resource name of the workflow template, as described in + * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @param parameters Optional. Map from parameter names to values that should be used for those - * parameters. Values may not exceed 100 characters. + *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of + * the region has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of + * the location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The workflow template to instantiate. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - WorkflowTemplateName name, Map parameters) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .putAllParameters(parameters) + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + RegionName parent, WorkflowTemplate template) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTemplate(template) .build(); - return instantiateWorkflowTemplateAsync(request); + return instantiateInlineWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -610,40 +587,42 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   Map<String, String> parameters = new HashMap<>();
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
    * }
    * 
* - * @param name Required. The resource name of the workflow template, as described in + * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @param parameters Optional. Map from parameter names to values that should be used for those - * parameters. Values may not exceed 100 characters. + *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of + * the region has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of + * the location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The workflow template to instantiate. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - String name, Map parameters) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder() - .setName(name) - .putAllParameters(parameters) + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + LocationName parent, WorkflowTemplate template) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTemplate(template) .build(); - return instantiateWorkflowTemplateAsync(request); + return instantiateInlineWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -664,28 +643,42 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get();
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent.toString(), template).get();
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param parent Required. The resource name of the region or location, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of + * the region has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of + * the location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The workflow template to instantiate. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - InstantiateWorkflowTemplateRequest request) { - return instantiateWorkflowTemplateOperationCallable().futureCall(request); + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + String parent, WorkflowTemplate template) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(parent) + .setTemplate(template) + .build(); + return instantiateInlineWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -706,26 +699,35 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
-   *     .setName(name.toString())
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setTemplate(template)
    *     .build();
-   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateWorkflowTemplateOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(request).get();
    * }
    * 
+ * + * @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 */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - instantiateWorkflowTemplateOperationCallable() { - return stub.instantiateWorkflowTemplateOperationCallable(); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + InstantiateInlineWorkflowTemplateRequest request) { + return instantiateInlineWorkflowTemplateOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -746,19 +748,22 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
-   *     .setName(name.toString())
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setTemplate(template)
    *     .build();
-   *   ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
+   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ - public final UnaryCallable - instantiateWorkflowTemplateCallable() { - return stub.instantiateWorkflowTemplateCallable(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + instantiateInlineWorkflowTemplateOperationCallable() { + return stub.instantiateInlineWorkflowTemplateOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -792,111 +797,119 @@ public final OperationFuture instantiateWorkflowTemplat * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) { * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder() + * .setParent(parent.toString()) + * .setTemplate(template) + * .build(); + * ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateCallable().futureCall(request); + * // Do something + * future.get(); + * } + *
+ */ + public final UnaryCallable + instantiateInlineWorkflowTemplateCallable() { + return stub.instantiateInlineWorkflowTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new workflow template. + * + *

Sample code: + * + *


+   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
    * }
    * 
* * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of - * the region has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of - * the location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The workflow template to instantiate. + *

* For `projects.regions.workflowTemplates,create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.create`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The Dataproc workflow template to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( + public final WorkflowTemplate createWorkflowTemplate( RegionName parent, WorkflowTemplate template) { - InstantiateInlineWorkflowTemplateRequest request = - InstantiateInlineWorkflowTemplateRequest.newBuilder() + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setTemplate(template) .build(); - return instantiateInlineWorkflowTemplateAsync(request); + return createWorkflowTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. - * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. - * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. + * Creates new workflow template. * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + *

Sample code: * - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + *


+   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+   * }
+   * 
* - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + * @param parent Required. The resource name of the region or location, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates,create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.create`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The Dataproc workflow template to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkflowTemplate createWorkflowTemplate( + LocationName parent, WorkflowTemplate template) { + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTemplate(template) + .build(); + return createWorkflowTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new workflow template. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
    *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent.toString(), template);
    * }
    * 
* * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of - * the region has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of - * the location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The workflow template to instantiate. + *

* For `projects.regions.workflowTemplates,create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.create`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The Dataproc workflow template to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( - LocationName parent, WorkflowTemplate template) { - InstantiateInlineWorkflowTemplateRequest request = - InstantiateInlineWorkflowTemplateRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setTemplate(template) - .build(); - return instantiateInlineWorkflowTemplateAsync(request); + public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) { + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder().setParent(parent).setTemplate(template).build(); + return createWorkflowTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. - * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. - * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. - * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. - * - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + * Creates new workflow template. * *

Sample code: * @@ -904,55 +917,24 @@ public final OperationFuture instantiateInlineWorkflowT * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) { * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent.toString(), template).get(); + * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder() + * .setParent(parent.toString()) + * .setTemplate(template) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request); * } * * - * @param parent Required. The resource name of the region or location, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of - * the region has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of - * the location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The workflow template to instantiate. + * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( - String parent, WorkflowTemplate template) { - InstantiateInlineWorkflowTemplateRequest request = - InstantiateInlineWorkflowTemplateRequest.newBuilder() - .setParent(parent) - .setTemplate(template) - .build(); - return instantiateInlineWorkflowTemplateAsync(request); + public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request) { + return createWorkflowTemplateCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. - * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. - * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. - * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. - * - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + * Creates new workflow template. * *

Sample code: * @@ -960,115 +942,133 @@ public final OperationFuture instantiateInlineWorkflowT * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) { * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder() + * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder() * .setParent(parent.toString()) * .setTemplate(template) * .build(); - * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(request).get(); + * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request); + * // Do something + * WorkflowTemplate response = future.get(); * } * - * - * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( - InstantiateInlineWorkflowTemplateRequest request) { - return instantiateInlineWorkflowTemplateOperationCallable().futureCall(request); + public final UnaryCallable + createWorkflowTemplateCallable() { + return stub.createWorkflowTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. + * Retrieves the latest workflow template. * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. + *

Sample code: * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + *


+   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
+   * }
+   * 
* - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * @param name Required. The resource name of the workflow template, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) { + GetWorkflowTemplateRequest request = + GetWorkflowTemplateRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getWorkflowTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the latest workflow template. * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
-   *     .build();
-   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
    * }
    * 
+ * + * @param name Required. The resource name of the workflow template, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - instantiateInlineWorkflowTemplateOperationCallable() { - return stub.instantiateInlineWorkflowTemplateOperationCallable(); + public final WorkflowTemplate getWorkflowTemplate(String name) { + GetWorkflowTemplateRequest request = + GetWorkflowTemplateRequest.newBuilder().setName(name).build(); + return getWorkflowTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. + * Retrieves the latest workflow template. * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. + *

Sample code: * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + *


+   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
+   * }
+   * 
* - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * @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 WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request) { + return getWorkflowTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the latest workflow template. * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateCallable().futureCall(request);
+   *   ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   WorkflowTemplate response = future.get();
    * }
    * 
*/ - public final UnaryCallable - instantiateInlineWorkflowTemplateCallable() { - return stub.instantiateInlineWorkflowTemplateCallable(); + public final UnaryCallable + getWorkflowTemplateCallable() { + return stub.getWorkflowTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java index 0752f9e3..5ddae67d 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java @@ -71,19 +71,6 @@ @BetaApi public class WorkflowTemplateServiceSettings extends ClientSettings { - /** Returns the object with the settings used for calls to createWorkflowTemplate. */ - public UnaryCallSettings - createWorkflowTemplateSettings() { - return ((WorkflowTemplateServiceStubSettings) getStubSettings()) - .createWorkflowTemplateSettings(); - } - - /** Returns the object with the settings used for calls to getWorkflowTemplate. */ - public UnaryCallSettings - getWorkflowTemplateSettings() { - return ((WorkflowTemplateServiceStubSettings) getStubSettings()).getWorkflowTemplateSettings(); - } - /** Returns the object with the settings used for calls to instantiateWorkflowTemplate. */ public UnaryCallSettings instantiateWorkflowTemplateSettings() { @@ -116,6 +103,19 @@ public class WorkflowTemplateServiceSettings .instantiateInlineWorkflowTemplateOperationSettings(); } + /** Returns the object with the settings used for calls to createWorkflowTemplate. */ + public UnaryCallSettings + createWorkflowTemplateSettings() { + return ((WorkflowTemplateServiceStubSettings) getStubSettings()) + .createWorkflowTemplateSettings(); + } + + /** Returns the object with the settings used for calls to getWorkflowTemplate. */ + public UnaryCallSettings + getWorkflowTemplateSettings() { + return ((WorkflowTemplateServiceStubSettings) getStubSettings()).getWorkflowTemplateSettings(); + } + /** Returns the object with the settings used for calls to updateWorkflowTemplate. */ public UnaryCallSettings updateWorkflowTemplateSettings() { @@ -237,18 +237,6 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to createWorkflowTemplate. */ - public UnaryCallSettings.Builder - createWorkflowTemplateSettings() { - return getStubSettingsBuilder().createWorkflowTemplateSettings(); - } - - /** Returns the builder for the settings used for calls to getWorkflowTemplate. */ - public UnaryCallSettings.Builder - getWorkflowTemplateSettings() { - return getStubSettingsBuilder().getWorkflowTemplateSettings(); - } - /** Returns the builder for the settings used for calls to instantiateWorkflowTemplate. */ public UnaryCallSettings.Builder instantiateWorkflowTemplateSettings() { @@ -279,6 +267,18 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().instantiateInlineWorkflowTemplateOperationSettings(); } + /** Returns the builder for the settings used for calls to createWorkflowTemplate. */ + public UnaryCallSettings.Builder + createWorkflowTemplateSettings() { + return getStubSettingsBuilder().createWorkflowTemplateSettings(); + } + + /** Returns the builder for the settings used for calls to getWorkflowTemplate. */ + public UnaryCallSettings.Builder + getWorkflowTemplateSettings() { + return getStubSettingsBuilder().getWorkflowTemplateSettings(); + } + /** Returns the builder for the settings used for calls to updateWorkflowTemplate. */ public UnaryCallSettings.Builder updateWorkflowTemplateSettings() { diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java index 80b05478..4072e7af 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java @@ -28,8 +28,9 @@ *
  * 
  * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
  *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- *   AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+ *   AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy);
  * }
  * 
  * 
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java index 337a677c..01685310 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java @@ -40,16 +40,16 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AutoscalingPolicyServiceStub implements BackgroundResource { - public UnaryCallable - updateAutoscalingPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: updateAutoscalingPolicyCallable()"); - } - public UnaryCallable createAutoscalingPolicyCallable() { throw new UnsupportedOperationException("Not implemented: createAutoscalingPolicyCallable()"); } + public UnaryCallable + updateAutoscalingPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: updateAutoscalingPolicyCallable()"); + } + public UnaryCallable getAutoscalingPolicyCallable() { throw new UnsupportedOperationException("Not implemented: getAutoscalingPolicyCallable()"); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java index cd4e933d..07a89b98 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java @@ -71,16 +71,16 @@ *

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 updateAutoscalingPolicy to 30 seconds: + *

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

  * 
  * AutoscalingPolicyServiceStubSettings.Builder autoscalingPolicyServiceSettingsBuilder =
  *     AutoscalingPolicyServiceStubSettings.newBuilder();
  * autoscalingPolicyServiceSettingsBuilder
- *     .updateAutoscalingPolicySettings()
+ *     .createAutoscalingPolicySettings()
  *     .setRetrySettings(
- *         autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ *         autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AutoscalingPolicyServiceStubSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
@@ -95,10 +95,10 @@ public class AutoscalingPolicyServiceStubSettings
   private static final ImmutableList DEFAULT_SERVICE_SCOPES =
       ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
 
-  private final UnaryCallSettings
-      updateAutoscalingPolicySettings;
   private final UnaryCallSettings
       createAutoscalingPolicySettings;
+  private final UnaryCallSettings
+      updateAutoscalingPolicySettings;
   private final UnaryCallSettings
       getAutoscalingPolicySettings;
   private final PagedCallSettings<
@@ -109,18 +109,18 @@ public class AutoscalingPolicyServiceStubSettings
   private final UnaryCallSettings
       deleteAutoscalingPolicySettings;
 
-  /** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
-  public UnaryCallSettings
-      updateAutoscalingPolicySettings() {
-    return updateAutoscalingPolicySettings;
-  }
-
   /** Returns the object with the settings used for calls to createAutoscalingPolicy. */
   public UnaryCallSettings
       createAutoscalingPolicySettings() {
     return createAutoscalingPolicySettings;
   }
 
+  /** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
+  public UnaryCallSettings
+      updateAutoscalingPolicySettings() {
+    return updateAutoscalingPolicySettings;
+  }
+
   /** Returns the object with the settings used for calls to getAutoscalingPolicy. */
   public UnaryCallSettings
       getAutoscalingPolicySettings() {
@@ -211,8 +211,8 @@ public Builder toBuilder() {
   protected AutoscalingPolicyServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    updateAutoscalingPolicySettings = settingsBuilder.updateAutoscalingPolicySettings().build();
     createAutoscalingPolicySettings = settingsBuilder.createAutoscalingPolicySettings().build();
+    updateAutoscalingPolicySettings = settingsBuilder.updateAutoscalingPolicySettings().build();
     getAutoscalingPolicySettings = settingsBuilder.getAutoscalingPolicySettings().build();
     listAutoscalingPoliciesSettings = settingsBuilder.listAutoscalingPoliciesSettings().build();
     deleteAutoscalingPolicySettings = settingsBuilder.deleteAutoscalingPolicySettings().build();
@@ -295,10 +295,10 @@ public static class Builder
       extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder
-        updateAutoscalingPolicySettings;
     private final UnaryCallSettings.Builder
         createAutoscalingPolicySettings;
+    private final UnaryCallSettings.Builder
+        updateAutoscalingPolicySettings;
     private final UnaryCallSettings.Builder
         getAutoscalingPolicySettings;
     private final PagedCallSettings.Builder<
@@ -316,11 +316,43 @@ public static class Builder
       ImmutableMap.Builder> definitions =
           ImmutableMap.builder();
       definitions.put(
-          "idempotent",
+          "retry_policy_4_codes",
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED,
+                  StatusCode.Code.INTERNAL,
+                  StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "retry_policy_1_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
                   StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+      definitions.put(
+          "retry_policy_6_codes",
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.INTERNAL,
+                  StatusCode.Code.DEADLINE_EXCEEDED,
+                  StatusCode.Code.UNAVAILABLE)));
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
+      definitions.put(
+          "retry_policy_3_codes",
+          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "retry_policy_2_codes",
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED,
+                  StatusCode.Code.INTERNAL,
+                  StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList()));
+      definitions.put(
+          "retry_policy_5_codes",
+          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "retry_policy_7_codes",
+          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -334,12 +366,88 @@ public static class Builder
               .setInitialRetryDelay(Duration.ofMillis(100L))
               .setRetryDelayMultiplier(1.3)
               .setMaxRetryDelay(Duration.ofMillis(60000L))
-              .setInitialRpcTimeout(Duration.ofMillis(20000L))
+              .setInitialRpcTimeout(Duration.ofMillis(600000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(600000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
+      definitions.put("retry_policy_1_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(600000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(600000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
+      definitions.put("retry_policy_3_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(900000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(900000L))
+              .setTotalTimeout(Duration.ofMillis(900000L))
+              .build();
+      definitions.put("retry_policy_2_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(300000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(300000L))
+              .setTotalTimeout(Duration.ofMillis(300000L))
+              .build();
+      definitions.put("retry_policy_6_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(900000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(900000L))
+              .setTotalTimeout(Duration.ofMillis(900000L))
+              .build();
+      definitions.put("retry_policy_7_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(300000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(300000L))
+              .setTotalTimeout(Duration.ofMillis(300000L))
+              .build();
+      definitions.put("retry_policy_5_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(600000L))
               .setRpcTimeoutMultiplier(1.0)
-              .setMaxRpcTimeout(Duration.ofMillis(20000L))
+              .setMaxRpcTimeout(Duration.ofMillis(600000L))
               .setTotalTimeout(Duration.ofMillis(600000L))
               .build();
-      definitions.put("default", settings);
+      definitions.put("retry_policy_4_params", settings);
+      settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
+      definitions.put("no_retry_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRpcTimeout(Duration.ofMillis(600000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(600000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
+      definitions.put("no_retry_1_params", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
 
@@ -350,10 +458,10 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      updateAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       createAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
+      updateAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       getAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       listAutoscalingPoliciesSettings =
@@ -363,8 +471,8 @@ protected Builder(ClientContext clientContext) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              updateAutoscalingPolicySettings,
               createAutoscalingPolicySettings,
+              updateAutoscalingPolicySettings,
               getAutoscalingPolicySettings,
               listAutoscalingPoliciesSettings,
               deleteAutoscalingPolicySettings);
@@ -384,29 +492,29 @@ private static Builder createDefault() {
     private static Builder initDefaults(Builder builder) {
 
       builder
-          .updateAutoscalingPolicySettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .createAutoscalingPolicySettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
 
       builder
-          .createAutoscalingPolicySettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .updateAutoscalingPolicySettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
 
       builder
           .getAutoscalingPolicySettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
 
       builder
           .listAutoscalingPoliciesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
 
       builder
           .deleteAutoscalingPolicySettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
 
       return builder;
     }
@@ -414,16 +522,16 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(AutoscalingPolicyServiceStubSettings settings) {
       super(settings);
 
-      updateAutoscalingPolicySettings = settings.updateAutoscalingPolicySettings.toBuilder();
       createAutoscalingPolicySettings = settings.createAutoscalingPolicySettings.toBuilder();
+      updateAutoscalingPolicySettings = settings.updateAutoscalingPolicySettings.toBuilder();
       getAutoscalingPolicySettings = settings.getAutoscalingPolicySettings.toBuilder();
       listAutoscalingPoliciesSettings = settings.listAutoscalingPoliciesSettings.toBuilder();
       deleteAutoscalingPolicySettings = settings.deleteAutoscalingPolicySettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              updateAutoscalingPolicySettings,
               createAutoscalingPolicySettings,
+              updateAutoscalingPolicySettings,
               getAutoscalingPolicySettings,
               listAutoscalingPoliciesSettings,
               deleteAutoscalingPolicySettings);
@@ -445,18 +553,18 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
-    /** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
-    public UnaryCallSettings.Builder
-        updateAutoscalingPolicySettings() {
-      return updateAutoscalingPolicySettings;
-    }
-
     /** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
     public UnaryCallSettings.Builder
         createAutoscalingPolicySettings() {
       return createAutoscalingPolicySettings;
     }
 
+    /** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
+    public UnaryCallSettings.Builder
+        updateAutoscalingPolicySettings() {
+      return updateAutoscalingPolicySettings;
+    }
+
     /** Returns the builder for the settings used for calls to getAutoscalingPolicy. */
     public UnaryCallSettings.Builder
         getAutoscalingPolicySettings() {
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
index 22ef81f4..7655c576 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
@@ -81,6 +81,16 @@ public UnaryCallable deleteClusterCallable() {
     throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()");
   }
 
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallable
+      diagnoseClusterOperationCallable() {
+    throw new UnsupportedOperationException("Not implemented: diagnoseClusterOperationCallable()");
+  }
+
+  public UnaryCallable diagnoseClusterCallable() {
+    throw new UnsupportedOperationException("Not implemented: diagnoseClusterCallable()");
+  }
+
   public UnaryCallable getClusterCallable() {
     throw new UnsupportedOperationException("Not implemented: getClusterCallable()");
   }
@@ -93,16 +103,6 @@ public UnaryCallable listClustersCall
     throw new UnsupportedOperationException("Not implemented: listClustersCallable()");
   }
 
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallable
-      diagnoseClusterOperationCallable() {
-    throw new UnsupportedOperationException("Not implemented: diagnoseClusterOperationCallable()");
-  }
-
-  public UnaryCallable diagnoseClusterCallable() {
-    throw new UnsupportedOperationException("Not implemented: diagnoseClusterCallable()");
-  }
-
   @Override
   public abstract void close();
 }
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
index 57b70882..2c027450 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
@@ -111,13 +111,13 @@ public class ClusterControllerStubSettings extends StubSettings deleteClusterSettings;
   private final OperationCallSettings
       deleteClusterOperationSettings;
+  private final UnaryCallSettings diagnoseClusterSettings;
+  private final OperationCallSettings
+      diagnoseClusterOperationSettings;
   private final UnaryCallSettings getClusterSettings;
   private final PagedCallSettings<
           ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
       listClustersSettings;
-  private final UnaryCallSettings diagnoseClusterSettings;
-  private final OperationCallSettings
-      diagnoseClusterOperationSettings;
 
   /** Returns the object with the settings used for calls to createCluster. */
   public UnaryCallSettings createClusterSettings() {
@@ -155,17 +155,6 @@ public UnaryCallSettings deleteClusterSettings(
     return deleteClusterOperationSettings;
   }
 
-  /** Returns the object with the settings used for calls to getCluster. */
-  public UnaryCallSettings getClusterSettings() {
-    return getClusterSettings;
-  }
-
-  /** Returns the object with the settings used for calls to listClusters. */
-  public PagedCallSettings
-      listClustersSettings() {
-    return listClustersSettings;
-  }
-
   /** Returns the object with the settings used for calls to diagnoseCluster. */
   public UnaryCallSettings diagnoseClusterSettings() {
     return diagnoseClusterSettings;
@@ -178,6 +167,17 @@ public UnaryCallSettings diagnoseClusterSetti
     return diagnoseClusterOperationSettings;
   }
 
+  /** Returns the object with the settings used for calls to getCluster. */
+  public UnaryCallSettings getClusterSettings() {
+    return getClusterSettings;
+  }
+
+  /** Returns the object with the settings used for calls to listClusters. */
+  public PagedCallSettings
+      listClustersSettings() {
+    return listClustersSettings;
+  }
+
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ClusterControllerStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -253,10 +253,10 @@ protected ClusterControllerStubSettings(Builder settingsBuilder) throws IOExcept
     updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build();
     deleteClusterSettings = settingsBuilder.deleteClusterSettings().build();
     deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build();
-    getClusterSettings = settingsBuilder.getClusterSettings().build();
-    listClustersSettings = settingsBuilder.listClustersSettings().build();
     diagnoseClusterSettings = settingsBuilder.diagnoseClusterSettings().build();
     diagnoseClusterOperationSettings = settingsBuilder.diagnoseClusterOperationSettings().build();
+    getClusterSettings = settingsBuilder.getClusterSettings().build();
+    listClustersSettings = settingsBuilder.listClustersSettings().build();
   }
 
   private static final PagedListDescriptor
@@ -328,15 +328,15 @@ public static class Builder extends StubSettings.Builder
         deleteClusterOperationSettings;
-    private final UnaryCallSettings.Builder getClusterSettings;
-    private final PagedCallSettings.Builder<
-            ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
-        listClustersSettings;
     private final UnaryCallSettings.Builder
         diagnoseClusterSettings;
     private final OperationCallSettings.Builder<
             DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
         diagnoseClusterOperationSettings;
+    private final UnaryCallSettings.Builder getClusterSettings;
+    private final PagedCallSettings.Builder<
+            ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+        listClustersSettings;
 
     private static final ImmutableMap>
         RETRYABLE_CODE_DEFINITIONS;
@@ -345,14 +345,15 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
       definitions.put(
-          "idempotent",
+          "retry_policy_6_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
-                  StatusCode.Code.DEADLINE_EXCEEDED,
                   StatusCode.Code.INTERNAL,
+                  StatusCode.Code.DEADLINE_EXCEEDED,
                   StatusCode.Code.UNAVAILABLE)));
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       definitions.put(
-          "non_idempotent",
+          "retry_policy_5_codes",
           ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
@@ -367,12 +368,25 @@ public static class Builder extends StubSettings.Builder>of(
               createClusterSettings,
               updateClusterSettings,
               deleteClusterSettings,
+              diagnoseClusterSettings,
               getClusterSettings,
-              listClustersSettings,
-              diagnoseClusterSettings);
+              listClustersSettings);
 
       initDefaults(this);
     }
@@ -428,40 +442,40 @@ private static Builder initDefaults(Builder builder) {
 
       builder
           .createClusterSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));
 
       builder
           .updateClusterSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));
 
       builder
           .deleteClusterSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));
 
       builder
-          .getClusterSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .diagnoseClusterSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));
 
       builder
-          .listClustersSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .getClusterSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
 
       builder
-          .diagnoseClusterSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .listClustersSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
       builder
           .createClusterOperationSettings()
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
@@ -483,8 +497,8 @@ private static Builder initDefaults(Builder builder) {
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
@@ -506,8 +520,8 @@ private static Builder initDefaults(Builder builder) {
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
@@ -529,8 +543,8 @@ private static Builder initDefaults(Builder builder) {
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
@@ -560,19 +574,19 @@ protected Builder(ClusterControllerStubSettings settings) {
       updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder();
       deleteClusterSettings = settings.deleteClusterSettings.toBuilder();
       deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder();
-      getClusterSettings = settings.getClusterSettings.toBuilder();
-      listClustersSettings = settings.listClustersSettings.toBuilder();
       diagnoseClusterSettings = settings.diagnoseClusterSettings.toBuilder();
       diagnoseClusterOperationSettings = settings.diagnoseClusterOperationSettings.toBuilder();
+      getClusterSettings = settings.getClusterSettings.toBuilder();
+      listClustersSettings = settings.listClustersSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
               createClusterSettings,
               updateClusterSettings,
               deleteClusterSettings,
+              diagnoseClusterSettings,
               getClusterSettings,
-              listClustersSettings,
-              diagnoseClusterSettings);
+              listClustersSettings);
     }
 
     // NEXT_MAJOR_VER: remove 'throws Exception'
@@ -630,18 +644,6 @@ public UnaryCallSettings.Builder deleteClusterS
       return deleteClusterOperationSettings;
     }
 
-    /** Returns the builder for the settings used for calls to getCluster. */
-    public UnaryCallSettings.Builder getClusterSettings() {
-      return getClusterSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to listClusters. */
-    public PagedCallSettings.Builder<
-            ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
-        listClustersSettings() {
-      return listClustersSettings;
-    }
-
     /** Returns the builder for the settings used for calls to diagnoseCluster. */
     public UnaryCallSettings.Builder diagnoseClusterSettings() {
       return diagnoseClusterSettings;
@@ -655,6 +657,18 @@ public UnaryCallSettings.Builder diagnoseClus
       return diagnoseClusterOperationSettings;
     }
 
+    /** Returns the builder for the settings used for calls to getCluster. */
+    public UnaryCallSettings.Builder getClusterSettings() {
+      return getClusterSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to listClusters. */
+    public PagedCallSettings.Builder<
+            ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+        listClustersSettings() {
+      return listClustersSettings;
+    }
+
     @Override
     public ClusterControllerStubSettings build() throws IOException {
       return new ClusterControllerStubSettings(this);
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
index cc41ca85..c8f1fde2 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
@@ -51,16 +51,6 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceStub {
 
-  private static final MethodDescriptor
-      updateAutoscalingPolicyMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.cloud.dataproc.v1.AutoscalingPolicyService/UpdateAutoscalingPolicy")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(UpdateAutoscalingPolicyRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(AutoscalingPolicy.getDefaultInstance()))
-              .build();
   private static final MethodDescriptor
       createAutoscalingPolicyMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -71,6 +61,16 @@ public class GrpcAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceSt
                   ProtoUtils.marshaller(CreateAutoscalingPolicyRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(AutoscalingPolicy.getDefaultInstance()))
               .build();
+  private static final MethodDescriptor
+      updateAutoscalingPolicyMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.cloud.dataproc.v1.AutoscalingPolicyService/UpdateAutoscalingPolicy")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(UpdateAutoscalingPolicyRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(AutoscalingPolicy.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor
       getAutoscalingPolicyMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -107,10 +107,10 @@ public class GrpcAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceSt
 
   private final BackgroundResource backgroundResources;
 
-  private final UnaryCallable
-      updateAutoscalingPolicyCallable;
   private final UnaryCallable
       createAutoscalingPolicyCallable;
+  private final UnaryCallable
+      updateAutoscalingPolicyCallable;
   private final UnaryCallable
       getAutoscalingPolicyCallable;
   private final UnaryCallable
@@ -162,20 +162,6 @@ protected GrpcAutoscalingPolicyServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
-    GrpcCallSettings
-        updateAutoscalingPolicyTransportSettings =
-            GrpcCallSettings.newBuilder()
-                .setMethodDescriptor(updateAutoscalingPolicyMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(UpdateAutoscalingPolicyRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("policy.name", String.valueOf(request.getPolicy().getName()));
-                        return params.build();
-                      }
-                    })
-                .build();
     GrpcCallSettings
         createAutoscalingPolicyTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -190,6 +176,20 @@ public Map extract(CreateAutoscalingPolicyRequest request) {
                       }
                     })
                 .build();
+    GrpcCallSettings
+        updateAutoscalingPolicyTransportSettings =
+            GrpcCallSettings.newBuilder()
+                .setMethodDescriptor(updateAutoscalingPolicyMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(UpdateAutoscalingPolicyRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("policy.name", String.valueOf(request.getPolicy().getName()));
+                        return params.build();
+                      }
+                    })
+                .build();
     GrpcCallSettings
         getAutoscalingPolicyTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -234,16 +234,16 @@ public Map extract(DeleteAutoscalingPolicyRequest request) {
                     })
                 .build();
 
-    this.updateAutoscalingPolicyCallable =
-        callableFactory.createUnaryCallable(
-            updateAutoscalingPolicyTransportSettings,
-            settings.updateAutoscalingPolicySettings(),
-            clientContext);
     this.createAutoscalingPolicyCallable =
         callableFactory.createUnaryCallable(
             createAutoscalingPolicyTransportSettings,
             settings.createAutoscalingPolicySettings(),
             clientContext);
+    this.updateAutoscalingPolicyCallable =
+        callableFactory.createUnaryCallable(
+            updateAutoscalingPolicyTransportSettings,
+            settings.updateAutoscalingPolicySettings(),
+            clientContext);
     this.getAutoscalingPolicyCallable =
         callableFactory.createUnaryCallable(
             getAutoscalingPolicyTransportSettings,
@@ -268,16 +268,16 @@ public Map extract(DeleteAutoscalingPolicyRequest request) {
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
-  public UnaryCallable
-      updateAutoscalingPolicyCallable() {
-    return updateAutoscalingPolicyCallable;
-  }
-
   public UnaryCallable
       createAutoscalingPolicyCallable() {
     return createAutoscalingPolicyCallable;
   }
 
+  public UnaryCallable
+      updateAutoscalingPolicyCallable() {
+    return updateAutoscalingPolicyCallable;
+  }
+
   public UnaryCallable
       getAutoscalingPolicyCallable() {
     return getAutoscalingPolicyCallable;
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java
index 8b445048..33d2b574 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java
@@ -81,6 +81,15 @@ public class GrpcClusterControllerStub extends ClusterControllerStub {
                   ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
               .build();
+  private static final MethodDescriptor
+      diagnoseClusterMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName("google.cloud.dataproc.v1.ClusterController/DiagnoseCluster")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(DiagnoseClusterRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor getClusterMethodDescriptor =
       MethodDescriptor.newBuilder()
           .setType(MethodDescriptor.MethodType.UNARY)
@@ -97,15 +106,6 @@ public class GrpcClusterControllerStub extends ClusterControllerStub {
               .setResponseMarshaller(
                   ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor
-      diagnoseClusterMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName("google.cloud.dataproc.v1.ClusterController/DiagnoseCluster")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(DiagnoseClusterRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
-              .build();
 
   private final BackgroundResource backgroundResources;
   private final GrpcOperationsStub operationsStub;
@@ -119,13 +119,13 @@ public class GrpcClusterControllerStub extends ClusterControllerStub {
   private final UnaryCallable deleteClusterCallable;
   private final OperationCallable
       deleteClusterOperationCallable;
+  private final UnaryCallable diagnoseClusterCallable;
+  private final OperationCallable
+      diagnoseClusterOperationCallable;
   private final UnaryCallable getClusterCallable;
   private final UnaryCallable listClustersCallable;
   private final UnaryCallable
       listClustersPagedCallable;
-  private final UnaryCallable diagnoseClusterCallable;
-  private final OperationCallable
-      diagnoseClusterOperationCallable;
 
   private final GrpcStubCallableFactory callableFactory;
 
@@ -181,6 +181,10 @@ protected GrpcClusterControllerStub(
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(deleteClusterMethodDescriptor)
             .build();
+    GrpcCallSettings diagnoseClusterTransportSettings =
+        GrpcCallSettings.newBuilder()
+            .setMethodDescriptor(diagnoseClusterMethodDescriptor)
+            .build();
     GrpcCallSettings getClusterTransportSettings =
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(getClusterMethodDescriptor)
@@ -189,10 +193,6 @@ protected GrpcClusterControllerStub(
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(listClustersMethodDescriptor)
             .build();
-    GrpcCallSettings diagnoseClusterTransportSettings =
-        GrpcCallSettings.newBuilder()
-            .setMethodDescriptor(diagnoseClusterMethodDescriptor)
-            .build();
 
     this.createClusterCallable =
         callableFactory.createUnaryCallable(
@@ -221,15 +221,6 @@ protected GrpcClusterControllerStub(
             settings.deleteClusterOperationSettings(),
             clientContext,
             this.operationsStub);
-    this.getClusterCallable =
-        callableFactory.createUnaryCallable(
-            getClusterTransportSettings, settings.getClusterSettings(), clientContext);
-    this.listClustersCallable =
-        callableFactory.createUnaryCallable(
-            listClustersTransportSettings, settings.listClustersSettings(), clientContext);
-    this.listClustersPagedCallable =
-        callableFactory.createPagedCallable(
-            listClustersTransportSettings, settings.listClustersSettings(), clientContext);
     this.diagnoseClusterCallable =
         callableFactory.createUnaryCallable(
             diagnoseClusterTransportSettings, settings.diagnoseClusterSettings(), clientContext);
@@ -239,6 +230,15 @@ protected GrpcClusterControllerStub(
             settings.diagnoseClusterOperationSettings(),
             clientContext,
             this.operationsStub);
+    this.getClusterCallable =
+        callableFactory.createUnaryCallable(
+            getClusterTransportSettings, settings.getClusterSettings(), clientContext);
+    this.listClustersCallable =
+        callableFactory.createUnaryCallable(
+            listClustersTransportSettings, settings.listClustersSettings(), clientContext);
+    this.listClustersPagedCallable =
+        callableFactory.createPagedCallable(
+            listClustersTransportSettings, settings.listClustersSettings(), clientContext);
 
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
@@ -278,6 +278,16 @@ public UnaryCallable deleteClusterCallable() {
     return deleteClusterCallable;
   }
 
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallable
+      diagnoseClusterOperationCallable() {
+    return diagnoseClusterOperationCallable;
+  }
+
+  public UnaryCallable diagnoseClusterCallable() {
+    return diagnoseClusterCallable;
+  }
+
   public UnaryCallable getClusterCallable() {
     return getClusterCallable;
   }
@@ -290,16 +300,6 @@ public UnaryCallable listClustersCall
     return listClustersCallable;
   }
 
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallable
-      diagnoseClusterOperationCallable() {
-    return diagnoseClusterOperationCallable;
-  }
-
-  public UnaryCallable diagnoseClusterCallable() {
-    return diagnoseClusterCallable;
-  }
-
   @Override
   public final void close() {
     shutdown();
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java
index b12016cf..294bcfb4 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java
@@ -60,6 +60,14 @@ public class GrpcJobControllerStub extends JobControllerStub {
           .setRequestMarshaller(ProtoUtils.marshaller(SubmitJobRequest.getDefaultInstance()))
           .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance()))
           .build();
+  private static final MethodDescriptor
+      submitJobAsOperationMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName("google.cloud.dataproc.v1.JobController/SubmitJobAsOperation")
+              .setRequestMarshaller(ProtoUtils.marshaller(SubmitJobRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor getJobMethodDescriptor =
       MethodDescriptor.newBuilder()
           .setType(MethodDescriptor.MethodType.UNARY)
@@ -96,28 +104,20 @@ public class GrpcJobControllerStub extends JobControllerStub {
           .setRequestMarshaller(ProtoUtils.marshaller(DeleteJobRequest.getDefaultInstance()))
           .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
           .build();
-  private static final MethodDescriptor
-      submitJobAsOperationMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName("google.cloud.dataproc.v1.JobController/SubmitJobAsOperation")
-              .setRequestMarshaller(ProtoUtils.marshaller(SubmitJobRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
-              .build();
 
   private final BackgroundResource backgroundResources;
   private final GrpcOperationsStub operationsStub;
 
   private final UnaryCallable submitJobCallable;
+  private final UnaryCallable submitJobAsOperationCallable;
+  private final OperationCallable
+      submitJobAsOperationOperationCallable;
   private final UnaryCallable getJobCallable;
   private final UnaryCallable listJobsCallable;
   private final UnaryCallable listJobsPagedCallable;
   private final UnaryCallable updateJobCallable;
   private final UnaryCallable cancelJobCallable;
   private final UnaryCallable deleteJobCallable;
-  private final UnaryCallable submitJobAsOperationCallable;
-  private final OperationCallable
-      submitJobAsOperationOperationCallable;
 
   private final GrpcStubCallableFactory callableFactory;
 
@@ -163,6 +163,10 @@ protected GrpcJobControllerStub(
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(submitJobMethodDescriptor)
             .build();
+    GrpcCallSettings submitJobAsOperationTransportSettings =
+        GrpcCallSettings.newBuilder()
+            .setMethodDescriptor(submitJobAsOperationMethodDescriptor)
+            .build();
     GrpcCallSettings getJobTransportSettings =
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(getJobMethodDescriptor)
@@ -183,14 +187,21 @@ protected GrpcJobControllerStub(
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(deleteJobMethodDescriptor)
             .build();
-    GrpcCallSettings submitJobAsOperationTransportSettings =
-        GrpcCallSettings.newBuilder()
-            .setMethodDescriptor(submitJobAsOperationMethodDescriptor)
-            .build();
 
     this.submitJobCallable =
         callableFactory.createUnaryCallable(
             submitJobTransportSettings, settings.submitJobSettings(), clientContext);
+    this.submitJobAsOperationCallable =
+        callableFactory.createUnaryCallable(
+            submitJobAsOperationTransportSettings,
+            settings.submitJobAsOperationSettings(),
+            clientContext);
+    this.submitJobAsOperationOperationCallable =
+        callableFactory.createOperationCallable(
+            submitJobAsOperationTransportSettings,
+            settings.submitJobAsOperationOperationSettings(),
+            clientContext,
+            this.operationsStub);
     this.getJobCallable =
         callableFactory.createUnaryCallable(
             getJobTransportSettings, settings.getJobSettings(), clientContext);
@@ -209,17 +220,6 @@ protected GrpcJobControllerStub(
     this.deleteJobCallable =
         callableFactory.createUnaryCallable(
             deleteJobTransportSettings, settings.deleteJobSettings(), clientContext);
-    this.submitJobAsOperationCallable =
-        callableFactory.createUnaryCallable(
-            submitJobAsOperationTransportSettings,
-            settings.submitJobAsOperationSettings(),
-            clientContext);
-    this.submitJobAsOperationOperationCallable =
-        callableFactory.createOperationCallable(
-            submitJobAsOperationTransportSettings,
-            settings.submitJobAsOperationOperationSettings(),
-            clientContext,
-            this.operationsStub);
 
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
@@ -233,6 +233,16 @@ public UnaryCallable submitJobCallable() {
     return submitJobCallable;
   }
 
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallable
+      submitJobAsOperationOperationCallable() {
+    return submitJobAsOperationOperationCallable;
+  }
+
+  public UnaryCallable submitJobAsOperationCallable() {
+    return submitJobAsOperationCallable;
+  }
+
   public UnaryCallable getJobCallable() {
     return getJobCallable;
   }
@@ -257,16 +267,6 @@ public UnaryCallable deleteJobCallable() {
     return deleteJobCallable;
   }
 
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallable
-      submitJobAsOperationOperationCallable() {
-    return submitJobAsOperationOperationCallable;
-  }
-
-  public UnaryCallable submitJobAsOperationCallable() {
-    return submitJobAsOperationCallable;
-  }
-
   @Override
   public final void close() {
     shutdown();
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java
index 03000773..7fb984c3 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java
@@ -57,26 +57,6 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub {
 
-  private static final MethodDescriptor
-      createWorkflowTemplateMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.cloud.dataproc.v1.WorkflowTemplateService/CreateWorkflowTemplate")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(CreateWorkflowTemplateRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance()))
-              .build();
-  private static final MethodDescriptor
-      getWorkflowTemplateMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.cloud.dataproc.v1.WorkflowTemplateService/GetWorkflowTemplate")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(GetWorkflowTemplateRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance()))
-              .build();
   private static final MethodDescriptor
       instantiateWorkflowTemplateMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -98,6 +78,26 @@ public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub
                       InstantiateInlineWorkflowTemplateRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
               .build();
+  private static final MethodDescriptor
+      createWorkflowTemplateMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.cloud.dataproc.v1.WorkflowTemplateService/CreateWorkflowTemplate")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(CreateWorkflowTemplateRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance()))
+              .build();
+  private static final MethodDescriptor
+      getWorkflowTemplateMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.cloud.dataproc.v1.WorkflowTemplateService/GetWorkflowTemplate")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(GetWorkflowTemplateRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor
       updateWorkflowTemplateMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -133,10 +133,6 @@ public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub
   private final BackgroundResource backgroundResources;
   private final GrpcOperationsStub operationsStub;
 
-  private final UnaryCallable
-      createWorkflowTemplateCallable;
-  private final UnaryCallable
-      getWorkflowTemplateCallable;
   private final UnaryCallable
       instantiateWorkflowTemplateCallable;
   private final OperationCallable
@@ -145,6 +141,10 @@ public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub
       instantiateInlineWorkflowTemplateCallable;
   private final OperationCallable
       instantiateInlineWorkflowTemplateOperationCallable;
+  private final UnaryCallable
+      createWorkflowTemplateCallable;
+  private final UnaryCallable
+      getWorkflowTemplateCallable;
   private final UnaryCallable
       updateWorkflowTemplateCallable;
   private final UnaryCallable
@@ -196,34 +196,6 @@ protected GrpcWorkflowTemplateServiceStub(
     this.callableFactory = callableFactory;
     this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
 
-    GrpcCallSettings
-        createWorkflowTemplateTransportSettings =
-            GrpcCallSettings.newBuilder()
-                .setMethodDescriptor(createWorkflowTemplateMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(CreateWorkflowTemplateRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("parent", String.valueOf(request.getParent()));
-                        return params.build();
-                      }
-                    })
-                .build();
-    GrpcCallSettings
-        getWorkflowTemplateTransportSettings =
-            GrpcCallSettings.newBuilder()
-                .setMethodDescriptor(getWorkflowTemplateMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(GetWorkflowTemplateRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("name", String.valueOf(request.getName()));
-                        return params.build();
-                      }
-                    })
-                .build();
     GrpcCallSettings
         instantiateWorkflowTemplateTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -254,6 +226,34 @@ public Map extract(
                       }
                     })
                 .build();
+    GrpcCallSettings
+        createWorkflowTemplateTransportSettings =
+            GrpcCallSettings.newBuilder()
+                .setMethodDescriptor(createWorkflowTemplateMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(CreateWorkflowTemplateRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("parent", String.valueOf(request.getParent()));
+                        return params.build();
+                      }
+                    })
+                .build();
+    GrpcCallSettings
+        getWorkflowTemplateTransportSettings =
+            GrpcCallSettings.newBuilder()
+                .setMethodDescriptor(getWorkflowTemplateMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(GetWorkflowTemplateRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("name", String.valueOf(request.getName()));
+                        return params.build();
+                      }
+                    })
+                .build();
     GrpcCallSettings
         updateWorkflowTemplateTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -298,16 +298,6 @@ public Map extract(DeleteWorkflowTemplateRequest request) {
                 })
             .build();
 
-    this.createWorkflowTemplateCallable =
-        callableFactory.createUnaryCallable(
-            createWorkflowTemplateTransportSettings,
-            settings.createWorkflowTemplateSettings(),
-            clientContext);
-    this.getWorkflowTemplateCallable =
-        callableFactory.createUnaryCallable(
-            getWorkflowTemplateTransportSettings,
-            settings.getWorkflowTemplateSettings(),
-            clientContext);
     this.instantiateWorkflowTemplateCallable =
         callableFactory.createUnaryCallable(
             instantiateWorkflowTemplateTransportSettings,
@@ -330,6 +320,16 @@ public Map extract(DeleteWorkflowTemplateRequest request) {
             settings.instantiateInlineWorkflowTemplateOperationSettings(),
             clientContext,
             this.operationsStub);
+    this.createWorkflowTemplateCallable =
+        callableFactory.createUnaryCallable(
+            createWorkflowTemplateTransportSettings,
+            settings.createWorkflowTemplateSettings(),
+            clientContext);
+    this.getWorkflowTemplateCallable =
+        callableFactory.createUnaryCallable(
+            getWorkflowTemplateTransportSettings,
+            settings.getWorkflowTemplateSettings(),
+            clientContext);
     this.updateWorkflowTemplateCallable =
         callableFactory.createUnaryCallable(
             updateWorkflowTemplateTransportSettings,
@@ -359,15 +359,6 @@ public GrpcOperationsStub getOperationsStub() {
     return operationsStub;
   }
 
-  public UnaryCallable
-      createWorkflowTemplateCallable() {
-    return createWorkflowTemplateCallable;
-  }
-
-  public UnaryCallable getWorkflowTemplateCallable() {
-    return getWorkflowTemplateCallable;
-  }
-
   @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
   public OperationCallable
       instantiateWorkflowTemplateOperationCallable() {
@@ -390,6 +381,15 @@ public UnaryCallable getWorkflowTe
     return instantiateInlineWorkflowTemplateCallable;
   }
 
+  public UnaryCallable
+      createWorkflowTemplateCallable() {
+    return createWorkflowTemplateCallable;
+  }
+
+  public UnaryCallable getWorkflowTemplateCallable() {
+    return getWorkflowTemplateCallable;
+  }
+
   public UnaryCallable
       updateWorkflowTemplateCallable() {
     return updateWorkflowTemplateCallable;
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java
index 169133c3..45aab410 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java
@@ -54,6 +54,17 @@ public UnaryCallable submitJobCallable() {
     throw new UnsupportedOperationException("Not implemented: submitJobCallable()");
   }
 
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallable
+      submitJobAsOperationOperationCallable() {
+    throw new UnsupportedOperationException(
+        "Not implemented: submitJobAsOperationOperationCallable()");
+  }
+
+  public UnaryCallable submitJobAsOperationCallable() {
+    throw new UnsupportedOperationException("Not implemented: submitJobAsOperationCallable()");
+  }
+
   public UnaryCallable getJobCallable() {
     throw new UnsupportedOperationException("Not implemented: getJobCallable()");
   }
@@ -78,17 +89,6 @@ public UnaryCallable deleteJobCallable() {
     throw new UnsupportedOperationException("Not implemented: deleteJobCallable()");
   }
 
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallable
-      submitJobAsOperationOperationCallable() {
-    throw new UnsupportedOperationException(
-        "Not implemented: submitJobAsOperationOperationCallable()");
-  }
-
-  public UnaryCallable submitJobAsOperationCallable() {
-    throw new UnsupportedOperationException("Not implemented: submitJobAsOperationCallable()");
-  }
-
   @Override
   public abstract void close();
 }
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java
index 85342eaa..05965c1a 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java
@@ -102,21 +102,33 @@ public class JobControllerStubSettings extends StubSettingsbuilder().add("https://www.googleapis.com/auth/cloud-platform").build();
 
   private final UnaryCallSettings submitJobSettings;
+  private final UnaryCallSettings submitJobAsOperationSettings;
+  private final OperationCallSettings
+      submitJobAsOperationOperationSettings;
   private final UnaryCallSettings getJobSettings;
   private final PagedCallSettings
       listJobsSettings;
   private final UnaryCallSettings updateJobSettings;
   private final UnaryCallSettings cancelJobSettings;
   private final UnaryCallSettings deleteJobSettings;
-  private final UnaryCallSettings submitJobAsOperationSettings;
-  private final OperationCallSettings
-      submitJobAsOperationOperationSettings;
 
   /** Returns the object with the settings used for calls to submitJob. */
   public UnaryCallSettings submitJobSettings() {
     return submitJobSettings;
   }
 
+  /** Returns the object with the settings used for calls to submitJobAsOperation. */
+  public UnaryCallSettings submitJobAsOperationSettings() {
+    return submitJobAsOperationSettings;
+  }
+
+  /** Returns the object with the settings used for calls to submitJobAsOperation. */
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallSettings
+      submitJobAsOperationOperationSettings() {
+    return submitJobAsOperationOperationSettings;
+  }
+
   /** Returns the object with the settings used for calls to getJob. */
   public UnaryCallSettings getJobSettings() {
     return getJobSettings;
@@ -143,18 +155,6 @@ public UnaryCallSettings deleteJobSettings() {
     return deleteJobSettings;
   }
 
-  /** Returns the object with the settings used for calls to submitJobAsOperation. */
-  public UnaryCallSettings submitJobAsOperationSettings() {
-    return submitJobAsOperationSettings;
-  }
-
-  /** Returns the object with the settings used for calls to submitJobAsOperation. */
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallSettings
-      submitJobAsOperationOperationSettings() {
-    return submitJobAsOperationOperationSettings;
-  }
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public JobControllerStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -225,14 +225,14 @@ protected JobControllerStubSettings(Builder settingsBuilder) throws IOException
     super(settingsBuilder);
 
     submitJobSettings = settingsBuilder.submitJobSettings().build();
+    submitJobAsOperationSettings = settingsBuilder.submitJobAsOperationSettings().build();
+    submitJobAsOperationOperationSettings =
+        settingsBuilder.submitJobAsOperationOperationSettings().build();
     getJobSettings = settingsBuilder.getJobSettings().build();
     listJobsSettings = settingsBuilder.listJobsSettings().build();
     updateJobSettings = settingsBuilder.updateJobSettings().build();
     cancelJobSettings = settingsBuilder.cancelJobSettings().build();
     deleteJobSettings = settingsBuilder.deleteJobSettings().build();
-    submitJobAsOperationSettings = settingsBuilder.submitJobAsOperationSettings().build();
-    submitJobAsOperationOperationSettings =
-        settingsBuilder.submitJobAsOperationOperationSettings().build();
   }
 
   private static final PagedListDescriptor
@@ -292,6 +292,10 @@ public static class Builder extends StubSettings.Builder> unaryMethodSettingsBuilders;
 
     private final UnaryCallSettings.Builder submitJobSettings;
+    private final UnaryCallSettings.Builder
+        submitJobAsOperationSettings;
+    private final OperationCallSettings.Builder
+        submitJobAsOperationOperationSettings;
     private final UnaryCallSettings.Builder getJobSettings;
     private final PagedCallSettings.Builder<
             ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
@@ -299,10 +303,6 @@ public static class Builder extends StubSettings.Builder updateJobSettings;
     private final UnaryCallSettings.Builder cancelJobSettings;
     private final UnaryCallSettings.Builder deleteJobSettings;
-    private final UnaryCallSettings.Builder
-        submitJobAsOperationSettings;
-    private final OperationCallSettings.Builder
-        submitJobAsOperationOperationSettings;
 
     private static final ImmutableMap>
         RETRYABLE_CODE_DEFINITIONS;
@@ -311,16 +311,42 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
       definitions.put(
-          "idempotent",
+          "retry_policy_4_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
                   StatusCode.Code.DEADLINE_EXCEEDED,
                   StatusCode.Code.INTERNAL,
                   StatusCode.Code.UNAVAILABLE)));
       definitions.put(
-          "non_idempotent2", ImmutableSet.copyOf(Lists.newArrayList()));
+          "retry_policy_1_codes",
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "retry_policy_6_codes",
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.INTERNAL,
+                  StatusCode.Code.DEADLINE_EXCEEDED,
+                  StatusCode.Code.UNAVAILABLE)));
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       definitions.put(
-          "non_idempotent",
+          "retry_policy_3_codes",
+          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "retry_policy_2_codes",
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED,
+                  StatusCode.Code.INTERNAL,
+                  StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList()));
+      definitions.put(
+          "retry_policy_5_codes",
+          ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "retry_policy_7_codes",
           ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
@@ -335,12 +361,88 @@ public static class Builder extends StubSettings.Builder>of(
               submitJobSettings,
+              submitJobAsOperationSettings,
               getJobSettings,
               listJobsSettings,
               updateJobSettings,
               cancelJobSettings,
-              deleteJobSettings,
-              submitJobAsOperationSettings);
+              deleteJobSettings);
 
       initDefaults(this);
     }
@@ -393,44 +495,44 @@ private static Builder initDefaults(Builder builder) {
 
       builder
           .submitJobSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params"));
+
+      builder
+          .submitJobAsOperationSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params"));
 
       builder
           .getJobSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listJobsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .updateJobSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params"));
 
       builder
           .cancelJobSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .deleteJobSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
-      builder
-          .submitJobAsOperationSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent2"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params"));
       builder
           .submitJobAsOperationOperationSettings()
           .setInitialCallSettings(
               UnaryCallSettings.newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent2"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params"))
                   .build())
           .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Job.class))
           .setMetadataTransformer(
@@ -454,24 +556,24 @@ protected Builder(JobControllerStubSettings settings) {
       super(settings);
 
       submitJobSettings = settings.submitJobSettings.toBuilder();
+      submitJobAsOperationSettings = settings.submitJobAsOperationSettings.toBuilder();
+      submitJobAsOperationOperationSettings =
+          settings.submitJobAsOperationOperationSettings.toBuilder();
       getJobSettings = settings.getJobSettings.toBuilder();
       listJobsSettings = settings.listJobsSettings.toBuilder();
       updateJobSettings = settings.updateJobSettings.toBuilder();
       cancelJobSettings = settings.cancelJobSettings.toBuilder();
       deleteJobSettings = settings.deleteJobSettings.toBuilder();
-      submitJobAsOperationSettings = settings.submitJobAsOperationSettings.toBuilder();
-      submitJobAsOperationOperationSettings =
-          settings.submitJobAsOperationOperationSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
               submitJobSettings,
+              submitJobAsOperationSettings,
               getJobSettings,
               listJobsSettings,
               updateJobSettings,
               cancelJobSettings,
-              deleteJobSettings,
-              submitJobAsOperationSettings);
+              deleteJobSettings);
     }
 
     // NEXT_MAJOR_VER: remove 'throws Exception'
@@ -495,6 +597,19 @@ public UnaryCallSettings.Builder submitJobSettings() {
       return submitJobSettings;
     }
 
+    /** Returns the builder for the settings used for calls to submitJobAsOperation. */
+    public UnaryCallSettings.Builder submitJobAsOperationSettings() {
+      return submitJobAsOperationSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to submitJobAsOperation. */
+    @BetaApi(
+        "The surface for use by generated code is not stable yet and may change in the future.")
+    public OperationCallSettings.Builder
+        submitJobAsOperationOperationSettings() {
+      return submitJobAsOperationOperationSettings;
+    }
+
     /** Returns the builder for the settings used for calls to getJob. */
     public UnaryCallSettings.Builder getJobSettings() {
       return getJobSettings;
@@ -521,19 +636,6 @@ public UnaryCallSettings.Builder deleteJobSettings() {
       return deleteJobSettings;
     }
 
-    /** Returns the builder for the settings used for calls to submitJobAsOperation. */
-    public UnaryCallSettings.Builder submitJobAsOperationSettings() {
-      return submitJobAsOperationSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to submitJobAsOperation. */
-    @BetaApi(
-        "The surface for use by generated code is not stable yet and may change in the future.")
-    public OperationCallSettings.Builder
-        submitJobAsOperationOperationSettings() {
-      return submitJobAsOperationOperationSettings;
-    }
-
     @Override
     public JobControllerStubSettings build() throws IOException {
       return new JobControllerStubSettings(this);
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java
index 5ed269d4..f87e3a0e 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java
@@ -51,15 +51,6 @@ public OperationsStub getOperationsStub() {
     throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
   }
 
-  public UnaryCallable
-      createWorkflowTemplateCallable() {
-    throw new UnsupportedOperationException("Not implemented: createWorkflowTemplateCallable()");
-  }
-
-  public UnaryCallable getWorkflowTemplateCallable() {
-    throw new UnsupportedOperationException("Not implemented: getWorkflowTemplateCallable()");
-  }
-
   @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
   public OperationCallable
       instantiateWorkflowTemplateOperationCallable() {
@@ -86,6 +77,15 @@ public UnaryCallable getWorkflowTe
         "Not implemented: instantiateInlineWorkflowTemplateCallable()");
   }
 
+  public UnaryCallable
+      createWorkflowTemplateCallable() {
+    throw new UnsupportedOperationException("Not implemented: createWorkflowTemplateCallable()");
+  }
+
+  public UnaryCallable getWorkflowTemplateCallable() {
+    throw new UnsupportedOperationException("Not implemented: getWorkflowTemplateCallable()");
+  }
+
   public UnaryCallable
       updateWorkflowTemplateCallable() {
     throw new UnsupportedOperationException("Not implemented: updateWorkflowTemplateCallable()");
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
index 0e7c505b..33176458 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
@@ -103,10 +103,6 @@ public class WorkflowTemplateServiceStubSettings
   private static final ImmutableList DEFAULT_SERVICE_SCOPES =
       ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
 
-  private final UnaryCallSettings
-      createWorkflowTemplateSettings;
-  private final UnaryCallSettings
-      getWorkflowTemplateSettings;
   private final UnaryCallSettings
       instantiateWorkflowTemplateSettings;
   private final OperationCallSettings
@@ -116,6 +112,10 @@ public class WorkflowTemplateServiceStubSettings
   private final OperationCallSettings<
           InstantiateInlineWorkflowTemplateRequest, Empty, WorkflowMetadata>
       instantiateInlineWorkflowTemplateOperationSettings;
+  private final UnaryCallSettings
+      createWorkflowTemplateSettings;
+  private final UnaryCallSettings
+      getWorkflowTemplateSettings;
   private final UnaryCallSettings
       updateWorkflowTemplateSettings;
   private final PagedCallSettings<
@@ -126,18 +126,6 @@ public class WorkflowTemplateServiceStubSettings
   private final UnaryCallSettings
       deleteWorkflowTemplateSettings;
 
-  /** Returns the object with the settings used for calls to createWorkflowTemplate. */
-  public UnaryCallSettings
-      createWorkflowTemplateSettings() {
-    return createWorkflowTemplateSettings;
-  }
-
-  /** Returns the object with the settings used for calls to getWorkflowTemplate. */
-  public UnaryCallSettings
-      getWorkflowTemplateSettings() {
-    return getWorkflowTemplateSettings;
-  }
-
   /** Returns the object with the settings used for calls to instantiateWorkflowTemplate. */
   public UnaryCallSettings
       instantiateWorkflowTemplateSettings() {
@@ -164,6 +152,18 @@ public class WorkflowTemplateServiceStubSettings
     return instantiateInlineWorkflowTemplateOperationSettings;
   }
 
+  /** Returns the object with the settings used for calls to createWorkflowTemplate. */
+  public UnaryCallSettings
+      createWorkflowTemplateSettings() {
+    return createWorkflowTemplateSettings;
+  }
+
+  /** Returns the object with the settings used for calls to getWorkflowTemplate. */
+  public UnaryCallSettings
+      getWorkflowTemplateSettings() {
+    return getWorkflowTemplateSettings;
+  }
+
   /** Returns the object with the settings used for calls to updateWorkflowTemplate. */
   public UnaryCallSettings
       updateWorkflowTemplateSettings() {
@@ -253,8 +253,6 @@ public Builder toBuilder() {
   protected WorkflowTemplateServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    createWorkflowTemplateSettings = settingsBuilder.createWorkflowTemplateSettings().build();
-    getWorkflowTemplateSettings = settingsBuilder.getWorkflowTemplateSettings().build();
     instantiateWorkflowTemplateSettings =
         settingsBuilder.instantiateWorkflowTemplateSettings().build();
     instantiateWorkflowTemplateOperationSettings =
@@ -263,6 +261,8 @@ protected WorkflowTemplateServiceStubSettings(Builder settingsBuilder) throws IO
         settingsBuilder.instantiateInlineWorkflowTemplateSettings().build();
     instantiateInlineWorkflowTemplateOperationSettings =
         settingsBuilder.instantiateInlineWorkflowTemplateOperationSettings().build();
+    createWorkflowTemplateSettings = settingsBuilder.createWorkflowTemplateSettings().build();
+    getWorkflowTemplateSettings = settingsBuilder.getWorkflowTemplateSettings().build();
     updateWorkflowTemplateSettings = settingsBuilder.updateWorkflowTemplateSettings().build();
     listWorkflowTemplatesSettings = settingsBuilder.listWorkflowTemplatesSettings().build();
     deleteWorkflowTemplateSettings = settingsBuilder.deleteWorkflowTemplateSettings().build();
@@ -338,10 +338,6 @@ public static class Builder
       extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder
-        createWorkflowTemplateSettings;
-    private final UnaryCallSettings.Builder
-        getWorkflowTemplateSettings;
     private final UnaryCallSettings.Builder
         instantiateWorkflowTemplateSettings;
     private final OperationCallSettings.Builder<
@@ -352,6 +348,10 @@ public static class Builder
     private final OperationCallSettings.Builder<
             InstantiateInlineWorkflowTemplateRequest, Empty, WorkflowMetadata>
         instantiateInlineWorkflowTemplateOperationSettings;
+    private final UnaryCallSettings.Builder
+        createWorkflowTemplateSettings;
+    private final UnaryCallSettings.Builder
+        getWorkflowTemplateSettings;
     private final UnaryCallSettings.Builder
         updateWorkflowTemplateSettings;
     private final PagedCallSettings.Builder<
@@ -369,14 +369,15 @@ public static class Builder
       ImmutableMap.Builder> definitions =
           ImmutableMap.builder();
       definitions.put(
-          "idempotent",
+          "retry_policy_4_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
                   StatusCode.Code.DEADLINE_EXCEEDED,
                   StatusCode.Code.INTERNAL,
                   StatusCode.Code.UNAVAILABLE)));
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       definitions.put(
-          "non_idempotent",
+          "retry_policy_3_codes",
           ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
@@ -391,12 +392,25 @@ public static class Builder
               .setInitialRetryDelay(Duration.ofMillis(100L))
               .setRetryDelayMultiplier(1.3)
               .setMaxRetryDelay(Duration.ofMillis(60000L))
-              .setInitialRpcTimeout(Duration.ofMillis(30000L))
+              .setInitialRpcTimeout(Duration.ofMillis(600000L))
               .setRpcTimeoutMultiplier(1.0)
-              .setMaxRpcTimeout(Duration.ofMillis(30000L))
-              .setTotalTimeout(Duration.ofMillis(900000L))
+              .setMaxRpcTimeout(Duration.ofMillis(600000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
               .build();
-      definitions.put("default", settings);
+      definitions.put("retry_policy_3_params", settings);
+      settings =
+          RetrySettings.newBuilder()
+              .setInitialRetryDelay(Duration.ofMillis(100L))
+              .setRetryDelayMultiplier(1.3)
+              .setMaxRetryDelay(Duration.ofMillis(60000L))
+              .setInitialRpcTimeout(Duration.ofMillis(600000L))
+              .setRpcTimeoutMultiplier(1.0)
+              .setMaxRpcTimeout(Duration.ofMillis(600000L))
+              .setTotalTimeout(Duration.ofMillis(600000L))
+              .build();
+      definitions.put("retry_policy_4_params", settings);
+      settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
+      definitions.put("no_retry_params", settings);
       RETRY_PARAM_DEFINITIONS = definitions.build();
     }
 
@@ -407,10 +421,6 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      createWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
-      getWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       instantiateWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       instantiateWorkflowTemplateOperationSettings = OperationCallSettings.newBuilder();
@@ -419,6 +429,10 @@ protected Builder(ClientContext clientContext) {
 
       instantiateInlineWorkflowTemplateOperationSettings = OperationCallSettings.newBuilder();
 
+      createWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      getWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       updateWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       listWorkflowTemplatesSettings =
@@ -428,10 +442,10 @@ protected Builder(ClientContext clientContext) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              createWorkflowTemplateSettings,
-              getWorkflowTemplateSettings,
               instantiateWorkflowTemplateSettings,
               instantiateInlineWorkflowTemplateSettings,
+              createWorkflowTemplateSettings,
+              getWorkflowTemplateSettings,
               updateWorkflowTemplateSettings,
               listWorkflowTemplatesSettings,
               deleteWorkflowTemplateSettings);
@@ -451,47 +465,47 @@ private static Builder createDefault() {
     private static Builder initDefaults(Builder builder) {
 
       builder
-          .createWorkflowTemplateSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .instantiateWorkflowTemplateSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
-          .getWorkflowTemplateSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .instantiateInlineWorkflowTemplateSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
-          .instantiateWorkflowTemplateSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .createWorkflowTemplateSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
-          .instantiateInlineWorkflowTemplateSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .getWorkflowTemplateSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params"));
 
       builder
           .updateWorkflowTemplateSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .listWorkflowTemplatesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params"));
 
       builder
           .deleteWorkflowTemplateSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
       builder
           .instantiateWorkflowTemplateOperationSettings()
           .setInitialCallSettings(
               UnaryCallSettings
                   .
                       newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
@@ -514,8 +528,8 @@ private static Builder initDefaults(Builder builder) {
               UnaryCallSettings
                   .
                       newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
@@ -539,8 +553,6 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(WorkflowTemplateServiceStubSettings settings) {
       super(settings);
 
-      createWorkflowTemplateSettings = settings.createWorkflowTemplateSettings.toBuilder();
-      getWorkflowTemplateSettings = settings.getWorkflowTemplateSettings.toBuilder();
       instantiateWorkflowTemplateSettings =
           settings.instantiateWorkflowTemplateSettings.toBuilder();
       instantiateWorkflowTemplateOperationSettings =
@@ -549,16 +561,18 @@ protected Builder(WorkflowTemplateServiceStubSettings settings) {
           settings.instantiateInlineWorkflowTemplateSettings.toBuilder();
       instantiateInlineWorkflowTemplateOperationSettings =
           settings.instantiateInlineWorkflowTemplateOperationSettings.toBuilder();
+      createWorkflowTemplateSettings = settings.createWorkflowTemplateSettings.toBuilder();
+      getWorkflowTemplateSettings = settings.getWorkflowTemplateSettings.toBuilder();
       updateWorkflowTemplateSettings = settings.updateWorkflowTemplateSettings.toBuilder();
       listWorkflowTemplatesSettings = settings.listWorkflowTemplatesSettings.toBuilder();
       deleteWorkflowTemplateSettings = settings.deleteWorkflowTemplateSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              createWorkflowTemplateSettings,
-              getWorkflowTemplateSettings,
               instantiateWorkflowTemplateSettings,
               instantiateInlineWorkflowTemplateSettings,
+              createWorkflowTemplateSettings,
+              getWorkflowTemplateSettings,
               updateWorkflowTemplateSettings,
               listWorkflowTemplatesSettings,
               deleteWorkflowTemplateSettings);
@@ -580,18 +594,6 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
-    /** Returns the builder for the settings used for calls to createWorkflowTemplate. */
-    public UnaryCallSettings.Builder
-        createWorkflowTemplateSettings() {
-      return createWorkflowTemplateSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to getWorkflowTemplate. */
-    public UnaryCallSettings.Builder
-        getWorkflowTemplateSettings() {
-      return getWorkflowTemplateSettings;
-    }
-
     /** Returns the builder for the settings used for calls to instantiateWorkflowTemplate. */
     public UnaryCallSettings.Builder
         instantiateWorkflowTemplateSettings() {
@@ -622,6 +624,18 @@ public Builder applyToAllUnaryMethods(
       return instantiateInlineWorkflowTemplateOperationSettings;
     }
 
+    /** Returns the builder for the settings used for calls to createWorkflowTemplate. */
+    public UnaryCallSettings.Builder
+        createWorkflowTemplateSettings() {
+      return createWorkflowTemplateSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to getWorkflowTemplate. */
+    public UnaryCallSettings.Builder
+        getWorkflowTemplateSettings() {
+      return getWorkflowTemplateSettings;
+    }
+
     /** Returns the builder for the settings used for calls to updateWorkflowTemplate. */
     public UnaryCallSettings.Builder
         updateWorkflowTemplateSettings() {
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java
index 574d4ad7..ef8757f8 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java
@@ -596,6 +596,140 @@ public final UnaryCallable deleteClusterCallabl
     return stub.deleteClusterCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Gets cluster diagnostic information. The returned
+   * [Operation.metadata][google.longrunning.Operation.metadata] will be
+   * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
+   * After the operation completes, [Operation.response][google.longrunning.Operation.response]
+   * contains [Empty][google.protobuf.Empty].
+   *
+   * 

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
+   * }
+   * 
+ * + * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs + * to. + * @param region Required. The Dataproc region in which to handle the request. + * @param clusterName Required. The cluster name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture diagnoseClusterAsync( + String projectId, String region, String clusterName) { + DiagnoseClusterRequest request = + DiagnoseClusterRequest.newBuilder() + .setProjectId(projectId) + .setRegion(region) + .setClusterName(clusterName) + .build(); + return diagnoseClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets cluster diagnostic information. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). + * After the operation completes, [Operation.response][google.longrunning.Operation.response] + * contains [Empty][google.protobuf.Empty]. + * + *

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setClusterName(clusterName)
+   *     .build();
+   *   clusterControllerClient.diagnoseClusterAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture diagnoseClusterAsync( + DiagnoseClusterRequest request) { + return diagnoseClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets cluster diagnostic information. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). + * After the operation completes, [Operation.response][google.longrunning.Operation.response] + * contains [Empty][google.protobuf.Empty]. + * + *

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setClusterName(clusterName)
+   *     .build();
+   *   OperationFuture<Empty, ClusterOperationMetadata> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + diagnoseClusterOperationCallable() { + return stub.diagnoseClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets cluster diagnostic information. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). + * After the operation completes, [Operation.response][google.longrunning.Operation.response] + * contains [Empty][google.protobuf.Empty]. + * + *

Sample code: + * + *


+   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   String clusterName = "";
+   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setClusterName(clusterName)
+   *     .build();
+   *   ApiFuture<Operation> future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable diagnoseClusterCallable() { + return stub.diagnoseClusterCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets the resource representation for a cluster in a project. @@ -841,140 +975,6 @@ public final UnaryCallable listCluste return stub.listClustersCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains [Empty][google.protobuf.Empty]. - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
-   * }
-   * 
- * - * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs - * to. - * @param region Required. The Dataproc region in which to handle the request. - * @param clusterName Required. The cluster name. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture diagnoseClusterAsync( - String projectId, String region, String clusterName) { - DiagnoseClusterRequest request = - DiagnoseClusterRequest.newBuilder() - .setProjectId(projectId) - .setRegion(region) - .setClusterName(clusterName) - .build(); - return diagnoseClusterAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains [Empty][google.protobuf.Empty]. - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setClusterName(clusterName)
-   *     .build();
-   *   clusterControllerClient.diagnoseClusterAsync(request).get();
-   * }
-   * 
- * - * @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 - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture diagnoseClusterAsync( - DiagnoseClusterRequest request) { - return diagnoseClusterOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains [Empty][google.protobuf.Empty]. - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setClusterName(clusterName)
-   *     .build();
-   *   OperationFuture<Empty, ClusterOperationMetadata> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - diagnoseClusterOperationCallable() { - return stub.diagnoseClusterOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets cluster diagnostic information. The returned - * [Operation.metadata][google.longrunning.Operation.metadata] will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). - * After the operation completes, [Operation.response][google.longrunning.Operation.response] - * contains [Empty][google.protobuf.Empty]. - * - *

Sample code: - * - *


-   * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   String clusterName = "";
-   *   DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setClusterName(clusterName)
-   *     .build();
-   *   ApiFuture<Operation> future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable diagnoseClusterCallable() { - return stub.diagnoseClusterCallable(); - } - @Override public final void close() { stub.close(); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java index 5c8ae2a6..bc15c2a9 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java @@ -109,17 +109,6 @@ public UnaryCallSettings deleteClusterSettings( return ((ClusterControllerStubSettings) getStubSettings()).deleteClusterOperationSettings(); } - /** Returns the object with the settings used for calls to getCluster. */ - public UnaryCallSettings getClusterSettings() { - return ((ClusterControllerStubSettings) getStubSettings()).getClusterSettings(); - } - - /** Returns the object with the settings used for calls to listClusters. */ - public PagedCallSettings - listClustersSettings() { - return ((ClusterControllerStubSettings) getStubSettings()).listClustersSettings(); - } - /** Returns the object with the settings used for calls to diagnoseCluster. */ public UnaryCallSettings diagnoseClusterSettings() { return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterSettings(); @@ -133,6 +122,17 @@ public UnaryCallSettings diagnoseClusterSetti return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterOperationSettings(); } + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((ClusterControllerStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return ((ClusterControllerStubSettings) getStubSettings()).listClustersSettings(); + } + public static final ClusterControllerSettings create(ClusterControllerStubSettings stub) throws IOException { return new ClusterControllerSettings.Builder(stub.toBuilder()).build(); @@ -269,18 +269,6 @@ public UnaryCallSettings.Builder deleteClusterS return getStubSettingsBuilder().deleteClusterOperationSettings(); } - /** Returns the builder for the settings used for calls to getCluster. */ - public UnaryCallSettings.Builder getClusterSettings() { - return getStubSettingsBuilder().getClusterSettings(); - } - - /** Returns the builder for the settings used for calls to listClusters. */ - public PagedCallSettings.Builder< - ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> - listClustersSettings() { - return getStubSettingsBuilder().listClustersSettings(); - } - /** Returns the builder for the settings used for calls to diagnoseCluster. */ public UnaryCallSettings.Builder diagnoseClusterSettings() { return getStubSettingsBuilder().diagnoseClusterSettings(); @@ -294,6 +282,18 @@ public UnaryCallSettings.Builder diagnoseClus return getStubSettingsBuilder().diagnoseClusterOperationSettings(); } + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getStubSettingsBuilder().getClusterSettings(); + } + + /** Returns the builder for the settings used for calls to listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return getStubSettingsBuilder().listClustersSettings(); + } + @Override public ClusterControllerSettings build() throws IOException { return new ClusterControllerSettings(this); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerClient.java index dd63ae31..317f91de 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerClient.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerClient.java @@ -252,6 +252,119 @@ public final UnaryCallable submitJobCallable() { return stub.submitJobCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
+   * }
+   * 
+ * + * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param region Required. The Dataproc region in which to handle the request. + * @param job Required. The job resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture submitJobAsOperationAsync( + String projectId, String region, Job job) { + SubmitJobRequest request = + SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build(); + return submitJobAsOperationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setJob(job)
+   *     .build();
+   *   Job response = jobControllerClient.submitJobAsOperationAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture submitJobAsOperationAsync( + SubmitJobRequest request) { + return submitJobAsOperationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setJob(job)
+   *     .build();
+   *   OperationFuture<Job, JobMetadata> future = jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + submitJobAsOperationOperationCallable() { + return stub.submitJobAsOperationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Submits job to a cluster. + * + *

Sample code: + * + *


+   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+   *   String projectId = "";
+   *   String region = "";
+   *   Job job = Job.newBuilder().build();
+   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
+   *     .setProjectId(projectId)
+   *     .setRegion(region)
+   *     .setJob(job)
+   *     .build();
+   *   ApiFuture<Operation> future = jobControllerClient.submitJobAsOperationCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable submitJobAsOperationCallable() { + return stub.submitJobAsOperationCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets the resource representation for a job in a project. @@ -726,119 +839,6 @@ public final UnaryCallable deleteJobCallable() { return stub.deleteJobCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
-   * }
-   * 
- * - * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param region Required. The Dataproc region in which to handle the request. - * @param job Required. The job resource. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture submitJobAsOperationAsync( - String projectId, String region, Job job) { - SubmitJobRequest request = - SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build(); - return submitJobAsOperationAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setJob(job)
-   *     .build();
-   *   Job response = jobControllerClient.submitJobAsOperationAsync(request).get();
-   * }
-   * 
- * - * @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 - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture submitJobAsOperationAsync( - SubmitJobRequest request) { - return submitJobAsOperationOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setJob(job)
-   *     .build();
-   *   OperationFuture<Job, JobMetadata> future = jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
-   *   // Do something
-   *   Job response = future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - submitJobAsOperationOperationCallable() { - return stub.submitJobAsOperationOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Submits job to a cluster. - * - *

Sample code: - * - *


-   * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
-   *   String projectId = "";
-   *   String region = "";
-   *   Job job = Job.newBuilder().build();
-   *   SubmitJobRequest request = SubmitJobRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setRegion(region)
-   *     .setJob(job)
-   *     .build();
-   *   ApiFuture<Operation> future = jobControllerClient.submitJobAsOperationCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable submitJobAsOperationCallable() { - return stub.submitJobAsOperationCallable(); - } - @Override public final void close() { stub.close(); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerSettings.java index d2532905..64548f63 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerSettings.java @@ -75,6 +75,19 @@ public UnaryCallSettings submitJobSettings() { return ((JobControllerStubSettings) getStubSettings()).submitJobSettings(); } + /** Returns the object with the settings used for calls to submitJobAsOperation. */ + public UnaryCallSettings submitJobAsOperationSettings() { + return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationSettings(); + } + + /** Returns the object with the settings used for calls to submitJobAsOperation. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + submitJobAsOperationOperationSettings() { + return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationOperationSettings(); + } + /** Returns the object with the settings used for calls to getJob. */ public UnaryCallSettings getJobSettings() { return ((JobControllerStubSettings) getStubSettings()).getJobSettings(); @@ -101,19 +114,6 @@ public UnaryCallSettings deleteJobSettings() { return ((JobControllerStubSettings) getStubSettings()).deleteJobSettings(); } - /** Returns the object with the settings used for calls to submitJobAsOperation. */ - public UnaryCallSettings submitJobAsOperationSettings() { - return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationSettings(); - } - - /** Returns the object with the settings used for calls to submitJobAsOperation. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - submitJobAsOperationOperationSettings() { - return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationOperationSettings(); - } - public static final JobControllerSettings create(JobControllerStubSettings stub) throws IOException { return new JobControllerSettings.Builder(stub.toBuilder()).build(); @@ -216,6 +216,19 @@ public UnaryCallSettings.Builder submitJobSettings() { return getStubSettingsBuilder().submitJobSettings(); } + /** Returns the builder for the settings used for calls to submitJobAsOperation. */ + public UnaryCallSettings.Builder submitJobAsOperationSettings() { + return getStubSettingsBuilder().submitJobAsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to submitJobAsOperation. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + submitJobAsOperationOperationSettings() { + return getStubSettingsBuilder().submitJobAsOperationOperationSettings(); + } + /** Returns the builder for the settings used for calls to getJob. */ public UnaryCallSettings.Builder getJobSettings() { return getStubSettingsBuilder().getJobSettings(); @@ -242,19 +255,6 @@ public UnaryCallSettings.Builder deleteJobSettings() { return getStubSettingsBuilder().deleteJobSettings(); } - /** Returns the builder for the settings used for calls to submitJobAsOperation. */ - public UnaryCallSettings.Builder submitJobAsOperationSettings() { - return getStubSettingsBuilder().submitJobAsOperationSettings(); - } - - /** Returns the builder for the settings used for calls to submitJobAsOperation. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - submitJobAsOperationOperationSettings() { - return getStubSettingsBuilder().submitJobAsOperationOperationSettings(); - } - @Override public JobControllerSettings build() throws IOException { return new JobControllerSettings(this); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java index 9a1f297c..62caeb0d 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java @@ -177,261 +177,290 @@ public final OperationsClient getOperationsClient() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates new workflow template. + * Instantiates a template and begins execution. * - *

Sample code: + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. * - *


-   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
-   * }
-   * 
+ *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * - * @param parent Required. The resource name of the region or location, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,create`, the resource name of the region - * has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.create`, the resource name of the - * location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The Dataproc workflow template to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final WorkflowTemplate createWorkflowTemplate( - RegionName parent, WorkflowTemplate template) { - CreateWorkflowTemplateRequest request = - CreateWorkflowTemplateRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setTemplate(template) - .build(); - return createWorkflowTemplate(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates new workflow template. + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
    * }
    * 
* - * @param parent Required. The resource name of the region or location, as described in + * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,create`, the resource name of the region - * has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.create`, the resource name of the - * location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The Dataproc workflow template to create. + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate createWorkflowTemplate( - LocationName parent, WorkflowTemplate template) { - CreateWorkflowTemplateRequest request = - CreateWorkflowTemplateRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setTemplate(template) + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + WorkflowTemplateName name) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() + .setName(name == null ? null : name.toString()) .build(); - return createWorkflowTemplate(request); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates new workflow template. + * Instantiates a template and begins execution. * - *

Sample code: + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. * - *


-   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent.toString(), template);
-   * }
-   * 
+ *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * - * @param parent Required. The resource name of the region or location, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,create`, the resource name of the region - * has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.create`, the resource name of the - * location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The Dataproc workflow template to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) { - CreateWorkflowTemplateRequest request = - CreateWorkflowTemplateRequest.newBuilder().setParent(parent).setTemplate(template).build(); - return createWorkflowTemplate(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates new workflow template. + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
-   *     .build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request);
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name Required. The resource name of the workflow template, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request) { - return createWorkflowTemplateCallable().call(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + String name) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder().setName(name).build(); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates new workflow template. + * Instantiates a template and begins execution. * - *

Sample code: + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. * - *


-   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
-   *     .build();
-   *   ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request);
-   *   // Do something
-   *   WorkflowTemplate response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - createWorkflowTemplateCallable() { - return stub.createWorkflowTemplateCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Retrieves the latest workflow template. + *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * - *

Can retrieve previously instantiated template by specifying optional version parameter. + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
+   *   Map<String, String> parameters = new HashMap<>();
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
    * }
    * 
* * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @param parameters Optional. Map from parameter names to values that should be used for those + * parameters. Values may not exceed 100 characters. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) { - GetWorkflowTemplateRequest request = - GetWorkflowTemplateRequest.newBuilder() + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + WorkflowTemplateName name, Map parameters) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() .setName(name == null ? null : name.toString()) + .putAllParameters(parameters) .build(); - return getWorkflowTemplate(request); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the latest workflow template. + * Instantiates a template and begins execution. * - *

Can retrieve previously instantiated template by specifying optional version parameter. + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. + * + *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + * + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
+   *   Map<String, String> parameters = new HashMap<>();
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
    * }
    * 
* * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.get`, the resource name of the template - * has the following format: + *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the + * template has the following format: * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @param parameters Optional. Map from parameter names to values that should be used for those + * parameters. Values may not exceed 100 characters. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final WorkflowTemplate getWorkflowTemplate(String name) { - GetWorkflowTemplateRequest request = - GetWorkflowTemplateRequest.newBuilder().setName(name).build(); - return getWorkflowTemplate(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + String name, Map parameters) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() + .setName(name) + .putAllParameters(parameters) + .build(); + return instantiateWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the latest workflow template. + * Instantiates a template and begins execution. * - *

Can retrieve previously instantiated template by specifying optional version parameter. + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. + * + *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + * + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
+   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get();
    * }
    * 
* * @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 WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request) { - return getWorkflowTemplateCallable().call(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateWorkflowTemplateAsync( + InstantiateWorkflowTemplateRequest request) { + return instantiateWorkflowTemplateOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Retrieves the latest workflow template. + * Instantiates a template and begins execution. * - *

Can retrieve previously instantiated template by specifying optional version parameter. + *

The returned Operation can be used to track execution of workflow by polling + * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when + * entire workflow is finished. + * + *

The running workflow can be aborted via + * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + * + *

The [Operation.metadata][google.longrunning.Operation.metadata] will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + *

On successful completion, [Operation.response][google.longrunning.Operation.response] will + * be [Empty][google.protobuf.Empty]. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
+   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateWorkflowTemplateOperationCallable().futureCall(request);
    *   // Do something
-   *   WorkflowTemplate response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable - getWorkflowTemplateCallable() { - return stub.getWorkflowTemplateCallable(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + instantiateWorkflowTemplateOperationCallable() { + return stub.instantiateWorkflowTemplateOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -459,35 +488,29 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req *

    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
+   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param name Required. The resource name of the workflow template, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - WorkflowTemplateName name) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return instantiateWorkflowTemplateAsync(request); + public final UnaryCallable + instantiateWorkflowTemplateCallable() { + return stub.instantiateWorkflowTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -497,7 +520,7 @@ public final OperationFuture instantiateWorkflowTemplat * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). * Also see [Using * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). * @@ -508,34 +531,42 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
    * }
    * 
* - * @param name Required. The resource name of the workflow template, as described in + * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - String name) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder().setName(name).build(); - return instantiateWorkflowTemplateAsync(request); + *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of + * the region has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of + * the location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The workflow template to instantiate. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + RegionName parent, WorkflowTemplate template) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTemplate(template) + .build(); + return instantiateInlineWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -545,7 +576,7 @@ public final OperationFuture instantiateWorkflowTemplat * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). * Also see [Using * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). * @@ -556,40 +587,42 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   Map<String, String> parameters = new HashMap<>();
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
    * }
    * 
* - * @param name Required. The resource name of the workflow template, as described in + * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @param parameters Optional. Map from parameter names to values that should be used for those - * parameters. Values may not exceed 100 characters. + *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of + * the region has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of + * the location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The workflow template to instantiate. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - WorkflowTemplateName name, Map parameters) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .putAllParameters(parameters) + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + LocationName parent, WorkflowTemplate template) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTemplate(template) .build(); - return instantiateWorkflowTemplateAsync(request); + return instantiateInlineWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -599,7 +632,7 @@ public final OperationFuture instantiateWorkflowTemplat * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). * Also see [Using * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). * @@ -610,40 +643,42 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   Map<String, String> parameters = new HashMap<>();
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent.toString(), template).get();
    * }
    * 
* - * @param name Required. The resource name of the workflow template, as described in + * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - *

* For `projects.locations.workflowTemplates.instantiate`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @param parameters Optional. Map from parameter names to values that should be used for those - * parameters. Values may not exceed 100 characters. + *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of + * the region has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of + * the location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The workflow template to instantiate. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - String name, Map parameters) { - InstantiateWorkflowTemplateRequest request = - InstantiateWorkflowTemplateRequest.newBuilder() - .setName(name) - .putAllParameters(parameters) + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + String parent, WorkflowTemplate template) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(parent) + .setTemplate(template) .build(); - return instantiateWorkflowTemplateAsync(request); + return instantiateInlineWorkflowTemplateAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -653,7 +688,7 @@ public final OperationFuture instantiateWorkflowTemplat * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). * Also see [Using * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). * @@ -664,11 +699,13 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
-   *     .setName(name.toString())
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setTemplate(template)
    *     .build();
-   *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get();
+   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(request).get();
    * }
    * 
* @@ -677,15 +714,20 @@ public final OperationFuture instantiateWorkflowTemplat */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateWorkflowTemplateAsync( - InstantiateWorkflowTemplateRequest request) { - return instantiateWorkflowTemplateOperationCallable().futureCall(request); + public final OperationFuture instantiateInlineWorkflowTemplateAsync( + InstantiateInlineWorkflowTemplateRequest request) { + return instantiateInlineWorkflowTemplateOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -695,7 +737,7 @@ public final OperationFuture instantiateWorkflowTemplat * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). * Also see [Using * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). * @@ -706,26 +748,33 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
-   *     .setName(name.toString())
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setTemplate(template)
    *     .build();
-   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateWorkflowTemplateOperationCallable().futureCall(request);
+   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - instantiateWorkflowTemplateOperationCallable() { - return stub.instantiateWorkflowTemplateOperationCallable(); + public final OperationCallable + instantiateInlineWorkflowTemplateOperationCallable() { + return stub.instantiateInlineWorkflowTemplateOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Instantiates a template and begins execution. * + *

This method is equivalent to executing the sequence + * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], + * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], + * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + * *

The returned Operation can be used to track execution of workflow by polling * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when * entire workflow is finished. @@ -735,7 +784,7 @@ public final OperationFuture instantiateWorkflowTemplat * inflight jobs to be cancelled and workflow-owned clusters to be deleted. * *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). * Also see [Using * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). * @@ -746,45 +795,26 @@ public final OperationFuture instantiateWorkflowTemplat * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
-   *   InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
-   *     .setName(name.toString())
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setTemplate(template)
    *     .build();
-   *   ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
+   *   ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ - public final UnaryCallable - instantiateWorkflowTemplateCallable() { - return stub.instantiateWorkflowTemplateCallable(); + public final UnaryCallable + instantiateInlineWorkflowTemplateCallable() { + return stub.instantiateInlineWorkflowTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. - * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. - * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. - * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. - * - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + * Creates new workflow template. * *

Sample code: * @@ -792,111 +822,94 @@ public final OperationFuture instantiateWorkflowTemplat * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) { * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template); * } *

* * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of - * the region has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of - * the location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The workflow template to instantiate. + *

* For `projects.regions.workflowTemplates,create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.create`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The Dataproc workflow template to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( + public final WorkflowTemplate createWorkflowTemplate( RegionName parent, WorkflowTemplate template) { - InstantiateInlineWorkflowTemplateRequest request = - InstantiateInlineWorkflowTemplateRequest.newBuilder() + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setTemplate(template) .build(); - return instantiateInlineWorkflowTemplateAsync(request); + return createWorkflowTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. - * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. - * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. + * Creates new workflow template. * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + *

Sample code: * - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + *


+   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+   * }
+   * 
* - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + * @param parent Required. The resource name of the region or location, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates,create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.create`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The Dataproc workflow template to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkflowTemplate createWorkflowTemplate( + LocationName parent, WorkflowTemplate template) { + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTemplate(template) + .build(); + return createWorkflowTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new workflow template. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
    *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+   *   WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent.toString(), template);
    * }
    * 
* * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of - * the region has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of - * the location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The workflow template to instantiate. + *

* For `projects.regions.workflowTemplates,create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *

* For `projects.locations.workflowTemplates.create`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @param template Required. The Dataproc workflow template to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( - LocationName parent, WorkflowTemplate template) { - InstantiateInlineWorkflowTemplateRequest request = - InstantiateInlineWorkflowTemplateRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setTemplate(template) - .build(); - return instantiateInlineWorkflowTemplateAsync(request); + public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) { + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder().setParent(parent).setTemplate(template).build(); + return createWorkflowTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. - * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. - * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. - * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. - * - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + * Creates new workflow template. * *

Sample code: * @@ -904,55 +917,24 @@ public final OperationFuture instantiateInlineWorkflowT * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) { * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent.toString(), template).get(); + * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder() + * .setParent(parent.toString()) + * .setTemplate(template) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request); * } * * - * @param parent Required. The resource name of the region or location, as described in - * https://cloud.google.com/apis/design/resource_names. - *

* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of - * the region has the following format: `projects/{project_id}/regions/{region}` - *

* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of - * the location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The workflow template to instantiate. + * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( - String parent, WorkflowTemplate template) { - InstantiateInlineWorkflowTemplateRequest request = - InstantiateInlineWorkflowTemplateRequest.newBuilder() - .setParent(parent) - .setTemplate(template) - .build(); - return instantiateInlineWorkflowTemplateAsync(request); + public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request) { + return createWorkflowTemplateCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. - * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. - * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. - * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. - * - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + * Creates new workflow template. * *

Sample code: * @@ -960,115 +942,133 @@ public final OperationFuture instantiateInlineWorkflowT * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) { * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder() + * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder() * .setParent(parent.toString()) * .setTemplate(template) * .build(); - * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(request).get(); + * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request); + * // Do something + * WorkflowTemplate response = future.get(); * } * - * - * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture instantiateInlineWorkflowTemplateAsync( - InstantiateInlineWorkflowTemplateRequest request) { - return instantiateInlineWorkflowTemplateOperationCallable().futureCall(request); + public final UnaryCallable + createWorkflowTemplateCallable() { + return stub.createWorkflowTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. + * Retrieves the latest workflow template. * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. + *

Sample code: * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + *


+   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
+   * }
+   * 
* - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * @param name Required. The resource name of the workflow template, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) { + GetWorkflowTemplateRequest request = + GetWorkflowTemplateRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getWorkflowTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the latest workflow template. * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
-   *     .build();
-   *   OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
    * }
    * 
+ * + * @param name Required. The resource name of the workflow template, as described in + * https://cloud.google.com/apis/design/resource_names. + *

* For `projects.regions.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + *

* For `projects.locations.workflowTemplates.get`, the resource name of the template + * has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - instantiateInlineWorkflowTemplateOperationCallable() { - return stub.instantiateInlineWorkflowTemplateOperationCallable(); + public final WorkflowTemplate getWorkflowTemplate(String name) { + GetWorkflowTemplateRequest request = + GetWorkflowTemplateRequest.newBuilder().setName(name).build(); + return getWorkflowTemplate(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Instantiates a template and begins execution. + * Retrieves the latest workflow template. * - *

This method is equivalent to executing the sequence - * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], - * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate], - * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * - *

The returned Operation can be used to track execution of workflow by polling - * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when - * entire workflow is finished. + *

Sample code: * - *

The running workflow can be aborted via - * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any - * inflight jobs to be cancelled and workflow-owned clusters to be deleted. + *


+   * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
+   * }
+   * 
* - *

The [Operation.metadata][google.longrunning.Operation.metadata] will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * @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 WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request) { + return getWorkflowTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the latest workflow template. * - *

On successful completion, [Operation.response][google.longrunning.Operation.response] will - * be [Empty][google.protobuf.Empty]. + *

Can retrieve previously instantiated template by specifying optional version parameter. * *

Sample code: * *


    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
-   *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
-   *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
-   *   InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTemplate(template)
+   *   WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *   GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateCallable().futureCall(request);
+   *   ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   WorkflowTemplate response = future.get();
    * }
    * 
*/ - public final UnaryCallable - instantiateInlineWorkflowTemplateCallable() { - return stub.instantiateInlineWorkflowTemplateCallable(); + public final UnaryCallable + getWorkflowTemplateCallable() { + return stub.getWorkflowTemplateCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceSettings.java index 7aa5c284..1cdc2e87 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceSettings.java @@ -71,19 +71,6 @@ @BetaApi public class WorkflowTemplateServiceSettings extends ClientSettings { - /** Returns the object with the settings used for calls to createWorkflowTemplate. */ - public UnaryCallSettings - createWorkflowTemplateSettings() { - return ((WorkflowTemplateServiceStubSettings) getStubSettings()) - .createWorkflowTemplateSettings(); - } - - /** Returns the object with the settings used for calls to getWorkflowTemplate. */ - public UnaryCallSettings - getWorkflowTemplateSettings() { - return ((WorkflowTemplateServiceStubSettings) getStubSettings()).getWorkflowTemplateSettings(); - } - /** Returns the object with the settings used for calls to instantiateWorkflowTemplate. */ public UnaryCallSettings instantiateWorkflowTemplateSettings() { @@ -116,6 +103,19 @@ public class WorkflowTemplateServiceSettings .instantiateInlineWorkflowTemplateOperationSettings(); } + /** Returns the object with the settings used for calls to createWorkflowTemplate. */ + public UnaryCallSettings + createWorkflowTemplateSettings() { + return ((WorkflowTemplateServiceStubSettings) getStubSettings()) + .createWorkflowTemplateSettings(); + } + + /** Returns the object with the settings used for calls to getWorkflowTemplate. */ + public UnaryCallSettings + getWorkflowTemplateSettings() { + return ((WorkflowTemplateServiceStubSettings) getStubSettings()).getWorkflowTemplateSettings(); + } + /** Returns the object with the settings used for calls to updateWorkflowTemplate. */ public UnaryCallSettings updateWorkflowTemplateSettings() { @@ -237,18 +237,6 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to createWorkflowTemplate. */ - public UnaryCallSettings.Builder - createWorkflowTemplateSettings() { - return getStubSettingsBuilder().createWorkflowTemplateSettings(); - } - - /** Returns the builder for the settings used for calls to getWorkflowTemplate. */ - public UnaryCallSettings.Builder - getWorkflowTemplateSettings() { - return getStubSettingsBuilder().getWorkflowTemplateSettings(); - } - /** Returns the builder for the settings used for calls to instantiateWorkflowTemplate. */ public UnaryCallSettings.Builder instantiateWorkflowTemplateSettings() { @@ -279,6 +267,18 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().instantiateInlineWorkflowTemplateOperationSettings(); } + /** Returns the builder for the settings used for calls to createWorkflowTemplate. */ + public UnaryCallSettings.Builder + createWorkflowTemplateSettings() { + return getStubSettingsBuilder().createWorkflowTemplateSettings(); + } + + /** Returns the builder for the settings used for calls to getWorkflowTemplate. */ + public UnaryCallSettings.Builder + getWorkflowTemplateSettings() { + return getStubSettingsBuilder().getWorkflowTemplateSettings(); + } + /** Returns the builder for the settings used for calls to updateWorkflowTemplate. */ public UnaryCallSettings.Builder updateWorkflowTemplateSettings() { diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java index a0a55161..03020574 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java @@ -316,11 +316,43 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_4_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_6_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_3_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.INTERNAL, + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_5_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_7_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -334,12 +366,88 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.3) .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_6_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build(); + definitions.put("retry_policy_3_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_7_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(900000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(900000L)) + .setTotalTimeout(Duration.ofMillis(900000L)) + .build(); + definitions.put("retry_policy_5_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(900000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(900000L)) + .setTotalTimeout(Duration.ofMillis(900000L)) + .build(); + definitions.put("retry_policy_4_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) .setTotalTimeout(Duration.ofMillis(600000L)) .build(); - definitions.put("default", settings); + definitions.put("no_retry_1_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -385,28 +493,28 @@ private static Builder initDefaults(Builder builder) { builder .createAutoscalingPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .updateAutoscalingPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .getAutoscalingPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listAutoscalingPoliciesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .deleteAutoscalingPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); return builder; } diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java index 8df92ae0..0981902f 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java @@ -80,6 +80,16 @@ public UnaryCallable deleteClusterCallable() { throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + diagnoseClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: diagnoseClusterOperationCallable()"); + } + + public UnaryCallable diagnoseClusterCallable() { + throw new UnsupportedOperationException("Not implemented: diagnoseClusterCallable()"); + } + public UnaryCallable getClusterCallable() { throw new UnsupportedOperationException("Not implemented: getClusterCallable()"); } @@ -92,16 +102,6 @@ public UnaryCallable listClustersCall throw new UnsupportedOperationException("Not implemented: listClustersCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - diagnoseClusterOperationCallable() { - throw new UnsupportedOperationException("Not implemented: diagnoseClusterOperationCallable()"); - } - - public UnaryCallable diagnoseClusterCallable() { - throw new UnsupportedOperationException("Not implemented: diagnoseClusterCallable()"); - } - @Override public abstract void close(); } diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java index 687a9604..4109126d 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java @@ -110,13 +110,13 @@ public class ClusterControllerStubSettings extends StubSettings deleteClusterSettings; private final OperationCallSettings deleteClusterOperationSettings; + private final UnaryCallSettings diagnoseClusterSettings; + private final OperationCallSettings + diagnoseClusterOperationSettings; private final UnaryCallSettings getClusterSettings; private final PagedCallSettings< ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> listClustersSettings; - private final UnaryCallSettings diagnoseClusterSettings; - private final OperationCallSettings - diagnoseClusterOperationSettings; /** Returns the object with the settings used for calls to createCluster. */ public UnaryCallSettings createClusterSettings() { @@ -154,17 +154,6 @@ public UnaryCallSettings deleteClusterSettings( return deleteClusterOperationSettings; } - /** Returns the object with the settings used for calls to getCluster. */ - public UnaryCallSettings getClusterSettings() { - return getClusterSettings; - } - - /** Returns the object with the settings used for calls to listClusters. */ - public PagedCallSettings - listClustersSettings() { - return listClustersSettings; - } - /** Returns the object with the settings used for calls to diagnoseCluster. */ public UnaryCallSettings diagnoseClusterSettings() { return diagnoseClusterSettings; @@ -177,6 +166,17 @@ public UnaryCallSettings diagnoseClusterSetti return diagnoseClusterOperationSettings; } + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return getClusterSettings; + } + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return listClustersSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public ClusterControllerStub createStub() throws IOException { if (getTransportChannelProvider() @@ -252,10 +252,10 @@ protected ClusterControllerStubSettings(Builder settingsBuilder) throws IOExcept updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build(); - getClusterSettings = settingsBuilder.getClusterSettings().build(); - listClustersSettings = settingsBuilder.listClustersSettings().build(); diagnoseClusterSettings = settingsBuilder.diagnoseClusterSettings().build(); diagnoseClusterOperationSettings = settingsBuilder.diagnoseClusterOperationSettings().build(); + getClusterSettings = settingsBuilder.getClusterSettings().build(); + listClustersSettings = settingsBuilder.listClustersSettings().build(); } private static final PagedListDescriptor @@ -327,15 +327,15 @@ public static class Builder extends StubSettings.Builder deleteClusterOperationSettings; - private final UnaryCallSettings.Builder getClusterSettings; - private final PagedCallSettings.Builder< - ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> - listClustersSettings; private final UnaryCallSettings.Builder diagnoseClusterSettings; private final OperationCallSettings.Builder< DiagnoseClusterRequest, Empty, ClusterOperationMetadata> diagnoseClusterOperationSettings; + private final UnaryCallSettings.Builder getClusterSettings; + private final PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -343,15 +343,16 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "idempotent", + "retry_policy_3_codes", ImmutableSet.copyOf( Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.INTERNAL, + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); definitions.put( - "non_idempotent", + "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -366,12 +367,25 @@ public static class Builder extends StubSettings.Builder>of( createClusterSettings, updateClusterSettings, deleteClusterSettings, + diagnoseClusterSettings, getClusterSettings, - listClustersSettings, - diagnoseClusterSettings); + listClustersSettings); initDefaults(this); } @@ -427,40 +441,40 @@ private static Builder initDefaults(Builder builder) { builder .createClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .updateClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .deleteClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder - .getClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .diagnoseClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder - .listClustersSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .getClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); builder - .diagnoseClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .listClustersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); builder .createClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) @@ -469,21 +483,21 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(10000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(900000L)) .build())); builder .updateClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) @@ -492,21 +506,21 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(10000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(900000L)) .build())); builder .deleteClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -515,21 +529,21 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(10000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(900000L)) .build())); builder .diagnoseClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -538,13 +552,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(10000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) .build())); return builder; @@ -559,19 +573,19 @@ protected Builder(ClusterControllerStubSettings settings) { updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder(); - getClusterSettings = settings.getClusterSettings.toBuilder(); - listClustersSettings = settings.listClustersSettings.toBuilder(); diagnoseClusterSettings = settings.diagnoseClusterSettings.toBuilder(); diagnoseClusterOperationSettings = settings.diagnoseClusterOperationSettings.toBuilder(); + getClusterSettings = settings.getClusterSettings.toBuilder(); + listClustersSettings = settings.listClustersSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( createClusterSettings, updateClusterSettings, deleteClusterSettings, + diagnoseClusterSettings, getClusterSettings, - listClustersSettings, - diagnoseClusterSettings); + listClustersSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -629,18 +643,6 @@ public UnaryCallSettings.Builder deleteClusterS return deleteClusterOperationSettings; } - /** Returns the builder for the settings used for calls to getCluster. */ - public UnaryCallSettings.Builder getClusterSettings() { - return getClusterSettings; - } - - /** Returns the builder for the settings used for calls to listClusters. */ - public PagedCallSettings.Builder< - ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> - listClustersSettings() { - return listClustersSettings; - } - /** Returns the builder for the settings used for calls to diagnoseCluster. */ public UnaryCallSettings.Builder diagnoseClusterSettings() { return diagnoseClusterSettings; @@ -654,6 +656,18 @@ public UnaryCallSettings.Builder diagnoseClus return diagnoseClusterOperationSettings; } + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getClusterSettings; + } + + /** Returns the builder for the settings used for calls to listClusters. */ + public PagedCallSettings.Builder< + ListClustersRequest, ListClustersResponse, ListClustersPagedResponse> + listClustersSettings() { + return listClustersSettings; + } + @Override public ClusterControllerStubSettings build() throws IOException { return new ClusterControllerStubSettings(this); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java index b9e155d5..402eb8f6 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java @@ -80,6 +80,15 @@ public class GrpcClusterControllerStub extends ClusterControllerStub { ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + diagnoseClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dataproc.v1beta2.ClusterController/DiagnoseCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DiagnoseClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor getClusterMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -96,15 +105,6 @@ public class GrpcClusterControllerStub extends ClusterControllerStub { .setResponseMarshaller( ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance())) .build(); - private static final MethodDescriptor - diagnoseClusterMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.dataproc.v1beta2.ClusterController/DiagnoseCluster") - .setRequestMarshaller( - ProtoUtils.marshaller(DiagnoseClusterRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -118,13 +118,13 @@ public class GrpcClusterControllerStub extends ClusterControllerStub { private final UnaryCallable deleteClusterCallable; private final OperationCallable deleteClusterOperationCallable; + private final UnaryCallable diagnoseClusterCallable; + private final OperationCallable + diagnoseClusterOperationCallable; private final UnaryCallable getClusterCallable; private final UnaryCallable listClustersCallable; private final UnaryCallable listClustersPagedCallable; - private final UnaryCallable diagnoseClusterCallable; - private final OperationCallable - diagnoseClusterOperationCallable; private final GrpcStubCallableFactory callableFactory; @@ -180,6 +180,10 @@ protected GrpcClusterControllerStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteClusterMethodDescriptor) .build(); + GrpcCallSettings diagnoseClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(diagnoseClusterMethodDescriptor) + .build(); GrpcCallSettings getClusterTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getClusterMethodDescriptor) @@ -188,10 +192,6 @@ protected GrpcClusterControllerStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(listClustersMethodDescriptor) .build(); - GrpcCallSettings diagnoseClusterTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(diagnoseClusterMethodDescriptor) - .build(); this.createClusterCallable = callableFactory.createUnaryCallable( @@ -220,15 +220,6 @@ protected GrpcClusterControllerStub( settings.deleteClusterOperationSettings(), clientContext, this.operationsStub); - this.getClusterCallable = - callableFactory.createUnaryCallable( - getClusterTransportSettings, settings.getClusterSettings(), clientContext); - this.listClustersCallable = - callableFactory.createUnaryCallable( - listClustersTransportSettings, settings.listClustersSettings(), clientContext); - this.listClustersPagedCallable = - callableFactory.createPagedCallable( - listClustersTransportSettings, settings.listClustersSettings(), clientContext); this.diagnoseClusterCallable = callableFactory.createUnaryCallable( diagnoseClusterTransportSettings, settings.diagnoseClusterSettings(), clientContext); @@ -238,6 +229,15 @@ protected GrpcClusterControllerStub( settings.diagnoseClusterOperationSettings(), clientContext, this.operationsStub); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -277,6 +277,16 @@ public UnaryCallable deleteClusterCallable() { return deleteClusterCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + diagnoseClusterOperationCallable() { + return diagnoseClusterOperationCallable; + } + + public UnaryCallable diagnoseClusterCallable() { + return diagnoseClusterCallable; + } + public UnaryCallable getClusterCallable() { return getClusterCallable; } @@ -289,16 +299,6 @@ public UnaryCallable listClustersCall return listClustersCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - diagnoseClusterOperationCallable() { - return diagnoseClusterOperationCallable; - } - - public UnaryCallable diagnoseClusterCallable() { - return diagnoseClusterCallable; - } - @Override public final void close() { shutdown(); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcJobControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcJobControllerStub.java index 3a92366c..cf798a51 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcJobControllerStub.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcJobControllerStub.java @@ -60,6 +60,14 @@ public class GrpcJobControllerStub extends JobControllerStub { .setRequestMarshaller(ProtoUtils.marshaller(SubmitJobRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) .build(); + private static final MethodDescriptor + submitJobAsOperationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dataproc.v1beta2.JobController/SubmitJobAsOperation") + .setRequestMarshaller(ProtoUtils.marshaller(SubmitJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor getJobMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -96,28 +104,20 @@ public class GrpcJobControllerStub extends JobControllerStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteJobRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private static final MethodDescriptor - submitJobAsOperationMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.dataproc.v1beta2.JobController/SubmitJobAsOperation") - .setRequestMarshaller(ProtoUtils.marshaller(SubmitJobRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; private final UnaryCallable submitJobCallable; + private final UnaryCallable submitJobAsOperationCallable; + private final OperationCallable + submitJobAsOperationOperationCallable; private final UnaryCallable getJobCallable; private final UnaryCallable listJobsCallable; private final UnaryCallable listJobsPagedCallable; private final UnaryCallable updateJobCallable; private final UnaryCallable cancelJobCallable; private final UnaryCallable deleteJobCallable; - private final UnaryCallable submitJobAsOperationCallable; - private final OperationCallable - submitJobAsOperationOperationCallable; private final GrpcStubCallableFactory callableFactory; @@ -163,6 +163,10 @@ protected GrpcJobControllerStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(submitJobMethodDescriptor) .build(); + GrpcCallSettings submitJobAsOperationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(submitJobAsOperationMethodDescriptor) + .build(); GrpcCallSettings getJobTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getJobMethodDescriptor) @@ -183,14 +187,21 @@ protected GrpcJobControllerStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteJobMethodDescriptor) .build(); - GrpcCallSettings submitJobAsOperationTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(submitJobAsOperationMethodDescriptor) - .build(); this.submitJobCallable = callableFactory.createUnaryCallable( submitJobTransportSettings, settings.submitJobSettings(), clientContext); + this.submitJobAsOperationCallable = + callableFactory.createUnaryCallable( + submitJobAsOperationTransportSettings, + settings.submitJobAsOperationSettings(), + clientContext); + this.submitJobAsOperationOperationCallable = + callableFactory.createOperationCallable( + submitJobAsOperationTransportSettings, + settings.submitJobAsOperationOperationSettings(), + clientContext, + this.operationsStub); this.getJobCallable = callableFactory.createUnaryCallable( getJobTransportSettings, settings.getJobSettings(), clientContext); @@ -209,17 +220,6 @@ protected GrpcJobControllerStub( this.deleteJobCallable = callableFactory.createUnaryCallable( deleteJobTransportSettings, settings.deleteJobSettings(), clientContext); - this.submitJobAsOperationCallable = - callableFactory.createUnaryCallable( - submitJobAsOperationTransportSettings, - settings.submitJobAsOperationSettings(), - clientContext); - this.submitJobAsOperationOperationCallable = - callableFactory.createOperationCallable( - submitJobAsOperationTransportSettings, - settings.submitJobAsOperationOperationSettings(), - clientContext, - this.operationsStub); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -233,6 +233,16 @@ public UnaryCallable submitJobCallable() { return submitJobCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + submitJobAsOperationOperationCallable() { + return submitJobAsOperationOperationCallable; + } + + public UnaryCallable submitJobAsOperationCallable() { + return submitJobAsOperationCallable; + } + public UnaryCallable getJobCallable() { return getJobCallable; } @@ -257,16 +267,6 @@ public UnaryCallable deleteJobCallable() { return deleteJobCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - submitJobAsOperationOperationCallable() { - return submitJobAsOperationOperationCallable; - } - - public UnaryCallable submitJobAsOperationCallable() { - return submitJobAsOperationCallable; - } - @Override public final void close() { shutdown(); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcWorkflowTemplateServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcWorkflowTemplateServiceStub.java index cec36e8b..0d14c4b8 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcWorkflowTemplateServiceStub.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcWorkflowTemplateServiceStub.java @@ -57,26 +57,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub { - private static final MethodDescriptor - createWorkflowTemplateMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.dataproc.v1beta2.WorkflowTemplateService/CreateWorkflowTemplate") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateWorkflowTemplateRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance())) - .build(); - private static final MethodDescriptor - getWorkflowTemplateMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.dataproc.v1beta2.WorkflowTemplateService/GetWorkflowTemplate") - .setRequestMarshaller( - ProtoUtils.marshaller(GetWorkflowTemplateRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance())) - .build(); private static final MethodDescriptor instantiateWorkflowTemplateMethodDescriptor = MethodDescriptor.newBuilder() @@ -98,6 +78,26 @@ public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub InstantiateInlineWorkflowTemplateRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + createWorkflowTemplateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dataproc.v1beta2.WorkflowTemplateService/CreateWorkflowTemplate") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateWorkflowTemplateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getWorkflowTemplateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dataproc.v1beta2.WorkflowTemplateService/GetWorkflowTemplate") + .setRequestMarshaller( + ProtoUtils.marshaller(GetWorkflowTemplateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(WorkflowTemplate.getDefaultInstance())) + .build(); private static final MethodDescriptor updateWorkflowTemplateMethodDescriptor = MethodDescriptor.newBuilder() @@ -133,10 +133,6 @@ public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; - private final UnaryCallable - createWorkflowTemplateCallable; - private final UnaryCallable - getWorkflowTemplateCallable; private final UnaryCallable instantiateWorkflowTemplateCallable; private final OperationCallable @@ -145,6 +141,10 @@ public class GrpcWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub instantiateInlineWorkflowTemplateCallable; private final OperationCallable instantiateInlineWorkflowTemplateOperationCallable; + private final UnaryCallable + createWorkflowTemplateCallable; + private final UnaryCallable + getWorkflowTemplateCallable; private final UnaryCallable updateWorkflowTemplateCallable; private final UnaryCallable @@ -196,34 +196,6 @@ protected GrpcWorkflowTemplateServiceStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings - createWorkflowTemplateTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createWorkflowTemplateMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateWorkflowTemplateRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); - GrpcCallSettings - getWorkflowTemplateTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getWorkflowTemplateMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetWorkflowTemplateRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); GrpcCallSettings instantiateWorkflowTemplateTransportSettings = GrpcCallSettings.newBuilder() @@ -254,6 +226,34 @@ public Map extract( } }) .build(); + GrpcCallSettings + createWorkflowTemplateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createWorkflowTemplateMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateWorkflowTemplateRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getWorkflowTemplateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkflowTemplateMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetWorkflowTemplateRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings updateWorkflowTemplateTransportSettings = GrpcCallSettings.newBuilder() @@ -298,16 +298,6 @@ public Map extract(DeleteWorkflowTemplateRequest request) { }) .build(); - this.createWorkflowTemplateCallable = - callableFactory.createUnaryCallable( - createWorkflowTemplateTransportSettings, - settings.createWorkflowTemplateSettings(), - clientContext); - this.getWorkflowTemplateCallable = - callableFactory.createUnaryCallable( - getWorkflowTemplateTransportSettings, - settings.getWorkflowTemplateSettings(), - clientContext); this.instantiateWorkflowTemplateCallable = callableFactory.createUnaryCallable( instantiateWorkflowTemplateTransportSettings, @@ -330,6 +320,16 @@ public Map extract(DeleteWorkflowTemplateRequest request) { settings.instantiateInlineWorkflowTemplateOperationSettings(), clientContext, this.operationsStub); + this.createWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + createWorkflowTemplateTransportSettings, + settings.createWorkflowTemplateSettings(), + clientContext); + this.getWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + getWorkflowTemplateTransportSettings, + settings.getWorkflowTemplateSettings(), + clientContext); this.updateWorkflowTemplateCallable = callableFactory.createUnaryCallable( updateWorkflowTemplateTransportSettings, @@ -359,15 +359,6 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable - createWorkflowTemplateCallable() { - return createWorkflowTemplateCallable; - } - - public UnaryCallable getWorkflowTemplateCallable() { - return getWorkflowTemplateCallable; - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable instantiateWorkflowTemplateOperationCallable() { @@ -390,6 +381,15 @@ public UnaryCallable getWorkflowTe return instantiateInlineWorkflowTemplateCallable; } + public UnaryCallable + createWorkflowTemplateCallable() { + return createWorkflowTemplateCallable; + } + + public UnaryCallable getWorkflowTemplateCallable() { + return getWorkflowTemplateCallable; + } + public UnaryCallable updateWorkflowTemplateCallable() { return updateWorkflowTemplateCallable; diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStub.java index 9054e313..98ecabe5 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStub.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStub.java @@ -54,6 +54,17 @@ public UnaryCallable submitJobCallable() { throw new UnsupportedOperationException("Not implemented: submitJobCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + submitJobAsOperationOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: submitJobAsOperationOperationCallable()"); + } + + public UnaryCallable submitJobAsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: submitJobAsOperationCallable()"); + } + public UnaryCallable getJobCallable() { throw new UnsupportedOperationException("Not implemented: getJobCallable()"); } @@ -78,17 +89,6 @@ public UnaryCallable deleteJobCallable() { throw new UnsupportedOperationException("Not implemented: deleteJobCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - submitJobAsOperationOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: submitJobAsOperationOperationCallable()"); - } - - public UnaryCallable submitJobAsOperationCallable() { - throw new UnsupportedOperationException("Not implemented: submitJobAsOperationCallable()"); - } - @Override public abstract void close(); } diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java index fe138db5..ed45827a 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java @@ -102,21 +102,33 @@ public class JobControllerStubSettings extends StubSettingsbuilder().add("https://www.googleapis.com/auth/cloud-platform").build(); private final UnaryCallSettings submitJobSettings; + private final UnaryCallSettings submitJobAsOperationSettings; + private final OperationCallSettings + submitJobAsOperationOperationSettings; private final UnaryCallSettings getJobSettings; private final PagedCallSettings listJobsSettings; private final UnaryCallSettings updateJobSettings; private final UnaryCallSettings cancelJobSettings; private final UnaryCallSettings deleteJobSettings; - private final UnaryCallSettings submitJobAsOperationSettings; - private final OperationCallSettings - submitJobAsOperationOperationSettings; /** Returns the object with the settings used for calls to submitJob. */ public UnaryCallSettings submitJobSettings() { return submitJobSettings; } + /** Returns the object with the settings used for calls to submitJobAsOperation. */ + public UnaryCallSettings submitJobAsOperationSettings() { + return submitJobAsOperationSettings; + } + + /** Returns the object with the settings used for calls to submitJobAsOperation. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + submitJobAsOperationOperationSettings() { + return submitJobAsOperationOperationSettings; + } + /** Returns the object with the settings used for calls to getJob. */ public UnaryCallSettings getJobSettings() { return getJobSettings; @@ -143,18 +155,6 @@ public UnaryCallSettings deleteJobSettings() { return deleteJobSettings; } - /** Returns the object with the settings used for calls to submitJobAsOperation. */ - public UnaryCallSettings submitJobAsOperationSettings() { - return submitJobAsOperationSettings; - } - - /** Returns the object with the settings used for calls to submitJobAsOperation. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings - submitJobAsOperationOperationSettings() { - return submitJobAsOperationOperationSettings; - } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public JobControllerStub createStub() throws IOException { if (getTransportChannelProvider() @@ -225,14 +225,14 @@ protected JobControllerStubSettings(Builder settingsBuilder) throws IOException super(settingsBuilder); submitJobSettings = settingsBuilder.submitJobSettings().build(); + submitJobAsOperationSettings = settingsBuilder.submitJobAsOperationSettings().build(); + submitJobAsOperationOperationSettings = + settingsBuilder.submitJobAsOperationOperationSettings().build(); getJobSettings = settingsBuilder.getJobSettings().build(); listJobsSettings = settingsBuilder.listJobsSettings().build(); updateJobSettings = settingsBuilder.updateJobSettings().build(); cancelJobSettings = settingsBuilder.cancelJobSettings().build(); deleteJobSettings = settingsBuilder.deleteJobSettings().build(); - submitJobAsOperationSettings = settingsBuilder.submitJobAsOperationSettings().build(); - submitJobAsOperationOperationSettings = - settingsBuilder.submitJobAsOperationOperationSettings().build(); } private static final PagedListDescriptor @@ -292,6 +292,10 @@ public static class Builder extends StubSettings.Builder> unaryMethodSettingsBuilders; private final UnaryCallSettings.Builder submitJobSettings; + private final UnaryCallSettings.Builder + submitJobAsOperationSettings; + private final OperationCallSettings.Builder + submitJobAsOperationOperationSettings; private final UnaryCallSettings.Builder getJobSettings; private final PagedCallSettings.Builder< ListJobsRequest, ListJobsResponse, ListJobsPagedResponse> @@ -299,10 +303,6 @@ public static class Builder extends StubSettings.Builder updateJobSettings; private final UnaryCallSettings.Builder cancelJobSettings; private final UnaryCallSettings.Builder deleteJobSettings; - private final UnaryCallSettings.Builder - submitJobAsOperationSettings; - private final OperationCallSettings.Builder - submitJobAsOperationOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -311,17 +311,43 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_4_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_6_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_3_codes", ImmutableSet.copyOf( Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.INTERNAL, + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); definitions.put( - "non_idempotent2", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "non_idempotent", + "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_5_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_7_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -335,12 +361,88 @@ public static class Builder extends StubSettings.Builder>of( submitJobSettings, + submitJobAsOperationSettings, getJobSettings, listJobsSettings, updateJobSettings, cancelJobSettings, - deleteJobSettings, - submitJobAsOperationSettings); + deleteJobSettings); initDefaults(this); } @@ -393,44 +495,44 @@ private static Builder initDefaults(Builder builder) { builder .submitJobSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); + + builder + .submitJobAsOperationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); builder .getJobSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .listJobsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .updateJobSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); builder .cancelJobSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .deleteJobSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder - .submitJobAsOperationSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent2")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); builder .submitJobAsOperationOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent2")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")) .build()) .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Job.class)) .setMetadataTransformer( @@ -454,24 +556,24 @@ protected Builder(JobControllerStubSettings settings) { super(settings); submitJobSettings = settings.submitJobSettings.toBuilder(); + submitJobAsOperationSettings = settings.submitJobAsOperationSettings.toBuilder(); + submitJobAsOperationOperationSettings = + settings.submitJobAsOperationOperationSettings.toBuilder(); getJobSettings = settings.getJobSettings.toBuilder(); listJobsSettings = settings.listJobsSettings.toBuilder(); updateJobSettings = settings.updateJobSettings.toBuilder(); cancelJobSettings = settings.cancelJobSettings.toBuilder(); deleteJobSettings = settings.deleteJobSettings.toBuilder(); - submitJobAsOperationSettings = settings.submitJobAsOperationSettings.toBuilder(); - submitJobAsOperationOperationSettings = - settings.submitJobAsOperationOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( submitJobSettings, + submitJobAsOperationSettings, getJobSettings, listJobsSettings, updateJobSettings, cancelJobSettings, - deleteJobSettings, - submitJobAsOperationSettings); + deleteJobSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -495,6 +597,19 @@ public UnaryCallSettings.Builder submitJobSettings() { return submitJobSettings; } + /** Returns the builder for the settings used for calls to submitJobAsOperation. */ + public UnaryCallSettings.Builder submitJobAsOperationSettings() { + return submitJobAsOperationSettings; + } + + /** Returns the builder for the settings used for calls to submitJobAsOperation. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + submitJobAsOperationOperationSettings() { + return submitJobAsOperationOperationSettings; + } + /** Returns the builder for the settings used for calls to getJob. */ public UnaryCallSettings.Builder getJobSettings() { return getJobSettings; @@ -521,19 +636,6 @@ public UnaryCallSettings.Builder deleteJobSettings() { return deleteJobSettings; } - /** Returns the builder for the settings used for calls to submitJobAsOperation. */ - public UnaryCallSettings.Builder submitJobAsOperationSettings() { - return submitJobAsOperationSettings; - } - - /** Returns the builder for the settings used for calls to submitJobAsOperation. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - submitJobAsOperationOperationSettings() { - return submitJobAsOperationOperationSettings; - } - @Override public JobControllerStubSettings build() throws IOException { return new JobControllerStubSettings(this); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStub.java index 05132d35..16b566c7 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStub.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStub.java @@ -51,15 +51,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - public UnaryCallable - createWorkflowTemplateCallable() { - throw new UnsupportedOperationException("Not implemented: createWorkflowTemplateCallable()"); - } - - public UnaryCallable getWorkflowTemplateCallable() { - throw new UnsupportedOperationException("Not implemented: getWorkflowTemplateCallable()"); - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable instantiateWorkflowTemplateOperationCallable() { @@ -86,6 +77,15 @@ public UnaryCallable getWorkflowTe "Not implemented: instantiateInlineWorkflowTemplateCallable()"); } + public UnaryCallable + createWorkflowTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkflowTemplateCallable()"); + } + + public UnaryCallable getWorkflowTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkflowTemplateCallable()"); + } + public UnaryCallable updateWorkflowTemplateCallable() { throw new UnsupportedOperationException("Not implemented: updateWorkflowTemplateCallable()"); diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStubSettings.java index 08a32095..e2d7f86e 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStubSettings.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/WorkflowTemplateServiceStubSettings.java @@ -103,10 +103,6 @@ public class WorkflowTemplateServiceStubSettings private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - private final UnaryCallSettings - createWorkflowTemplateSettings; - private final UnaryCallSettings - getWorkflowTemplateSettings; private final UnaryCallSettings instantiateWorkflowTemplateSettings; private final OperationCallSettings @@ -116,6 +112,10 @@ public class WorkflowTemplateServiceStubSettings private final OperationCallSettings< InstantiateInlineWorkflowTemplateRequest, Empty, WorkflowMetadata> instantiateInlineWorkflowTemplateOperationSettings; + private final UnaryCallSettings + createWorkflowTemplateSettings; + private final UnaryCallSettings + getWorkflowTemplateSettings; private final UnaryCallSettings updateWorkflowTemplateSettings; private final PagedCallSettings< @@ -126,18 +126,6 @@ public class WorkflowTemplateServiceStubSettings private final UnaryCallSettings deleteWorkflowTemplateSettings; - /** Returns the object with the settings used for calls to createWorkflowTemplate. */ - public UnaryCallSettings - createWorkflowTemplateSettings() { - return createWorkflowTemplateSettings; - } - - /** Returns the object with the settings used for calls to getWorkflowTemplate. */ - public UnaryCallSettings - getWorkflowTemplateSettings() { - return getWorkflowTemplateSettings; - } - /** Returns the object with the settings used for calls to instantiateWorkflowTemplate. */ public UnaryCallSettings instantiateWorkflowTemplateSettings() { @@ -164,6 +152,18 @@ public class WorkflowTemplateServiceStubSettings return instantiateInlineWorkflowTemplateOperationSettings; } + /** Returns the object with the settings used for calls to createWorkflowTemplate. */ + public UnaryCallSettings + createWorkflowTemplateSettings() { + return createWorkflowTemplateSettings; + } + + /** Returns the object with the settings used for calls to getWorkflowTemplate. */ + public UnaryCallSettings + getWorkflowTemplateSettings() { + return getWorkflowTemplateSettings; + } + /** Returns the object with the settings used for calls to updateWorkflowTemplate. */ public UnaryCallSettings updateWorkflowTemplateSettings() { @@ -253,8 +253,6 @@ public Builder toBuilder() { protected WorkflowTemplateServiceStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); - createWorkflowTemplateSettings = settingsBuilder.createWorkflowTemplateSettings().build(); - getWorkflowTemplateSettings = settingsBuilder.getWorkflowTemplateSettings().build(); instantiateWorkflowTemplateSettings = settingsBuilder.instantiateWorkflowTemplateSettings().build(); instantiateWorkflowTemplateOperationSettings = @@ -263,6 +261,8 @@ protected WorkflowTemplateServiceStubSettings(Builder settingsBuilder) throws IO settingsBuilder.instantiateInlineWorkflowTemplateSettings().build(); instantiateInlineWorkflowTemplateOperationSettings = settingsBuilder.instantiateInlineWorkflowTemplateOperationSettings().build(); + createWorkflowTemplateSettings = settingsBuilder.createWorkflowTemplateSettings().build(); + getWorkflowTemplateSettings = settingsBuilder.getWorkflowTemplateSettings().build(); updateWorkflowTemplateSettings = settingsBuilder.updateWorkflowTemplateSettings().build(); listWorkflowTemplatesSettings = settingsBuilder.listWorkflowTemplatesSettings().build(); deleteWorkflowTemplateSettings = settingsBuilder.deleteWorkflowTemplateSettings().build(); @@ -338,10 +338,6 @@ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder - createWorkflowTemplateSettings; - private final UnaryCallSettings.Builder - getWorkflowTemplateSettings; private final UnaryCallSettings.Builder instantiateWorkflowTemplateSettings; private final OperationCallSettings.Builder< @@ -352,6 +348,10 @@ public static class Builder private final OperationCallSettings.Builder< InstantiateInlineWorkflowTemplateRequest, Empty, WorkflowMetadata> instantiateInlineWorkflowTemplateOperationSettings; + private final UnaryCallSettings.Builder + createWorkflowTemplateSettings; + private final UnaryCallSettings.Builder + getWorkflowTemplateSettings; private final UnaryCallSettings.Builder updateWorkflowTemplateSettings; private final PagedCallSettings.Builder< @@ -369,15 +369,16 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_6_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_7_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.INTERNAL, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -391,12 +392,25 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.3) .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_6_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) .setTotalTimeout(Duration.ofMillis(600000L)) .build(); - definitions.put("default", settings); + definitions.put("retry_policy_7_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -407,10 +421,6 @@ protected Builder() { protected Builder(ClientContext clientContext) { super(clientContext); - createWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - getWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - instantiateWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); instantiateWorkflowTemplateOperationSettings = OperationCallSettings.newBuilder(); @@ -419,6 +429,10 @@ protected Builder(ClientContext clientContext) { instantiateInlineWorkflowTemplateOperationSettings = OperationCallSettings.newBuilder(); + createWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateWorkflowTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listWorkflowTemplatesSettings = @@ -428,10 +442,10 @@ protected Builder(ClientContext clientContext) { unaryMethodSettingsBuilders = ImmutableList.>of( - createWorkflowTemplateSettings, - getWorkflowTemplateSettings, instantiateWorkflowTemplateSettings, instantiateInlineWorkflowTemplateSettings, + createWorkflowTemplateSettings, + getWorkflowTemplateSettings, updateWorkflowTemplateSettings, listWorkflowTemplatesSettings, deleteWorkflowTemplateSettings); @@ -451,47 +465,47 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder - .createWorkflowTemplateSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .instantiateWorkflowTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); builder - .getWorkflowTemplateSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .instantiateInlineWorkflowTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); builder - .instantiateWorkflowTemplateSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .createWorkflowTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); builder - .instantiateInlineWorkflowTemplateSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .getWorkflowTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); builder .updateWorkflowTemplateSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); builder .listWorkflowTemplatesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); builder .deleteWorkflowTemplateSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); builder .instantiateWorkflowTemplateOperationSettings() .setInitialCallSettings( UnaryCallSettings . newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -500,13 +514,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(10000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(43200000L)) .build())); builder .instantiateInlineWorkflowTemplateOperationSettings() @@ -514,8 +528,8 @@ private static Builder initDefaults(Builder builder) { UnaryCallSettings . newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -524,13 +538,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(10000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(43200000L)) .build())); return builder; @@ -539,8 +553,6 @@ private static Builder initDefaults(Builder builder) { protected Builder(WorkflowTemplateServiceStubSettings settings) { super(settings); - createWorkflowTemplateSettings = settings.createWorkflowTemplateSettings.toBuilder(); - getWorkflowTemplateSettings = settings.getWorkflowTemplateSettings.toBuilder(); instantiateWorkflowTemplateSettings = settings.instantiateWorkflowTemplateSettings.toBuilder(); instantiateWorkflowTemplateOperationSettings = @@ -549,16 +561,18 @@ protected Builder(WorkflowTemplateServiceStubSettings settings) { settings.instantiateInlineWorkflowTemplateSettings.toBuilder(); instantiateInlineWorkflowTemplateOperationSettings = settings.instantiateInlineWorkflowTemplateOperationSettings.toBuilder(); + createWorkflowTemplateSettings = settings.createWorkflowTemplateSettings.toBuilder(); + getWorkflowTemplateSettings = settings.getWorkflowTemplateSettings.toBuilder(); updateWorkflowTemplateSettings = settings.updateWorkflowTemplateSettings.toBuilder(); listWorkflowTemplatesSettings = settings.listWorkflowTemplatesSettings.toBuilder(); deleteWorkflowTemplateSettings = settings.deleteWorkflowTemplateSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - createWorkflowTemplateSettings, - getWorkflowTemplateSettings, instantiateWorkflowTemplateSettings, instantiateInlineWorkflowTemplateSettings, + createWorkflowTemplateSettings, + getWorkflowTemplateSettings, updateWorkflowTemplateSettings, listWorkflowTemplatesSettings, deleteWorkflowTemplateSettings); @@ -580,18 +594,6 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to createWorkflowTemplate. */ - public UnaryCallSettings.Builder - createWorkflowTemplateSettings() { - return createWorkflowTemplateSettings; - } - - /** Returns the builder for the settings used for calls to getWorkflowTemplate. */ - public UnaryCallSettings.Builder - getWorkflowTemplateSettings() { - return getWorkflowTemplateSettings; - } - /** Returns the builder for the settings used for calls to instantiateWorkflowTemplate. */ public UnaryCallSettings.Builder instantiateWorkflowTemplateSettings() { @@ -622,6 +624,18 @@ public Builder applyToAllUnaryMethods( return instantiateInlineWorkflowTemplateOperationSettings; } + /** Returns the builder for the settings used for calls to createWorkflowTemplate. */ + public UnaryCallSettings.Builder + createWorkflowTemplateSettings() { + return createWorkflowTemplateSettings; + } + + /** Returns the builder for the settings used for calls to getWorkflowTemplate. */ + public UnaryCallSettings.Builder + getWorkflowTemplateSettings() { + return getWorkflowTemplateSettings; + } + /** Returns the builder for the settings used for calls to updateWorkflowTemplate. */ public UnaryCallSettings.Builder updateWorkflowTemplateSettings() { diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java index e49c4622..7282abc0 100644 --- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java +++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java @@ -91,7 +91,7 @@ public void tearDown() throws Exception { @Test @SuppressWarnings("all") - public void updateAutoscalingPolicyTest() { + public void createAutoscalingPolicyTest() { String id = "id3355"; AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( @@ -100,16 +100,18 @@ public void updateAutoscalingPolicyTest() { AutoscalingPolicy.newBuilder().setId(id).setName(name.toString()).build(); mockAutoscalingPolicyService.addResponse(expectedResponse); + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); - AutoscalingPolicy actualResponse = client.updateAutoscalingPolicy(policy); + AutoscalingPolicy actualResponse = client.createAutoscalingPolicy(parent, policy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoscalingPolicyService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateAutoscalingPolicyRequest actualRequest = - (UpdateAutoscalingPolicyRequest) actualRequests.get(0); + CreateAutoscalingPolicyRequest actualRequest = + (CreateAutoscalingPolicyRequest) actualRequests.get(0); + Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent())); Assert.assertEquals(policy, actualRequest.getPolicy()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -119,14 +121,15 @@ public void updateAutoscalingPolicyTest() { @Test @SuppressWarnings("all") - public void updateAutoscalingPolicyExceptionTest() throws Exception { + public void createAutoscalingPolicyExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoscalingPolicyService.addException(exception); try { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); - client.updateAutoscalingPolicy(policy); + client.createAutoscalingPolicy(parent, policy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -135,7 +138,7 @@ public void updateAutoscalingPolicyExceptionTest() throws Exception { @Test @SuppressWarnings("all") - public void createAutoscalingPolicyTest() { + public void updateAutoscalingPolicyTest() { String id = "id3355"; AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( @@ -144,18 +147,16 @@ public void createAutoscalingPolicyTest() { AutoscalingPolicy.newBuilder().setId(id).setName(name.toString()).build(); mockAutoscalingPolicyService.addResponse(expectedResponse); - RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); - AutoscalingPolicy actualResponse = client.createAutoscalingPolicy(parent, policy); + AutoscalingPolicy actualResponse = client.updateAutoscalingPolicy(policy); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoscalingPolicyService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateAutoscalingPolicyRequest actualRequest = - (CreateAutoscalingPolicyRequest) actualRequests.get(0); + UpdateAutoscalingPolicyRequest actualRequest = + (UpdateAutoscalingPolicyRequest) actualRequests.get(0); - Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent())); Assert.assertEquals(policy, actualRequest.getPolicy()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -165,15 +166,14 @@ public void createAutoscalingPolicyTest() { @Test @SuppressWarnings("all") - public void createAutoscalingPolicyExceptionTest() throws Exception { + public void updateAutoscalingPolicyExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoscalingPolicyService.addException(exception); try { - RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); - client.createAutoscalingPolicy(parent, policy); + client.updateAutoscalingPolicy(policy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java index cc162f76..fece24b4 100644 --- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java +++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java @@ -273,6 +273,58 @@ public void deleteClusterExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void diagnoseClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("diagnoseClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockClusterController.addResponse(resultOperation); + + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + String clusterName = "clusterName-1018081872"; + + Empty actualResponse = client.diagnoseClusterAsync(projectId, region, clusterName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockClusterController.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DiagnoseClusterRequest actualRequest = (DiagnoseClusterRequest) actualRequests.get(0); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(region, actualRequest.getRegion()); + Assert.assertEquals(clusterName, actualRequest.getClusterName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void diagnoseClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockClusterController.addException(exception); + + try { + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + String clusterName = "clusterName-1018081872"; + + client.diagnoseClusterAsync(projectId, region, clusterName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void getClusterTest() { @@ -426,56 +478,4 @@ public void listClustersExceptionTest2() throws Exception { // Expected exception } } - - @Test - @SuppressWarnings("all") - public void diagnoseClusterTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("diagnoseClusterTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockClusterController.addResponse(resultOperation); - - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - String clusterName = "clusterName-1018081872"; - - Empty actualResponse = client.diagnoseClusterAsync(projectId, region, clusterName).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockClusterController.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DiagnoseClusterRequest actualRequest = (DiagnoseClusterRequest) actualRequests.get(0); - - Assert.assertEquals(projectId, actualRequest.getProjectId()); - Assert.assertEquals(region, actualRequest.getRegion()); - Assert.assertEquals(clusterName, actualRequest.getClusterName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void diagnoseClusterExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockClusterController.addException(exception); - - try { - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - String clusterName = "clusterName-1018081872"; - - client.diagnoseClusterAsync(projectId, region, clusterName).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } } diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java index bbd73369..1999bf0f 100644 --- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java +++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java @@ -148,6 +148,68 @@ public void submitJobExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void submitJobAsOperationTest() throws Exception { + String driverOutputResourceUri = "driverOutputResourceUri-542229086"; + String driverControlFilesUri = "driverControlFilesUri207057643"; + String jobUuid = "jobUuid-1615012099"; + boolean done = true; + Job expectedResponse = + Job.newBuilder() + .setDriverOutputResourceUri(driverOutputResourceUri) + .setDriverControlFilesUri(driverControlFilesUri) + .setJobUuid(jobUuid) + .setDone(done) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("submitJobAsOperationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockJobController.addResponse(resultOperation); + + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + Job job = Job.newBuilder().build(); + + Job actualResponse = client.submitJobAsOperationAsync(projectId, region, job).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockJobController.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SubmitJobRequest actualRequest = (SubmitJobRequest) actualRequests.get(0); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(region, actualRequest.getRegion()); + Assert.assertEquals(job, actualRequest.getJob()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void submitJobAsOperationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockJobController.addException(exception); + + try { + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + Job job = Job.newBuilder().build(); + + client.submitJobAsOperationAsync(projectId, region, job).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void getJobTest() { @@ -470,66 +532,4 @@ public void deleteJobExceptionTest() throws Exception { // Expected exception } } - - @Test - @SuppressWarnings("all") - public void submitJobAsOperationTest() throws Exception { - String driverOutputResourceUri = "driverOutputResourceUri-542229086"; - String driverControlFilesUri = "driverControlFilesUri207057643"; - String jobUuid = "jobUuid-1615012099"; - boolean done = true; - Job expectedResponse = - Job.newBuilder() - .setDriverOutputResourceUri(driverOutputResourceUri) - .setDriverControlFilesUri(driverControlFilesUri) - .setJobUuid(jobUuid) - .setDone(done) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("submitJobAsOperationTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockJobController.addResponse(resultOperation); - - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - Job job = Job.newBuilder().build(); - - Job actualResponse = client.submitJobAsOperationAsync(projectId, region, job).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockJobController.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SubmitJobRequest actualRequest = (SubmitJobRequest) actualRequests.get(0); - - Assert.assertEquals(projectId, actualRequest.getProjectId()); - Assert.assertEquals(region, actualRequest.getRegion()); - Assert.assertEquals(job, actualRequest.getJob()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void submitJobAsOperationExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockJobController.addException(exception); - - try { - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - Job job = Job.newBuilder().build(); - - client.submitJobAsOperationAsync(projectId, region, job).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } } diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java index 87142384..86de1d08 100644 --- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java +++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java @@ -95,110 +95,6 @@ public void tearDown() throws Exception { client.close(); } - @Test - @SuppressWarnings("all") - public void createWorkflowTemplateTest() { - String id = "id3355"; - WorkflowTemplateName name = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - int version = 351608024; - WorkflowTemplate expectedResponse = - WorkflowTemplate.newBuilder() - .setId(id) - .setName(name.toString()) - .setVersion(version) - .build(); - mockWorkflowTemplateService.addResponse(expectedResponse); - - RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); - WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - - WorkflowTemplate actualResponse = client.createWorkflowTemplate(parent, template); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockWorkflowTemplateService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateWorkflowTemplateRequest actualRequest = - (CreateWorkflowTemplateRequest) actualRequests.get(0); - - Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent())); - Assert.assertEquals(template, actualRequest.getTemplate()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void createWorkflowTemplateExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockWorkflowTemplateService.addException(exception); - - try { - RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); - WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - - client.createWorkflowTemplate(parent, template); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getWorkflowTemplateTest() { - String id = "id3355"; - WorkflowTemplateName name2 = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - int version = 351608024; - WorkflowTemplate expectedResponse = - WorkflowTemplate.newBuilder() - .setId(id) - .setName(name2.toString()) - .setVersion(version) - .build(); - mockWorkflowTemplateService.addResponse(expectedResponse); - - WorkflowTemplateName name = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - - WorkflowTemplate actualResponse = client.getWorkflowTemplate(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockWorkflowTemplateService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetWorkflowTemplateRequest actualRequest = (GetWorkflowTemplateRequest) actualRequests.get(0); - - Assert.assertEquals(name, WorkflowTemplateName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getWorkflowTemplateExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockWorkflowTemplateService.addException(exception); - - try { - WorkflowTemplateName name = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - - client.getWorkflowTemplate(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - @Test @SuppressWarnings("all") public void instantiateWorkflowTemplateTest() throws Exception { @@ -354,6 +250,110 @@ public void instantiateInlineWorkflowTemplateExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void createWorkflowTemplateTest() { + String id = "id3355"; + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + int version = 351608024; + WorkflowTemplate expectedResponse = + WorkflowTemplate.newBuilder() + .setId(id) + .setName(name.toString()) + .setVersion(version) + .build(); + mockWorkflowTemplateService.addResponse(expectedResponse); + + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + + WorkflowTemplate actualResponse = client.createWorkflowTemplate(parent, template); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflowTemplateService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkflowTemplateRequest actualRequest = + (CreateWorkflowTemplateRequest) actualRequests.get(0); + + Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent())); + Assert.assertEquals(template, actualRequest.getTemplate()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createWorkflowTemplateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWorkflowTemplateService.addException(exception); + + try { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + + client.createWorkflowTemplate(parent, template); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getWorkflowTemplateTest() { + String id = "id3355"; + WorkflowTemplateName name2 = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + int version = 351608024; + WorkflowTemplate expectedResponse = + WorkflowTemplate.newBuilder() + .setId(id) + .setName(name2.toString()) + .setVersion(version) + .build(); + mockWorkflowTemplateService.addResponse(expectedResponse); + + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + + WorkflowTemplate actualResponse = client.getWorkflowTemplate(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflowTemplateService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkflowTemplateRequest actualRequest = (GetWorkflowTemplateRequest) actualRequests.get(0); + + Assert.assertEquals(name, WorkflowTemplateName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getWorkflowTemplateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWorkflowTemplateService.addException(exception); + + try { + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + + client.getWorkflowTemplate(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void updateWorkflowTemplateTest() { diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClientTest.java index f5941e31..df7d1e24 100644 --- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClientTest.java +++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClientTest.java @@ -273,6 +273,58 @@ public void deleteClusterExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void diagnoseClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("diagnoseClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockClusterController.addResponse(resultOperation); + + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + String clusterName = "clusterName-1018081872"; + + Empty actualResponse = client.diagnoseClusterAsync(projectId, region, clusterName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockClusterController.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DiagnoseClusterRequest actualRequest = (DiagnoseClusterRequest) actualRequests.get(0); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(region, actualRequest.getRegion()); + Assert.assertEquals(clusterName, actualRequest.getClusterName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void diagnoseClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockClusterController.addException(exception); + + try { + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + String clusterName = "clusterName-1018081872"; + + client.diagnoseClusterAsync(projectId, region, clusterName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void getClusterTest() { @@ -426,56 +478,4 @@ public void listClustersExceptionTest2() throws Exception { // Expected exception } } - - @Test - @SuppressWarnings("all") - public void diagnoseClusterTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("diagnoseClusterTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockClusterController.addResponse(resultOperation); - - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - String clusterName = "clusterName-1018081872"; - - Empty actualResponse = client.diagnoseClusterAsync(projectId, region, clusterName).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockClusterController.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DiagnoseClusterRequest actualRequest = (DiagnoseClusterRequest) actualRequests.get(0); - - Assert.assertEquals(projectId, actualRequest.getProjectId()); - Assert.assertEquals(region, actualRequest.getRegion()); - Assert.assertEquals(clusterName, actualRequest.getClusterName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void diagnoseClusterExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockClusterController.addException(exception); - - try { - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - String clusterName = "clusterName-1018081872"; - - client.diagnoseClusterAsync(projectId, region, clusterName).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } } diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/JobControllerClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/JobControllerClientTest.java index 7dce00fc..0b686f20 100644 --- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/JobControllerClientTest.java +++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/JobControllerClientTest.java @@ -150,6 +150,70 @@ public void submitJobExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void submitJobAsOperationTest() throws Exception { + String submittedBy = "submittedBy-2047729125"; + String driverOutputResourceUri = "driverOutputResourceUri-542229086"; + String driverControlFilesUri = "driverControlFilesUri207057643"; + String jobUuid = "jobUuid-1615012099"; + boolean done = true; + Job expectedResponse = + Job.newBuilder() + .setSubmittedBy(submittedBy) + .setDriverOutputResourceUri(driverOutputResourceUri) + .setDriverControlFilesUri(driverControlFilesUri) + .setJobUuid(jobUuid) + .setDone(done) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("submitJobAsOperationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockJobController.addResponse(resultOperation); + + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + Job job = Job.newBuilder().build(); + + Job actualResponse = client.submitJobAsOperationAsync(projectId, region, job).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockJobController.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SubmitJobRequest actualRequest = (SubmitJobRequest) actualRequests.get(0); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(region, actualRequest.getRegion()); + Assert.assertEquals(job, actualRequest.getJob()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void submitJobAsOperationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockJobController.addException(exception); + + try { + String projectId = "projectId-1969970175"; + String region = "region-934795532"; + Job job = Job.newBuilder().build(); + + client.submitJobAsOperationAsync(projectId, region, job).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void getJobTest() { @@ -478,68 +542,4 @@ public void deleteJobExceptionTest() throws Exception { // Expected exception } } - - @Test - @SuppressWarnings("all") - public void submitJobAsOperationTest() throws Exception { - String submittedBy = "submittedBy-2047729125"; - String driverOutputResourceUri = "driverOutputResourceUri-542229086"; - String driverControlFilesUri = "driverControlFilesUri207057643"; - String jobUuid = "jobUuid-1615012099"; - boolean done = true; - Job expectedResponse = - Job.newBuilder() - .setSubmittedBy(submittedBy) - .setDriverOutputResourceUri(driverOutputResourceUri) - .setDriverControlFilesUri(driverControlFilesUri) - .setJobUuid(jobUuid) - .setDone(done) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("submitJobAsOperationTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockJobController.addResponse(resultOperation); - - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - Job job = Job.newBuilder().build(); - - Job actualResponse = client.submitJobAsOperationAsync(projectId, region, job).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockJobController.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SubmitJobRequest actualRequest = (SubmitJobRequest) actualRequests.get(0); - - Assert.assertEquals(projectId, actualRequest.getProjectId()); - Assert.assertEquals(region, actualRequest.getRegion()); - Assert.assertEquals(job, actualRequest.getJob()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void submitJobAsOperationExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockJobController.addException(exception); - - try { - String projectId = "projectId-1969970175"; - String region = "region-934795532"; - Job job = Job.newBuilder().build(); - - client.submitJobAsOperationAsync(projectId, region, job).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } } diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java index 228429a2..66f0b181 100644 --- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java +++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java @@ -95,110 +95,6 @@ public void tearDown() throws Exception { client.close(); } - @Test - @SuppressWarnings("all") - public void createWorkflowTemplateTest() { - String id = "id3355"; - WorkflowTemplateName name = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - int version = 351608024; - WorkflowTemplate expectedResponse = - WorkflowTemplate.newBuilder() - .setId(id) - .setName(name.toString()) - .setVersion(version) - .build(); - mockWorkflowTemplateService.addResponse(expectedResponse); - - RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); - WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - - WorkflowTemplate actualResponse = client.createWorkflowTemplate(parent, template); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockWorkflowTemplateService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateWorkflowTemplateRequest actualRequest = - (CreateWorkflowTemplateRequest) actualRequests.get(0); - - Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent())); - Assert.assertEquals(template, actualRequest.getTemplate()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void createWorkflowTemplateExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockWorkflowTemplateService.addException(exception); - - try { - RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); - WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); - - client.createWorkflowTemplate(parent, template); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getWorkflowTemplateTest() { - String id = "id3355"; - WorkflowTemplateName name2 = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - int version = 351608024; - WorkflowTemplate expectedResponse = - WorkflowTemplate.newBuilder() - .setId(id) - .setName(name2.toString()) - .setVersion(version) - .build(); - mockWorkflowTemplateService.addResponse(expectedResponse); - - WorkflowTemplateName name = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - - WorkflowTemplate actualResponse = client.getWorkflowTemplate(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockWorkflowTemplateService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetWorkflowTemplateRequest actualRequest = (GetWorkflowTemplateRequest) actualRequests.get(0); - - Assert.assertEquals(name, WorkflowTemplateName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getWorkflowTemplateExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockWorkflowTemplateService.addException(exception); - - try { - WorkflowTemplateName name = - WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( - "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); - - client.getWorkflowTemplate(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - @Test @SuppressWarnings("all") public void instantiateWorkflowTemplateTest() throws Exception { @@ -354,6 +250,110 @@ public void instantiateInlineWorkflowTemplateExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void createWorkflowTemplateTest() { + String id = "id3355"; + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + int version = 351608024; + WorkflowTemplate expectedResponse = + WorkflowTemplate.newBuilder() + .setId(id) + .setName(name.toString()) + .setVersion(version) + .build(); + mockWorkflowTemplateService.addResponse(expectedResponse); + + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + + WorkflowTemplate actualResponse = client.createWorkflowTemplate(parent, template); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflowTemplateService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkflowTemplateRequest actualRequest = + (CreateWorkflowTemplateRequest) actualRequests.get(0); + + Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent())); + Assert.assertEquals(template, actualRequest.getTemplate()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createWorkflowTemplateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWorkflowTemplateService.addException(exception); + + try { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + + client.createWorkflowTemplate(parent, template); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getWorkflowTemplateTest() { + String id = "id3355"; + WorkflowTemplateName name2 = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + int version = 351608024; + WorkflowTemplate expectedResponse = + WorkflowTemplate.newBuilder() + .setId(id) + .setName(name2.toString()) + .setVersion(version) + .build(); + mockWorkflowTemplateService.addResponse(expectedResponse); + + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + + WorkflowTemplate actualResponse = client.getWorkflowTemplate(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflowTemplateService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkflowTemplateRequest actualRequest = (GetWorkflowTemplateRequest) actualRequests.get(0); + + Assert.assertEquals(name, WorkflowTemplateName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getWorkflowTemplateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWorkflowTemplateService.addException(exception); + + try { + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + + client.getWorkflowTemplate(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void updateWorkflowTemplateTest() { diff --git a/synth.metadata b/synth.metadata index b36a8e5e..5e000f12 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-dataproc.git", - "sha": "40512012e88ccb7533ef3430d66aab8a64f40845" + "sha": "f246195ad7aa0fd04694256f885c09b22c10289b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91b7e0e581f4a74852ac1af7cfa693c88aa2bef3", - "internalRef": "315988875" + "sha": "ec05fa81a492c84fbe5b85341738ced42604ce68", + "internalRef": "320442976" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91b7e0e581f4a74852ac1af7cfa693c88aa2bef3", - "internalRef": "315988875" + "sha": "ec05fa81a492c84fbe5b85341738ced42604ce68", + "internalRef": "320442976" } }, {