This shows how to override the retry policies for bigquery_connection_v1::ConnectionServiceClient:
auto options =
.
set<google::cloud::bigquery_connection_v1::
ConnectionServiceConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
ConnectionServiceRetryPolicyOption>(
ConnectionServiceLimitedErrorCountRetryPolicy(3)
.clone())
ConnectionServiceBackoffPolicyOption>(
std::chrono::milliseconds(200),
std::chrono::seconds(45),
2.0)
.clone());
auto connection =
options);
connection);
connection);
.
set<google::cloud::bigquery_connection_v1::
ConnectionServiceRetryPolicyOption>(
std::chrono::minutes(5))
.clone()));
Options & set(ValueTypeT< T > v)
Manages external data source connections and credentials.
Definition: connection_client.h:61
Definition: connection_client.h:32
std::shared_ptr< ConnectionServiceConnection > MakeConnectionServiceConnection(Options options={})
A factory function to construct an object of type ConnectionServiceConnection.
::google::cloud::internal::LimitedTimeRetryPolicy< bigquery_connection_v1_internal::ConnectionServiceRetryTraits > ConnectionServiceLimitedTimeRetryPolicy
Definition: connection_connection.h:43
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Assuming you have created a custom idempotency policy. Such as:
class CustomIdempotencyPolicy
ConnectionServiceConnectionIdempotencyPolicy {
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<google::cloud::bigquery_connection_v1::
ConnectionServiceConnectionIdempotencyPolicy>
clone() const override {
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};