# Class JobControllerClient (4.90.0)

4.90.0 (latest) 4.88.0 4.85.0 4.84.0 4.82.0 4.80.0 4.79.0 4.78.0 4.77.0 4.75.0 4.73.0 4.72.0 4.71.0 4.70.0 4.69.0 4.67.0 4.65.0 4.64.0 4.61.0 4.60.0 4.59.0 4.57.0 4.56.0 4.55.0 4.54.0 4.53.0 4.52.0 4.51.0 4.50.0 4.49.0 4.48.0 4.46.0 4.45.0 4.44.0 4.43.0 4.42.0 4.41.0 4.40.0 4.39.0 4.38.0 4.37.0 4.36.0 4.34.0 4.33.0 4.32.0 4.31.0 4.30.0 4.29.0 4.28.0 4.27.0 4.26.0 4.25.0 4.24.0 4.21.0 4.20.0 4.19.0 4.18.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.8 3.1.2 3.0.3 2.3.1

|---|---|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java) | [Product Reference](https://cloud.google.com/dataproc) | [REST Documentation](https://cloud.google.com/dataproc/docs/reference/rest) | [RPC Documentation](https://cloud.google.com/dataproc/docs/reference/rpc) |

Service Description: The JobController provides methods to manage jobs.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       Job job = Job.newBuilder().build();
       Job response = jobControllerClient.submitJob(projectId, region, job);
     }
     
Note: close() needs to be called on the JobControllerClient object to clean up resources such
as threads. In the example above, try-with-resources is used, which automatically calls close().

| Method | Description | Method Variants |
|---|---|---|
| SubmitJob | Submits a job to a cluster. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - submitJob(SubmitJobRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - submitJob(String projectId, String region, Job job) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - submitJobCallable() |
| SubmitJobAsOperation | Submits job to a cluster. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - submitJobAsOperationAsync(SubmitJobRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - submitJobAsOperationAsync(String projectId, String region, Job job) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - submitJobAsOperationOperationCallable() - submitJobAsOperationCallable() |
| GetJob | Gets the resource representation for a job in a project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getJob(GetJobRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getJob(String projectId, String region, String jobId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getJobCallable() |
| ListJobs | Lists regions/{region}/jobs in a project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listJobs(ListJobsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listJobs(String projectId, String region) - listJobs(String projectId, String region, String filter) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listJobsPagedCallable() - listJobsCallable() |
| UpdateJob | Updates a job in a project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateJob(UpdateJobRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateJobCallable() |
| CancelJob | Starts a job cancellation request. To access the job resource after cancellation, call [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). | Request object method variants only take one parameter, a request object, which must be constructed before the call. - cancelJob(CancelJobRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - cancelJob(String projectId, String region, String jobId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - cancelJobCallable() |
| DeleteJob | Deletes the job from the project. If the job is active, the delete fails, and the response returns `FAILED_PRECONDITION`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteJob(DeleteJobRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteJob(String projectId, String region, String jobId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteJobCallable() |
| SetIamPolicy | Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - setIamPolicy(SetIamPolicyRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - setIamPolicyCallable() |
| GetIamPolicy | Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getIamPolicy(GetIamPolicyRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getIamPolicyCallable() |
| TestIamPermissions | Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - testIamPermissions(TestIamPermissionsRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - testIamPermissionsCallable() |
[Methods]

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with
these names, this class includes a format method for each type of name, and additionally a parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of JobControllerSettings to
create(). For example:

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     JobControllerSettings jobControllerSettings =
         JobControllerSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings);
     
To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     JobControllerSettings jobControllerSettings =
         JobControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
     JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     JobControllerSettings jobControllerSettings =
         JobControllerSettings.newHttpJsonBuilder().build();
     JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> JobControllerClient

## Static Methods

### create()

    public static final JobControllerClient create()

Constructs an instance of JobControllerClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(JobControllerSettings settings)

    public static final JobControllerClient create(JobControllerSettings settings)

Constructs an instance of JobControllerClient, using the given settings. The channels are
created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(JobControllerStub stub)

    public static final JobControllerClient create(JobControllerStub stub)

Constructs an instance of JobControllerClient, using the given stub for making calls. This is
for advanced usage - prefer using create(JobControllerSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.stub.JobControllerStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerClient` |   |

## Constructors

### JobControllerClient(JobControllerSettings settings)

    protected JobControllerClient(JobControllerSettings settings)

Constructs an instance of JobControllerClient, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerSettings` |

### JobControllerClient(JobControllerStub stub)

    protected JobControllerClient(JobControllerStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.stub.JobControllerStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### cancelJob(CancelJobRequest request)

    public final Job cancelJob(CancelJobRequest request)

Starts a job cancellation request. To access the job resource after cancellation, call
[regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list)
or
[regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       CancelJobRequest request =
           CancelJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .build();
       Job response = jobControllerClient.cancelJob(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.CancelJobRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` |   |

### cancelJob(String projectId, String region, String jobId)

    public final Job cancelJob(String projectId, String region, String jobId)

Starts a job cancellation request. To access the job resource after cancellation, call
[regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list)
or
[regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       String jobId = "jobId101296568";
       Job response = jobControllerClient.cancelJob(projectId, region, jobId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the Google Cloud Platform project that the job belongs to. |
| `region` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Dataproc region in which to handle the request. |
| `jobId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The job ID. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` |   |

### cancelJobCallable()

    public final UnaryCallable<CancelJobRequest,Job> cancelJobCallable()

Starts a job cancellation request. To access the job resource after cancellation, call
[regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list)
or
[regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       CancelJobRequest request =
           CancelJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .build();
       ApiFuture<Job> future = jobControllerClient.cancelJobCallable().futureCall(request);
       // Do something.
       Job response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.CancelJobRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job>` |   |

### close()

    public final void close()

### deleteJob(DeleteJobRequest request)

    public final void deleteJob(DeleteJobRequest request)

Deletes the job from the project. If the job is active, the delete fails, and the response
returns `FAILED_PRECONDITION`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       DeleteJobRequest request =
           DeleteJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .build();
       jobControllerClient.deleteJob(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.DeleteJobRequest` The request object containing all of the parameters for the API call. |

### deleteJob(String projectId, String region, String jobId)

    public final void deleteJob(String projectId, String region, String jobId)

Deletes the job from the project. If the job is active, the delete fails, and the response
returns `FAILED_PRECONDITION`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       String jobId = "jobId101296568";
       jobControllerClient.deleteJob(projectId, region, jobId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the Google Cloud Platform project that the job belongs to. |
| `region` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Dataproc region in which to handle the request. |
| `jobId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The job ID. |

### deleteJobCallable()

    public final UnaryCallable<DeleteJobRequest,Empty> deleteJobCallable()

Deletes the job from the project. If the job is active, the delete fails, and the response
returns `FAILED_PRECONDITION`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       DeleteJobRequest request =
           DeleteJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .build();
       ApiFuture<Empty> future = jobControllerClient.deleteJobCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.DeleteJobRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getIamPolicy(GetIamPolicyRequest request)

    public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists
and does not have a policy set.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(
                   AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                           "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                       .toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       Policy response = jobControllerClient.getIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.GetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicyCallable()

    public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists
and does not have a policy set.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(
                   AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                           "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                       .toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       ApiFuture<Policy> future = jobControllerClient.getIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### getJob(GetJobRequest request)

    public final Job getJob(GetJobRequest request)

Gets the resource representation for a job in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       GetJobRequest request =
           GetJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .build();
       Job response = jobControllerClient.getJob(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.GetJobRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` |   |

### getJob(String projectId, String region, String jobId)

    public final Job getJob(String projectId, String region, String jobId)

Gets the resource representation for a job in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       String jobId = "jobId101296568";
       Job response = jobControllerClient.getJob(projectId, region, jobId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the Google Cloud Platform project that the job belongs to. |
| `region` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Dataproc region in which to handle the request. |
| `jobId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The job ID. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` |   |

### getJobCallable()

    public final UnaryCallable<GetJobRequest,Job> getJobCallable()

Gets the resource representation for a job in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       GetJobRequest request =
           GetJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .build();
       ApiFuture<Job> future = jobControllerClient.getJobCallable().futureCall(request);
       // Do something.
       Job response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.GetJobRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job>` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getSettings()

    public final JobControllerSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerSettings` |   |

### getStub()

    public JobControllerStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.stub.JobControllerStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listJobs(ListJobsRequest request)

    public final JobControllerClient.ListJobsPagedResponse listJobs(ListJobsRequest request)

Lists regions/{region}/jobs in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       ListJobsRequest request =
           ListJobsRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setClusterName("clusterName-1141738587")
               .setFilter("filter-1274492040")
               .build();
       for (Job element : jobControllerClient.listJobs(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.ListJobsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerClient.ListJobsPagedResponse` |   |

### listJobs(String projectId, String region)

    public final JobControllerClient.ListJobsPagedResponse listJobs(String projectId, String region)

Lists regions/{region}/jobs in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       for (Job element : jobControllerClient.listJobs(projectId, region).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the Google Cloud Platform project that the job belongs to. |
| `region` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Dataproc region in which to handle the request. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerClient.ListJobsPagedResponse` |   |

### listJobs(String projectId, String region, String filter)

    public final JobControllerClient.ListJobsPagedResponse listJobs(String projectId, String region, String filter)

Lists regions/{region}/jobs in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       String filter = "filter-1274492040";
       for (Job element : jobControllerClient.listJobs(projectId, region, filter).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the Google Cloud Platform project that the job belongs to. |
| `region` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Dataproc region in which to handle the request. |
| `filter` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax: \[field = value\] AND \[field \[= value\]\] ... where \*\*field\*\* is `status.state` or `insertTime`, or `labels.[KEY]`, and `[KEY]` is a label key. \*\*value\*\* can be `*` to match all values. `status.state` can be either `ACTIVE` or `NON_ACTIVE`. Allows `insertTime` to be a timestamp in RFC 3339 format in double quotes, such as `2025-01-01T00:00:00Z`. Only the logical `AND` operator is supported; space-separated items are treated as having an implicit `AND` operator. Example filter: status.state = ACTIVE AND labels.env = staging AND labels.starred = \* AND insertTime \<= "2025-01-01T00:00:00Z" |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerClient.ListJobsPagedResponse` |   |

### listJobsCallable()

    public final UnaryCallable<ListJobsRequest,ListJobsResponse> listJobsCallable()

Lists regions/{region}/jobs in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       ListJobsRequest request =
           ListJobsRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setClusterName("clusterName-1141738587")
               .setFilter("filter-1274492040")
               .build();
       while (true) {
         ListJobsResponse response = jobControllerClient.listJobsCallable().call(request);
         for (Job element : response.getJobsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.ListJobsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.ListJobsResponse>` |   |

### listJobsPagedCallable()

    public final UnaryCallable<ListJobsRequest,JobControllerClient.ListJobsPagedResponse> listJobsPagedCallable()

Lists regions/{region}/jobs in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       ListJobsRequest request =
           ListJobsRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setClusterName("clusterName-1141738587")
               .setFilter("filter-1274492040")
               .build();
       ApiFuture<Job> future = jobControllerClient.listJobsPagedCallable().futureCall(request);
       // Do something.
       for (Job element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.ListJobsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobControllerClient.ListJobsPagedResponse>` |   |

### setIamPolicy(SetIamPolicyRequest request)

    public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(
                   AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                           "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                       .toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Policy response = jobControllerClient.setIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.SetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicyCallable()

    public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(
                   AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                           "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                       .toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Policy> future = jobControllerClient.setIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### submitJob(SubmitJobRequest request)

    public final Job submitJob(SubmitJobRequest request)

Submits a job to a cluster.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       SubmitJobRequest request =
           SubmitJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJob(Job.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       Job response = jobControllerClient.submitJob(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.SubmitJobRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` |   |

### submitJob(String projectId, String region, Job job)

    public final Job submitJob(String projectId, String region, Job job)

Submits a job to a cluster.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       Job job = Job.newBuilder().build();
       Job response = jobControllerClient.submitJob(projectId, region, job);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the Google Cloud Platform project that the job belongs to. |
| `region` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Dataproc region in which to handle the request. |
| `job` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` Required. The job resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` |   |

### submitJobAsOperationAsync(SubmitJobRequest request)

    public final OperationFuture<Job,JobMetadata> submitJobAsOperationAsync(SubmitJobRequest request)

Submits job to a cluster.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       SubmitJobRequest request =
           SubmitJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJob(Job.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       Job response = jobControllerClient.submitJobAsOperationAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.SubmitJobRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobMetadata>` |   |

### submitJobAsOperationAsync(String projectId, String region, Job job)

    public final OperationFuture<Job,JobMetadata> submitJobAsOperationAsync(String projectId, String region, Job job)

Submits job to a cluster.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       String projectId = "projectId-894832108";
       String region = "region-934795532";
       Job job = Job.newBuilder().build();
       Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID of the Google Cloud Platform project that the job belongs to. |
| `region` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Dataproc region in which to handle the request. |
| `job` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` Required. The job resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobMetadata>` |   |

### submitJobAsOperationCallable()

    public final UnaryCallable<SubmitJobRequest,Operation> submitJobAsOperationCallable()

Submits job to a cluster.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       SubmitJobRequest request =
           SubmitJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJob(Job.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       ApiFuture<Operation> future =
           jobControllerClient.submitJobAsOperationCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.SubmitJobRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### submitJobAsOperationOperationCallable()

    public final OperationCallable<SubmitJobRequest,Job,JobMetadata> submitJobAsOperationOperationCallable()

Submits job to a cluster.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       SubmitJobRequest request =
           SubmitJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJob(Job.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       OperationFuture<Job, JobMetadata> future =
           jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
       // Do something.
       Job response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.SubmitJobRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.JobMetadata>` |   |

### submitJobCallable()

    public final UnaryCallable<SubmitJobRequest,Job> submitJobCallable()

Submits a job to a cluster.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       SubmitJobRequest request =
           SubmitJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJob(Job.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       ApiFuture<Job> future = jobControllerClient.submitJobCallable().futureCall(request);
       // Do something.
       Job response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.SubmitJobRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job>` |   |

### testIamPermissions(TestIamPermissionsRequest request)

    public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and
command-line tools, not for authorizationchecking. This operation may "fail open" without
warning.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(
                   AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                           "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                       .toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       TestIamPermissionsResponse response = jobControllerClient.testIamPermissions(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.TestIamPermissionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissionsCallable()

    public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and
command-line tools, not for authorizationchecking. This operation may "fail open" without
warning.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(
                   AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                           "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                       .toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       ApiFuture<TestIamPermissionsResponse> future =
           jobControllerClient.testIamPermissionsCallable().futureCall(request);
       // Do something.
       TestIamPermissionsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>` |   |

### updateJob(UpdateJobRequest request)

    public final Job updateJob(UpdateJobRequest request)

Updates a job in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       UpdateJobRequest request =
           UpdateJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .setJob(Job.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Job response = jobControllerClient.updateJob(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.UpdateJobRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job` |   |

### updateJobCallable()

    public final UnaryCallable<UpdateJobRequest,Job> updateJobCallable()

Updates a job in a project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
       UpdateJobRequest request =
           UpdateJobRequest.newBuilder()
               .setProjectId("projectId-894832108")
               .setRegion("region-934795532")
               .setJobId("jobId101296568")
               .setJob(Job.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Job> future = jobControllerClient.updateJobCallable().futureCall(request);
       // Do something.
       Job response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.UpdateJobRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-dataproc/latest/com.google.cloud.dataproc.v1.Job>` |   |