11# ` google-cloud-cpp ` v3 Migration Guide
22
3- This document is intended for users of previous major versions (v1.x.y, v2.x.y)
4- of the ` google-cloud-cpp ` SDK who are moving to a release on the v3.x.y series.
3+ This document helps users of previous major versions (v1.x.y, v2.x.y) of the
4+ ` google-cloud-cpp ` SDK migrate to a release on the v3.x.y series.
55
66While this repository does not strictly follow semver, it does use the major
77version number to indicate large breaking changes. We strive to balance the
88frequency in which we introduce breaking changes with improvements to the SDK.
99Since our most recent major version increment, about 3 years ago, we have added
1010new API surfaces that supersede the previous deprecated types and functions. As
1111part of the v3 release series, we are decommissioning those deprecated API
12- surfaces. This guide serves a central location to document how to migrate from
12+ surfaces. This guide provides a central location to document how to migrate from
1313the decommissioned API surfaces to their replacements.
1414
1515## C++17
@@ -41,10 +41,11 @@ Central Registry. Part of the v3.x.y release series includes supporting the new
4141[ google-cloud-cpp] ( https://registry.bazel.build/modules/google_cloud_cpp ) Bazel
4242module which can be added to your ` MODULE.bazel ` file as a dependency.
4343
44- google-cloud-cpp will support WORKSPACE files until Bazel 8 reaches end of
45- support (2027/12). However, some dependencies may stop supporting WORKSPACE
44+ google-cloud-cpp will support WORKSPACE files until Bazel 8 reaches end of
45+ support (2027/12). However, some dependencies may stop supporting WORKSPACE
4646files before then which will limit what dependency versions can be used via
4747WORKSPACE.
48+
4849</details >
4950
5051### CMake
@@ -53,7 +54,7 @@ WORKSPACE.
5354<summary >Removed backward compatible proto interface libraries.</summary >
5455
5556If your application links directly to one of these decommissioned proto
56- libraries, your CMakeLists.txt should be updated with the preferred proto
57+ libraries, you should update your CMakeLists.txt with the preferred proto
5758library name.
5859
5960| Library | Decommissioned Proto Library | Preferred Proto Library |
@@ -76,7 +77,7 @@ library name.
7677<summary >Removed <code >v1</code > inline namespace alias.
7778</summary >
7879
79- The ` v1 ` namespace should be omitted for libraries that are unversioned:
80+ Omit the ` v1 ` namespace for unversioned libraries :
8081
8182- Bigtable
8283- PubSub
@@ -106,8 +107,8 @@ google::cloud::pubsub::Publisher publisher;
106107<summary >Removed <code >gcpcxxV1</code > inline namespace alias.
107108</summary >
108109
109- The ` gcpcxxV1 ` namespace should be omitted from versioned libraries. The version
110- is now part of the service namespace.
110+ Omit the ` gcpcxxV1 ` namespace from versioned libraries. The version is now part
111+ of the service namespace.
111112
112113For example, code that used to look like this:
113114
@@ -161,9 +162,9 @@ google::cloud::CompletionQueue cq;
161162<summary >Removed unversioned forwarding headers.
162163</summary >
163164
164- Some early libraries were created without version and/or service directories.
165- For backwards compatibility, forwarding headers were left at parent directory
166- that pointed at the first version of the library:
165+ We created some early libraries without version and/or service directories. For
166+ backwards compatibility, forwarding headers were left at parent directory that
167+ pointed at the first version of the library:
167168
168169- google/cloud/accessapproval
169170- google/cloud/accesscontextmanager
@@ -285,8 +286,8 @@ file. It only contained internal symbols.
285286<summary >Removed <code >bigtable::RowReader</code > constructors
286287</summary >
287288
288- The ` bigtable::RowReader ` constructors that accept ` DataClient ` as an argument
289- have been removed .
289+ We have removed the ` bigtable::RowReader ` constructors that accept ` DataClient `
290+ as an argument .
290291
291292Developers that read rows by directly constructing a ` RowReader ` object should
292293instead construct a ` Table ` object and call ` Table::ReadRows(...) ` .
@@ -393,7 +394,7 @@ auto client = bigtable::Client(
393394
394395#### ` bigtable::CreateDefaultDataClient `
395396
396- The deprecated ` bigtable::CreateDefaultDataClient ` function has been removed .
397+ We have removed the deprecated ` bigtable::CreateDefaultDataClient ` function.
397398Please use ` bigtable::MakeDataClient ` instead.
398399
399400** Before:**
@@ -476,9 +477,9 @@ auto limit = google::cloud::bigtable::RowReader::NO_ROWS_LIMIT;
476477<summary >Removed Endpoint Options
477478</summary >
478479
479- The ` bigtable::DataEndpointOption ` , ` bigtable::AdminEndpointOption ` , and
480- ` bigtable::InstanceAdminEndpointOption ` classes have been removed. Applications
481- should use ` google::cloud::EndpointOption ` instead.
480+ We have removed the ` bigtable::DataEndpointOption ` ,
481+ ` bigtable::AdminEndpointOption ` , and ` bigtable::InstanceAdminEndpointOption `
482+ classes. Applications should use ` google::cloud::EndpointOption ` instead.
482483
483484** Before:**
484485
@@ -497,8 +498,8 @@ auto options = google::cloud::Options{}.set<google::cloud::EndpointOption>("..."
497498<details >
498499<summary >Removed <code >bigtable::DataClient</code > and related functions</summary >
499500
500- The ` bigtable::DataClient ` class and its associated factory functions (e.g.,
501- ` MakeDataClient ` ) have been removed . Applications should now use
501+ We have removed the ` bigtable::DataClient ` class and its associated factory
502+ functions (e.g., ` MakeDataClient ` ). Applications should now use
502503` bigtable::DataConnection ` and ` bigtable::MakeDataConnection() ` instead. For
503504detailed migration steps and examples, please refer to the migration guide:
504505
@@ -509,16 +510,16 @@ detailed migration steps and examples, please refer to the migration guide:
509510<details >
510511<summary >Removed <code >bigtable::MetadataUpdatePolicy</code ></summary >
511512
512- The ` bigtable::MetadataUpdatePolicy ` class has been removed . It was only used in
513+ We have removed the ` bigtable::MetadataUpdatePolicy ` class. It was only used in
513514internal legacy files.
514515
515516</details >
516517
517518<details >
518519<summary >Removed <code >bigtable::AdminClient</code > and <code >bigtable::TableAdmin</code ></summary >
519520
520- The ` bigtable::AdminClient ` class and ` bigtable::TableAdmin ` class have been
521- replaced with ` bigtable_admin::BigtableTableAdminClient ` .
521+ We have replaced the ` bigtable::AdminClient ` class and ` bigtable::TableAdmin `
522+ class with ` bigtable_admin::BigtableTableAdminClient ` .
522523
523524** Before:**
524525
@@ -562,8 +563,9 @@ result = table_admin.DropRowRange(drop_all_rows);
562563
563564<details ><summary ><code >WaitForConsistency</code > is now a free function</summary >
564565
565- With the removal of the ` bigtable::TableAdmin ` class, ` WaitForConsistency ` has
566- been moved to ` bigtable_admin::BigtableTableAdminClient::WaitForConsistency ` .
566+ With the removal of the ` bigtable::TableAdmin ` class, we have moved
567+ ` WaitForConsistency ` to
568+ ` bigtable_admin::BigtableTableAdminClient::WaitForConsistency ` .
567569
568570** Before:**
569571
@@ -602,8 +604,9 @@ auto wait_response = table_admin.WaitForConsistency(wait_request).get();
602604<details >
603605<summary >Removed <code >bigtable::InstanceAdminClient</code > and <code >bigtable::InstanceAdmin</code ></summary >
604606
605- The ` bigtable::InstanceAdminClient ` class and ` bigtable::InstanceAdmin ` class
606- have been replaced with ` bigtable_admin::BigtableInstanceAdminClient ` .
607+ We have replaced the ` bigtable::InstanceAdminClient ` class and
608+ ` bigtable::InstanceAdmin ` class with
609+ ` bigtable_admin::BigtableInstanceAdminClient ` .
607610
608611** Before:**
609612
@@ -648,7 +651,7 @@ only contained internal symbols.
648651</summary>
649652#### `pubsub::PublisherOptions`
650653
651- The deprecated `pubsub::PublisherOptions` has been removed . Please use
654+ We have removed the deprecated `pubsub::PublisherOptions`. Please use
652655`google::cloud::Options` instead.
653656
654657The following table shows the mapping from `pubsub::PublisherOptions` methods to
@@ -706,7 +709,7 @@ auto publisher = pubsub::Publisher(pubsub::MakePublisherConnection(
706709</summary>
707710#### `pubsub::SubscriberOptions`
708711
709- The deprecated `pubsub::SubscriberOptions` has been removed . Please use
712+ We have removed the deprecated `pubsub::SubscriberOptions`. Please use
710713`google::cloud::Options` instead.
711714
712715The following table shows the mapping from `pubsub::SubscriberOptions` methods
@@ -759,8 +762,8 @@ auto subscriber = pubsub::Subscriber(pubsub::MakeSubscriberConnection(
759762<details>
760763<summary>All sessions are now Multiplexed Sessions</summary>
761764
762- All SessionPool related options are marked deprecated and are now ignored by the
763- Spanner library and will be removed in the future:
765+ The Spanner library now ignores all SessionPool related options, which are
766+ marked as deprecated and will be removed in the future:
764767
765768- `EnableMultiplexedSessionOption`
766769- `SessionPoolMinSessionsOption`
@@ -775,7 +778,7 @@ Spanner library and will be removed in the future:
775778<summary>Removed <code>spanner::MakeTestRow</code>
776779</summary>
777780
778- The `spanner::MakeTestRow` functions have been removed . Please use
781+ We have removed the `spanner::MakeTestRow` functions. Please use
779782`spanner_mocks::MakeRow` instead.
780783
781784**Before:**
@@ -807,8 +810,8 @@ auto row2 = google::cloud::spanner_mocks::MakeRow(1, "foo", true);
807810<details>
808811<summary>Removed <code>spanner::ClientOptions</code> class</summary>
809812
810- The `spanner::ClientOptions` class has been removed . Use
811- `google::cloud::Options` instead to set the following as needed:
813+ We have removed the `spanner::ClientOptions` class. Use `google::cloud::Options`
814+ instead to set the following as needed:
812815
813816- `spanner::QueryOptimizerVersionOption`
814817- `spanner::QueryOptimizerStatisticsPackageOption`
@@ -857,8 +860,8 @@ file. It only contained internal symbols.
857860<details>
858861<summary>Removed Admin Clients from <code>spanner</code> namespace</summary>
859862
860- The `DatabaseAdminClient` and `InstanceAdminClient` classes (and their
861- associated connection classes and factory functions) have been removed from the
863+ We have removed the `DatabaseAdminClient` and `InstanceAdminClient` classes (and
864+ their associated connection classes and factory functions) from the
862865`google::cloud::spanner` namespace. Please use the replacements in
863866`google::cloud::spanner_admin`.
864867
@@ -1009,7 +1012,7 @@ Use the following table to map `ChannelOptions` setters to
10091012<details >
10101013<summary ><code >Client</code > Constructor removal</summary >
10111014
1012- The constructor ` Client(ClientOptions) ` is removed . The default constructor
1015+ We have removed the ` Client(ClientOptions) ` constructor . The default constructor
10131016` Client() ` generally uses default options and default credentials. To customize,
10141017use ` Client(Options) ` .
10151018
@@ -1043,8 +1046,8 @@ void CreateClient() {
10431046<details >
10441047<summary >Removed <code >Client(Connection, NoDecorations)</code > constructor</summary >
10451048
1046- The ` Client ` constructor that accepted a ` StorageConnection ` and the
1047- ` NoDecorations ` tag has been removed . This was intended only for test code.
1049+ We have removed the ` Client ` constructor that accepted a ` StorageConnection ` and
1050+ the ` NoDecorations ` tag. This was intended only for test code.
10481051
10491052** Before:**
10501053
@@ -1078,7 +1081,7 @@ void TestClient() {
10781081<details >
10791082<summary >Removed <code >Client::raw_client()</code ></summary >
10801083
1081- The ` Client::raw_client() ` method has been removed . This was intended only for
1084+ We have removed the ` Client::raw_client() ` method. This was intended only for
10821085internal use or testing. If you need access to the underlying connection for
10831086testing purposes, use ` google::cloud::storage::internal::ClientImplDetails ` .
10841087
@@ -1146,10 +1149,10 @@ Bazel should now depend on `@google_cloud_cpp//:storage_grpc`
11461149<details >
11471150<summary >Removed deprecated <code >Oauth2CredentialsOption</code ></summary >
11481151
1149- The ` google::cloud::UnifiedCredentialsOption ` and the unified credentials API
1150- documented at
1152+ You should use the ` google::cloud::UnifiedCredentialsOption ` and the unified
1153+ credentials API documented at
11511154https://docs.cloud.google.com/cpp/docs/reference/common/latest/group__guac
1152- should be used instead.
1155+ instead.
11531156
11541157** Before:**
11551158
@@ -1187,9 +1190,9 @@ auto client = gcs::Client(options);
11871190<details >
11881191<summary >Removed deprecated <code >CreateServiceAccountCredentialsFromFilePath</code ></summary >
11891192
1190- The ` google::cloud::MakeServiceAccountCredentialsFromFile ` factory function and
1191- associated override options ` google::cloud::ScopesOption ` and
1192- ` google::cloud::subjectOption ` should be used instead.
1193+ You should use the ` google::cloud::MakeServiceAccountCredentialsFromFile `
1194+ factory function and associated override options ` google::cloud::ScopesOption `
1195+ and ` google::cloud::subjectOption ` instead.
11931196
11941197** Before:**
11951198
0 commit comments