Class JobServiceClient (2.29.0)

This is an experimental RPC service definition for the BigQuery Job Service.

It should not be relied on for production use cases at this time.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

JobServiceClient(JobServiceClient const &)

Copy and move support

Parameter
Name Description
JobServiceClient const &

JobServiceClient(JobServiceClient &&)

Copy and move support

Parameter
Name Description
JobServiceClient &&

JobServiceClient(std::shared_ptr< JobServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< JobServiceConnection >
opts Options

Operators

operator=(JobServiceClient const &)

Copy and move support

Parameter
Name Description
JobServiceClient const &
Returns
Type Description
JobServiceClient &

operator=(JobServiceClient &&)

Copy and move support

Parameter
Name Description
JobServiceClient &&
Returns
Type Description
JobServiceClient &

Functions

CancelJob(google::cloud::bigquery::v2::CancelJobRequest const &, Options)

Requests that a job be cancelled.

This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.

Parameters
Name Description
request google::cloud::bigquery::v2::CancelJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.CancelJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::v2::JobCancelResponse >

the result of the RPC. The response message type (google.cloud.bigquery.v2.JobCancelResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetJob(google::cloud::bigquery::v2::GetJobRequest const &, Options)

Returns information about a specific job.

Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.

Parameters
Name Description
request google::cloud::bigquery::v2::GetJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.GetJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::v2::Job >

the result of the RPC. The response message type (google.cloud.bigquery.v2.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

InsertJob(google::cloud::bigquery::v2::InsertJobRequest const &, Options)

Starts a new asynchronous job.

This API has two different kinds of endpoint URIs, as this method supports a variety of use cases.

  • The Metadata URI is used for most interactions, as it accepts the job configuration directly.
  • The Upload URI is ONLY for the case when you're sending both a load job configuration and a data stream together. In this case, the Upload URI accepts the job configuration and the data as two distinct multipart MIME parts.
Parameters
Name Description
request google::cloud::bigquery::v2::InsertJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.InsertJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::v2::Job >

the result of the RPC. The response message type (google.cloud.bigquery.v2.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteJob(google::cloud::bigquery::v2::DeleteJobRequest const &, Options)

Requests the deletion of the metadata of a job.

This call returns when the job's metadata is deleted.

Parameters
Name Description
request google::cloud::bigquery::v2::DeleteJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.DeleteJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

ListJobs(google::cloud::bigquery::v2::ListJobsRequest, Options)

Lists all jobs that you started in the specified project.

Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.

Parameters
Name Description
request google::cloud::bigquery::v2::ListJobsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.ListJobsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::bigquery::v2::ListFormatJob >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.bigquery.v2.ListFormatJob, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetQueryResults(google::cloud::bigquery::v2::GetQueryResultsRequest const &, Options)

RPC to get the results of a query job.

Parameters
Name Description
request google::cloud::bigquery::v2::GetQueryResultsRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.GetQueryResultsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::v2::GetQueryResultsResponse >

the result of the RPC. The response message type (google.cloud.bigquery.v2.GetQueryResultsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

Query(google::cloud::bigquery::v2::PostQueryRequest const &, Options)

Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.

Parameters
Name Description
request google::cloud::bigquery::v2::PostQueryRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.PostQueryRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::v2::QueryResponse >

the result of the RPC. The response message type (google.cloud.bigquery.v2.QueryResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.