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 guides users on migrating C++ code from using \u003ccode\u003eDataClient\u003c/code\u003e to the newer \u003ccode\u003eDataConnection\u003c/code\u003e for Google Cloud Bigtable interactions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataConnection\u003c/code\u003e is not tied to resource IDs; instead, resource information is encapsulated in a \u003ccode\u003eTableResource\u003c/code\u003e object, which is passed to the \u003ccode\u003eTable\u003c/code\u003e class constructor.\u003c/p\u003e\n"],["\u003cp\u003eConfiguration options, such as setting an application profile ID or defining a custom retry policy, are now managed through the \u003ccode\u003eOptions\u003c/code\u003e parameter rather than directly in the \u003ccode\u003eTable\u003c/code\u003e constructor.\u003c/p\u003e\n"],["\u003cp\u003eRetry and backoff policies have been redesigned, utilizing \u003ccode\u003eshared_ptr\u003c/code\u003es within \u003ccode\u003eOptions\u003c/code\u003e and introducing new policy types that do not include a \u003ccode\u003eSetup()\u003c/code\u003e function, differing from previous \u003ccode\u003eRPCRetryPolicy\u003c/code\u003e and \u003ccode\u003eRPCBackoffPolicy\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe document provides examples of how to update code from \u003ccode\u003eDataClient\u003c/code\u003e to \u003ccode\u003eDataConnection\u003c/code\u003e, including simple cases, application profile IDs, and custom retry policies.\u003c/p\u003e\n"]]],[],null,["Version 2.27.0keyboard_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."]]