Skip to content
Permalink
Browse files
feat(v1): add Jobs.SubmitJobAsOperation, SparkR and Presto job types …
…to WorkflowTemplates (#137)

* fix Dataproc: add missing `REQUIRED` annotation.

googleapis/googleapis@7504771
commit 75047719f704d61f405cac6d7439637ab36c1232
Author: Google APIs <noreply@google.com>
Date:   Wed Apr 1 18:40:05 2020 -0700

    fix Dataproc: add missing `REQUIRED` annotation.

    PiperOrigin-RevId: 304305096

* Add v1beta2 SubmitJobAsOperation RPC to Dataproc.

googleapis/googleapis@5378173
commit 5378173a889f9c7d83e36e52d38a6267190de692
Author: Google APIs <noreply@google.com>
Date:   Fri Apr 3 05:15:57 2020 -0700

    Add v1beta2 SubmitJobAsOperation RPC to Dataproc.

    PiperOrigin-RevId: 304594381

* Updates to Dataproc v1beta2 API: - Adds SparkR and Presto job types to WorkflowTemplates - Adds new Optional Components - Clarifies usage of some APIs

googleapis/googleapis@cad0f51
commit cad0f5137a70d0d14a8d9acbfcee98e4cd3e9662
Author: Google APIs <noreply@google.com>
Date:   Mon Apr 6 09:55:41 2020 -0700

    Updates to Dataproc v1beta2 API:
    - Adds SparkR and Presto job types to WorkflowTemplates
    - Adds new Optional Components
    - Clarifies usage of some APIs

    PiperOrigin-RevId: 305053062

* Updates Dataproc v1 API: - Adds Dataproc Jobs.SubmitJobAsOperation RPC - Adds SparkR and Presto job types to WorkflowTemplates - Adds new Optional Components - Clarifies usage of some APIs

googleapis/googleapis@9ff6fd3
commit 9ff6fd3b22f99167827e89aae7778408b5e82425
Author: Google APIs <noreply@google.com>
Date:   Mon Apr 6 09:57:56 2020 -0700

    Updates Dataproc v1 API:
    - Adds Dataproc Jobs.SubmitJobAsOperation RPC
    - Adds SparkR and Presto job types to WorkflowTemplates
    - Adds new Optional Components
    - Clarifies usage of some APIs

    PiperOrigin-RevId: 305053617

* docs: change relative URLs to absolute URLs to fix broken links.

googleapis/googleapis@7445911
commit 744591190e828440f72745aef217f883afd1fd71
Author: Google APIs <noreply@google.com>
Date:   Tue Apr 7 13:06:04 2020 -0700

    docs: change relative URLs to absolute URLs to fix broken links.

    PiperOrigin-RevId: 305323909

* chore: allow proto interface changes

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
yoshi-automation and chingor13 committed Apr 9, 2020
1 parent 043ab3a commit ac18c872f270d1a3248797ceceaf0923375bfc2f
Showing with 14,403 additions and 1,913 deletions.
  1. +1 −1 google-cloud-dataproc-bom/pom.xml
  2. +7 −3 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java
  3. +5 −5 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
  4. +130 −0 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java
  5. +28 −0 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java
  6. +47 −0 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java
  7. +20 −0 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java
  8. +80 −2 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java
  9. +5 −5 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java
  10. +130 −0 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerClient.java
  11. +28 −0 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerSettings.java
  12. +47 −0 ...le-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcJobControllerStub.java
  13. +20 −0 google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStub.java
  14. +80 −2 ...loud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java
  15. +74 −0 google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java
  16. +16 −0 google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobControllerImpl.java
  17. +76 −0 google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/JobControllerClientTest.java
  18. +16 −0 google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/MockJobControllerImpl.java
  19. +0 −10 grpc-google-cloud-dataproc-v1/clirr-ignored-differences.xml
  20. +4 −4 grpc-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerGrpc.java
  21. +117 −5 grpc-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobControllerGrpc.java
  22. +0 −10 grpc-google-cloud-dataproc-v1beta2/clirr-ignored-differences.xml
  23. +4 −4 ...cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerGrpc.java
  24. +118 −5 ...gle-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/JobControllerGrpc.java
  25. +4 −8 ...dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceGrpc.java
  26. +0 −5 proto-google-cloud-dataproc-v1/clirr-ignored-differences.xml
  27. +18 −16 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AcceleratorConfig.java
  28. +4 −4 ...ogle-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AcceleratorConfigOrBuilder.java
  29. +58 −58 ...google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java
  30. +48 −24 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Cluster.java
  31. +7 −7 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterConfig.java
  32. +2 −2 ...o-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterConfigOrBuilder.java
  33. +12 −6 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOrBuilder.java
  34. +180 −180 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClustersProto.java
  35. +44 −0 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Component.java
  36. +48 −24 ...-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateAutoscalingPolicyRequest.java
  37. +12 −6 ...taproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateAutoscalingPolicyRequestOrBuilder.java
  38. +61 −54 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfig.java
  39. +18 −16 ...oogle-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfigOrBuilder.java
  40. +113 −50 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupConfig.java
  41. +32 −14 ...le-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupConfigOrBuilder.java
  42. +100 −0 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Job.java
  43. +1,381 −0 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobMetadata.java
  44. +154 −0 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobMetadataOrBuilder.java
  45. +16 −0 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobOrBuilder.java
  46. +93 −68 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobsProto.java
  47. +8 −4 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KerberosConfig.java
  48. +2 −1 ...-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KerberosConfigOrBuilder.java
  49. +598 −0 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJob.java
  50. +70 −0 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJobOrBuilder.java
  51. +8 −2 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJob.java
  52. +6 −5 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SharedProto.java
  53. +36 −36 proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfig.java
  54. +14 −14 ...-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfigOrBuilder.java
  55. +140 −135 ...o-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplatesProto.java
  56. +17 −32 proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto
  57. +44 −26 proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/clusters.proto
  58. +38 −1 proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/jobs.proto
  59. +6 −0 proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/shared.proto
  60. +6 −0 proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/workflow_templates.proto
  61. +13 −3 proto-google-cloud-dataproc-v1beta2/clirr-ignored-differences.xml
  62. +18 −16 ...gle-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/AcceleratorConfig.java
  63. +4 −4 ...-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/AcceleratorConfigOrBuilder.java
  64. +345 −7 ...-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterConfig.java
  65. +52 −2 ...loud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterConfigOrBuilder.java
  66. +66 −0 ...-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterStatus.java
  67. +229 −191 ...-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/ClustersProto.java
  68. +88 −0 proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/Component.java
  69. +61 −54 ...ogle-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/GceClusterConfig.java
  70. +18 −16 ...d-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/GceClusterConfigOrBuilder.java
  71. +1,701 −0 ...ogle-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/GkeClusterConfig.java
  72. +68 −0 ...d-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/GkeClusterConfigOrBuilder.java
  73. +113 −50 ...e-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/InstanceGroupConfig.java
  74. +32 −14 ...ataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/InstanceGroupConfigOrBuilder.java
  75. +1,299 −91 proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/Job.java
  76. +1,384 −0 proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/JobMetadata.java
  77. +154 −0 ...-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/JobMetadataOrBuilder.java
  78. +260 −21 ...o-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/JobOrBuilder.java
  79. +195 −125 proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/JobsProto.java
  80. +8 −4 ...google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/KerberosConfig.java
  81. +2 −1 ...oud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/KerberosConfigOrBuilder.java
  82. +694 −57 proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/OrderedJob.java
  83. +98 −18 ...e-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/OrderedJobOrBuilder.java
  84. +2,248 −0 proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/PrestoJob.java
  85. +290 −0 ...le-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/PrestoJobOrBuilder.java
  86. +8 −7 proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/SharedProto.java
  87. +36 −36 ...google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/SoftwareConfig.java
  88. +14 −14 ...oud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/SoftwareConfigOrBuilder.java
  89. +52 −52 ...gle-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/TemplateParameter.java
  90. +16 −16 ...-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/TemplateParameterOrBuilder.java
  91. +156 −150 ...loud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplatesProto.java
  92. +14 −28 ...le-cloud-dataproc-v1beta2/src/main/proto/google/cloud/dataproc/v1beta2/autoscaling_policies.proto
  93. +78 −24 proto-google-cloud-dataproc-v1beta2/src/main/proto/google/cloud/dataproc/v1beta2/clusters.proto
  94. +87 −7 proto-google-cloud-dataproc-v1beta2/src/main/proto/google/cloud/dataproc/v1beta2/jobs.proto
  95. +12 −0 proto-google-cloud-dataproc-v1beta2/src/main/proto/google/cloud/dataproc/v1beta2/shared.proto
  96. +34 −47 ...ogle-cloud-dataproc-v1beta2/src/main/proto/google/cloud/dataproc/v1beta2/workflow_templates.proto
  97. +5 −4 synth.metadata
@@ -11,7 +11,7 @@
<version>0.5.0</version>
</parent>

<name>Google Cloud dataproc BOM</name>
<name>Google Cloud Dataproc BOM</name>
<url>https://github.com/googleapis/java-dataproc</url>
<description>
BOM for Google Cloud Dataproc
@@ -251,7 +251,7 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe
* has the following format: `projects/{project_id}/regions/{region}`
* <p>&#42; For `projects.locations.autoscalingPolicies.create`, the resource name of the
* location has the following format: `projects/{project_id}/locations/{location}`
* @param policy The autoscaling policy to create.
* @param policy Required. The autoscaling policy to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AutoscalingPolicy createAutoscalingPolicy(
@@ -284,7 +284,7 @@ public final AutoscalingPolicy createAutoscalingPolicy(
* has the following format: `projects/{project_id}/regions/{region}`
* <p>&#42; For `projects.locations.autoscalingPolicies.create`, the resource name of the
* location has the following format: `projects/{project_id}/locations/{location}`
* @param policy The autoscaling policy to create.
* @param policy Required. The autoscaling policy to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AutoscalingPolicy createAutoscalingPolicy(
@@ -317,7 +317,7 @@ public final AutoscalingPolicy createAutoscalingPolicy(
* has the following format: `projects/{project_id}/regions/{region}`
* <p>&#42; For `projects.locations.autoscalingPolicies.create`, the resource name of the
* location has the following format: `projects/{project_id}/locations/{location}`
* @param policy The autoscaling policy to create.
* @param policy Required. The autoscaling policy to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AutoscalingPolicy createAutoscalingPolicy(String parent, AutoscalingPolicy policy) {
@@ -335,8 +335,10 @@ public final AutoscalingPolicy createAutoscalingPolicy(String parent, Autoscalin
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
* .setParent(parent.toString())
* .setPolicy(policy)
* .build();
* AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(request);
* }
@@ -358,8 +360,10 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
* .setParent(parent.toString())
* .setPolicy(policy)
* .build();
* ApiFuture&lt;AutoscalingPolicy&gt; future = autoscalingPolicyServiceClient.createAutoscalingPolicyCallable().futureCall(request);
* // Do something
@@ -677,7 +677,7 @@ public final UnaryCallable<GetClusterRequest, Cluster> getClusterCallable() {

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all regions/{region}/clusters in a project.
* Lists all regions/{region}/clusters in a project alphabetically.
*
* <p>Sample code:
*
@@ -704,7 +704,7 @@ public final ListClustersPagedResponse listClusters(String projectId, String reg

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all regions/{region}/clusters in a project.
* Lists all regions/{region}/clusters in a project alphabetically.
*
* <p>Sample code:
*
@@ -751,7 +751,7 @@ public final ListClustersPagedResponse listClusters(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all regions/{region}/clusters in a project.
* Lists all regions/{region}/clusters in a project alphabetically.
*
* <p>Sample code:
*
@@ -778,7 +778,7 @@ public final ListClustersPagedResponse listClusters(ListClustersRequest request)

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all regions/{region}/clusters in a project.
* Lists all regions/{region}/clusters in a project alphabetically.
*
* <p>Sample code:
*
@@ -805,7 +805,7 @@ public final ListClustersPagedResponse listClusters(ListClustersRequest request)

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all regions/{region}/clusters in a project.
* Lists all regions/{region}/clusters in a project alphabetically.
*
* <p>Sample code:
*
@@ -20,14 +20,18 @@
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dataproc.v1.stub.JobControllerStub;
import com.google.cloud.dataproc.v1.stub.JobControllerStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
@@ -107,6 +111,7 @@
public class JobControllerClient implements BackgroundResource {
private final JobControllerSettings settings;
private final JobControllerStub stub;
private final OperationsClient operationsClient;

/** Constructs an instance of JobControllerClient with default settings. */
public static final JobControllerClient create() throws IOException {
@@ -139,12 +144,14 @@ public static final JobControllerClient create(JobControllerStub stub) {
protected JobControllerClient(JobControllerSettings settings) throws IOException {
this.settings = settings;
this.stub = ((JobControllerStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected JobControllerClient(JobControllerStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}

public final JobControllerSettings getSettings() {
@@ -156,6 +163,16 @@ public JobControllerStub getStub() {
return stub;
}

/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationsClient getOperationsClient() {
return operationsClient;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Submits a job to a cluster.
@@ -709,6 +726,119 @@ public final UnaryCallable<DeleteJobRequest, Empty> deleteJobCallable() {
return stub.deleteJobCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Submits job to a cluster.
*
* <p>Sample code:
*
* <pre><code>
* try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
* String projectId = "";
* String region = "";
* Job job = Job.newBuilder().build();
* Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
* }
* </code></pre>
*
* @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<Job, JobMetadata> 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.
*
* <p>Sample code:
*
* <pre><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();
* }
* </code></pre>
*
* @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<Job, JobMetadata> submitJobAsOperationAsync(
SubmitJobRequest request) {
return submitJobAsOperationOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Submits job to a cluster.
*
* <p>Sample code:
*
* <pre><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&lt;Job, JobMetadata&gt; future = jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
* // Do something
* Job response = future.get();
* }
* </code></pre>
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<SubmitJobRequest, Job, JobMetadata>
submitJobAsOperationOperationCallable() {
return stub.submitJobAsOperationOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Submits job to a cluster.
*
* <p>Sample code:
*
* <pre><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&lt;Operation&gt; future = jobControllerClient.submitJobAsOperationCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<SubmitJobRequest, Operation> submitJobAsOperationCallable() {
return stub.submitJobAsOperationCallable();
}

@Override
public final void close() {
stub.close();
@@ -25,10 +25,12 @@
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.dataproc.v1.stub.JobControllerStubSettings;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
@@ -99,6 +101,19 @@ public UnaryCallSettings<DeleteJobRequest, Empty> deleteJobSettings() {
return ((JobControllerStubSettings) getStubSettings()).deleteJobSettings();
}

/** Returns the object with the settings used for calls to submitJobAsOperation. */
public UnaryCallSettings<SubmitJobRequest, Operation> 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<SubmitJobRequest, Job, JobMetadata>
submitJobAsOperationOperationSettings() {
return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationOperationSettings();
}

public static final JobControllerSettings create(JobControllerStubSettings stub)
throws IOException {
return new JobControllerSettings.Builder(stub.toBuilder()).build();
@@ -227,6 +242,19 @@ public UnaryCallSettings.Builder<DeleteJobRequest, Empty> deleteJobSettings() {
return getStubSettingsBuilder().deleteJobSettings();
}

/** Returns the builder for the settings used for calls to submitJobAsOperation. */
public UnaryCallSettings.Builder<SubmitJobRequest, Operation> 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<SubmitJobRequest, Job, JobMetadata>
submitJobAsOperationOperationSettings() {
return getStubSettingsBuilder().submitJobAsOperationOperationSettings();
}

@Override
public JobControllerSettings build() throws IOException {
return new JobControllerSettings(this);

0 comments on commit ac18c87

Please sign in to comment.