Google Cloud BigQuery C++ Client 2.13.0
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
Override bigquery_reservation_v1::ReservationServiceClient Retry Policies

This shows how to override the retry policies for bigquery_reservation_v1::ReservationServiceClient:

auto options =
.set<google::cloud::bigquery_reservation_v1::
ReservationServiceConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
ReservationServiceRetryPolicyOption>(
ReservationServiceLimitedErrorCountRetryPolicy(3)
.clone())
ReservationServiceBackoffPolicyOption>(
/*initial_delay=*/std::chrono::milliseconds(200),
/*maximum_delay=*/std::chrono::seconds(45),
/*scaling=*/2.0)
.clone());
auto connection =
options);
// c1 and c2 share the same retry policies
connection);
connection);
// You can override any of the policies in a new client. This new client
// will share the policies from c1 (or c2) *except* from the retry policy.
connection, google::cloud::Options{}
.set<google::cloud::bigquery_reservation_v1::
ReservationServiceRetryPolicyOption>(
std::chrono::minutes(5))
.clone()));
// You can also override the policies in a single call:
// c3.SomeRpc(..., google::cloud::Options{}
// .set<google::cloud::bigquery_reservation_v1::ReservationServiceRetryPolicyOption>(
// google::cloud::bigquery_reservation_v1::ReservationServiceLimitedErrorCountRetryPolicy(10).clone()));
Options & set(ValueTypeT< T > v)
This API allows users to manage their BigQuery reservations.
Definition: reservation_client.h:75
Definition: reservation_client.h:32
::google::cloud::internal::LimitedTimeRetryPolicy< bigquery_reservation_v1_internal::ReservationServiceRetryTraits > ReservationServiceLimitedTimeRetryPolicy
Definition: reservation_connection.h:43
std::shared_ptr< ReservationServiceConnection > MakeReservationServiceConnection(Options options={})
A factory function to construct an object of type ReservationServiceConnection.
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy

Assuming you have created a custom idempotency policy. Such as:

class CustomIdempotencyPolicy
ReservationServiceConnectionIdempotencyPolicy {
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<google::cloud::bigquery_reservation_v1::
ReservationServiceConnectionIdempotencyPolicy>
clone() const override {
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
// Override inherited functions to define as needed.
};