Google Cloud Bigtable C++ Client 2.13.0
A C++ Client Library for Google Cloud Bigtable
Loading...
Searching...
No Matches
Override admin::BigtableTableAdminClient Retry Policies

This shows how to override the retry policies for admin::BigtableTableAdminClient:

auto options =
.set<google::cloud::bigtable_admin::
BigtableTableAdminConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
BigtableTableAdminRetryPolicyOption>(
BigtableTableAdminLimitedErrorCountRetryPolicy(3)
.clone())
BigtableTableAdminBackoffPolicyOption>(
/*initial_delay=*/std::chrono::milliseconds(200),
/*maximum_delay=*/std::chrono::seconds(45),
/*scaling=*/2.0)
.clone());
auto connection =
// c1 and c2 share the same retry policies
// 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::bigtable_admin::
BigtableTableAdminRetryPolicyOption>(
std::chrono::minutes(5))
.clone()));
// You can also override the policies in a single call:
// c3.SomeRpc(..., google::cloud::Options{}
// .set<google::cloud::bigtable_admin::BigtableTableAdminRetryPolicyOption>(
// google::cloud::bigtable_admin::BigtableTableAdminLimitedErrorCountRetryPolicy(10).clone()));
Options & set(ValueTypeT< T > v)
Service for creating, configuring, and deleting Cloud Bigtable tables.
Definition: bigtable_table_admin_client.h:68
Definition: bigtable_instance_admin_client.h:35
std::shared_ptr< BigtableTableAdminConnection > MakeBigtableTableAdminConnection(Options options={})
A factory function to construct an object of type BigtableTableAdminConnection.
::google::cloud::internal::LimitedTimeRetryPolicy< bigtable_admin_internal::BigtableTableAdminRetryTraits > BigtableTableAdminLimitedTimeRetryPolicy
Definition: bigtable_table_admin_connection.h:46
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy

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

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