The retry, backoff, and idempotency policies are packaged inOptionsasshared_ptrs, instead of passed by value as variadic parameters toTable(..., Policies&&).
Also note that the retry and backoff policy types have changed. If you defined your own policy, extendingRPCRetryPolicyorRPCBackoffPolicy, it will not be compatible with the new types. The new policies do not have aSetup(grpc::ClientContext&)function. This function has not been included because we believe that setting up thegrpc::ClientContext...
Should not be tied to the retry policies.
Is unlikely to be needed by external customers.
If you do need aSetup()feature, pleaseopen a feature requestexplaining your use case, and we will be happy to accommodate you.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document provides instructions on migrating code from using \u003ccode\u003eDataClient\u003c/code\u003e to \u003ccode\u003eDataConnection\u003c/code\u003e in the context of Google Cloud Bigtable.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataConnection\u003c/code\u003e is not tied to specific resource IDs; instead, resources are packaged as \u003ccode\u003eTableResource\u003c/code\u003e objects and passed to \u003ccode\u003eTable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eConfiguration, including settings such as application profile ID and custom retry policies, is managed through the \u003ccode\u003eOptions\u003c/code\u003e parameter when constructing a \u003ccode\u003eTable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRetry, backoff, and idempotency policies are now managed as \u003ccode\u003eshared_ptr\u003c/code\u003es within \u003ccode\u003eOptions\u003c/code\u003e, and custom policies previously extending \u003ccode\u003eRPCRetryPolicy\u003c/code\u003e or \u003ccode\u003eRPCBackoffPolicy\u003c/code\u003e may not be compatible without changes.\u003c/p\u003e\n"],["\u003cp\u003eThe page lists various versions of the library, with the latest version being 2.37.0-rc, each with a link to documentation on migrating from DataClient.\u003c/p\u003e\n"]]],[],null,["Version 2.22.1keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/bigtable/latest/migrating-from-dataclient)\n- [2.41.0](/cpp/docs/reference/bigtable/2.41.0/migrating-from-dataclient)\n- [2.40.0](/cpp/docs/reference/bigtable/2.40.0/migrating-from-dataclient)\n- [2.39.0](/cpp/docs/reference/bigtable/2.39.0/migrating-from-dataclient)\n- [2.38.0](/cpp/docs/reference/bigtable/2.38.0/migrating-from-dataclient)\n- [2.37.0](/cpp/docs/reference/bigtable/2.37.0/migrating-from-dataclient)\n- [2.36.0](/cpp/docs/reference/bigtable/2.36.0/migrating-from-dataclient)\n- [2.35.0](/cpp/docs/reference/bigtable/2.35.0/migrating-from-dataclient)\n- [2.34.0](/cpp/docs/reference/bigtable/2.34.0/migrating-from-dataclient)\n- [2.33.0](/cpp/docs/reference/bigtable/2.33.0/migrating-from-dataclient)\n- [2.32.0](/cpp/docs/reference/bigtable/2.32.0/migrating-from-dataclient)\n- [2.31.0](/cpp/docs/reference/bigtable/2.31.0/migrating-from-dataclient)\n- [2.30.0](/cpp/docs/reference/bigtable/2.30.0/migrating-from-dataclient)\n- [2.29.0](/cpp/docs/reference/bigtable/2.29.0/migrating-from-dataclient)\n- [2.28.0](/cpp/docs/reference/bigtable/2.28.0/migrating-from-dataclient)\n- [2.27.0](/cpp/docs/reference/bigtable/2.27.0/migrating-from-dataclient)\n- [2.26.0](/cpp/docs/reference/bigtable/2.26.0/migrating-from-dataclient)\n- [2.25.1](/cpp/docs/reference/bigtable/2.25.1/migrating-from-dataclient)\n- [2.24.0](/cpp/docs/reference/bigtable/2.24.0/migrating-from-dataclient)\n- [2.23.0](/cpp/docs/reference/bigtable/2.23.0/migrating-from-dataclient)\n- [2.22.1](/cpp/docs/reference/bigtable/2.22.1/migrating-from-dataclient)\n- [2.21.0](/cpp/docs/reference/bigtable/2.21.0/migrating-from-dataclient)\n- [2.20.0](/cpp/docs/reference/bigtable/2.20.0/migrating-from-dataclient)\n- [2.19.0](/cpp/docs/reference/bigtable/2.19.0/migrating-from-dataclient)\n- [2.18.0](/cpp/docs/reference/bigtable/2.18.0/migrating-from-dataclient)\n- [2.17.0](/cpp/docs/reference/bigtable/2.17.0/migrating-from-dataclient)\n- [2.16.0](/cpp/docs/reference/bigtable/2.16.0/migrating-from-dataclient)\n- [2.15.1](/cpp/docs/reference/bigtable/2.15.1/migrating-from-dataclient)\n- [2.14.0](/cpp/docs/reference/bigtable/2.14.0/migrating-from-dataclient)\n- [2.13.0](/cpp/docs/reference/bigtable/2.13.0/migrating-from-dataclient)\n- [2.12.0](/cpp/docs/reference/bigtable/2.12.0/migrating-from-dataclient)\n- [2.11.0](/cpp/docs/reference/bigtable/2.11.0/migrating-from-dataclient) \n\nMigrating from DataClient to DataConnection\n===========================================\n\nIn this document we describe how to migrate existing code that uses `DataClient` to use `DataConnection`.\n\nAll examples use the following aliases: \n\n namespace gc = ::google::cloud;\n namespace cbt = ::google::cloud::bigtable;\n\n### Simple case\n\n cbt::Table OldCode() {\n auto data_client = cbt::MakeDataClient(\"project-id\", \"instance-id\");\n return cbt::Table(data_client, \"table-id\");\n }\n\n cbt::Table UpdatedCode() {\n auto connection = cbt::MakeDataConnection();\n return cbt::Table(\n connection, cbt::TableResource(\"project-id\", \"instance-id\", \"table-id\"));\n }\n\nNote that the `DataConnection` is not associated with any resource ids. They are instead packaged as a `TableResource` and passed as a single object to `Table`.\n\n### Optional configuration\n\nNote that there is only one `Table` constructor that accepts a `DataConnection`. All configuration is done via the `Options` parameter.\n\n#### Set an application profile id\n\n cbt::Table OldCode() {\n auto data_client = cbt::MakeDataClient(\"project-id\", \"instance-id\");\n return cbt::Table(data_client, \"app-profile-id\", \"table-id\");\n }\n\n cbt::Table UpdatedCode() {\n auto connection = cbt::MakeDataConnection();\n return cbt::Table(\n connection, cbt::TableResource(\"project-id\", \"instance-id\", \"table-id\"),\n gc::Options{}.set\u003ccbt::AppProfileIdOption\u003e(\"app-profile-id\"));\n }\n\n#### Set a custom retry policy\n\n cbt::Table OldCode() {\n auto data_client = cbt::MakeDataClient(\"project-id\", \"instance-id\");\n return cbt::Table(data_client, \"table-id\",\n cbt::LimitedErrorCountRetryPolicy(7));\n }\n\n cbt::Table UpdatedCode() {\n auto connection = cbt::MakeDataConnection();\n return cbt::Table(connection,\n cbt::TableResource(\"project-id\", \"instance-id\", \"table-id\"),\n gc::Options{}.set\u003ccbt::DataRetryPolicyOption\u003e(\n cbt::DataLimitedErrorCountRetryPolicy(7).clone()));\n }\n\nThe retry, backoff, and idempotency policies are packaged in `Options` as `shared_ptr`s, instead of passed by value as variadic parameters to `Table(..., Policies&&)`.\n\nAlso note that the retry and backoff policy types have changed. If you defined your own policy, extending `RPCRetryPolicy` or `RPCBackoffPolicy`, it will not be compatible with the new types. The new policies do not have a `Setup(grpc::ClientContext&)` function. This function has not been included because we believe that setting up the `grpc::ClientContext`...\n\n1. Should not be tied to the retry policies.\n2. Is unlikely to be needed by external customers.\n\nIf you do need a `Setup()` feature, please [open a feature request](https://github.com/googleapis/google-cloud-cpp/issues/new/choose) explaining your use case, and we will be happy to accommodate you."]]