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
13- the decommissioned API surfaces to their replacements.
12+ surfaces.
1413
1514## C++17
1615
1716Depending on your build system of choice, you should set the appropriate flag
1817for your compiler if it does not already default to ` --std=c++17 ` or higher.
1918
20- ## Bazel Central Registry
21-
22- Bazel is moving away from WORKSPACE file support to using modules from the Bazel
23- Central Registry. Part of the v3.x.y release series includes supporting the new
24- [ google-cloud-cpp] ( https://registry.bazel.build/modules/google_cloud_cpp ) Bazel
25- module which can be added to your ` MODULE.bazel ` file as a dependency.
26-
2719## Dependencies
2820
2921### Previously Optional Dependencies that are now Required
@@ -34,20 +26,35 @@ module which can be added to your `MODULE.bazel` file as a dependency.
3426
3527### Relocated Dependencies
3628
37- - ` crc32c `
29+ - ` crc32c ` google-cloud-cpp now uses the crc32c implementation in Abseil.
3830
39- ## Decommissioned API Surfaces
31+ ## Build system changes
4032
4133### Bazel
4234
35+ <details >
36+ <summary >google-cloud-cpp module in Bazel Central Registry</summary >
37+
38+ Bazel is moving away from WORKSPACE file support to using modules from the Bazel
39+ Central Registry. Part of the v3.x.y release series includes supporting the new
40+ [ google-cloud-cpp] ( https://registry.bazel.build/modules/google_cloud_cpp ) Bazel
41+ module which can be added to your ` MODULE.bazel ` file as a dependency.
42+
43+ google-cloud-cpp will support WORKSPACE files until Bazel 8 reaches end of
44+ support (2027/12). However, some dependencies may stop supporting WORKSPACE
45+ files before then which will limit what dependency versions can be used via
46+ WORKSPACE.
47+
48+ </details >
49+
4350### CMake
4451
4552<details >
4653<summary >Removed backward compatible proto interface libraries.</summary >
4754
4855If your application links directly to one of these decommissioned proto
49- libraries, the CMakeLists.txt should be updated with the preferred proto library
50- name.
56+ libraries, you should update your CMakeLists.txt with the preferred proto
57+ library name.
5158
5259| Library | Decommissioned Proto Library | Preferred Proto Library |
5360| -------------------------- | ------------------------------------- | -------------------------------------- |
@@ -61,13 +68,15 @@ name.
6168
6269</details >
6370
71+ ## Decommissioned API Surfaces
72+
6473### Common
6574
6675<details >
6776<summary >Removed <code >v1</code > inline namespace alias.
6877</summary >
6978
70- The ` v1 ` namespace should be omitted for libraries that are unversioned:
79+ Omit the ` v1 ` namespace for unversioned libraries :
7180
7281- Bigtable
7382- PubSub
@@ -97,8 +106,8 @@ google::cloud::pubsub::Publisher publisher;
97106<summary >Removed <code >gcpcxxV1</code > inline namespace alias.
98107</summary >
99108
100- The ` gcpcxxV1 ` namespace should be omitted from versioned libraries. The version
101- is now part of the service namespace.
109+ Omit the ` gcpcxxV1 ` namespace from versioned libraries. The version is now part
110+ of the service namespace.
102111
103112For example, code that used to look like this:
104113
@@ -152,9 +161,9 @@ google::cloud::CompletionQueue cq;
152161<summary >Removed unversioned forwarding headers.
153162</summary >
154163
155- Some early libraries were created without version and/or service directories.
156- For backwards compatibility, forwarding headers were left at parent directory
157- that pointed at the first version of the library:
164+ We created some early libraries without version and/or service directories. For
165+ backwards compatibility, forwarding headers were left at parent directory that
166+ pointed at the first version of the library:
158167
159168- google/cloud/accessapproval
160169- google/cloud/accesscontextmanager
@@ -276,8 +285,8 @@ file. It only contained internal symbols.
276285<summary >Removed <code >bigtable::RowReader</code > constructors
277286</summary >
278287
279- The ` bigtable::RowReader ` constructors that accept ` DataClient ` as an argument
280- have been removed .
288+ We have removed the ` bigtable::RowReader ` constructors that accept ` DataClient `
289+ as an argument .
281290
282291Developers that read rows by directly constructing a ` RowReader ` object should
283292instead construct a ` Table ` object and call ` Table::ReadRows(...) ` .
@@ -335,7 +344,7 @@ for (auto& row : table.ReadRows(
335344</summary>
336345#### `bigtable::ClientOptions`
337346
338- The deprecated `bigtable::ClientOptions` has been removed . Please use
347+ We have removed the deprecated `bigtable::ClientOptions` class . Please use
339348`google::cloud::Options` instead.
340349
341350The following table shows the mapping from `bigtable::ClientOptions` methods to
@@ -384,7 +393,7 @@ auto client = bigtable::Client(
384393
385394#### ` bigtable::CreateDefaultDataClient `
386395
387- The deprecated ` bigtable::CreateDefaultDataClient ` function has been removed .
396+ We have removed the deprecated ` bigtable::CreateDefaultDataClient ` function.
388397Please use ` bigtable::MakeDataClient ` instead.
389398
390399** Before:**
@@ -467,9 +476,9 @@ auto limit = google::cloud::bigtable::RowReader::NO_ROWS_LIMIT;
467476<summary >Removed Endpoint Options
468477</summary >
469478
470- The ` bigtable::DataEndpointOption ` , ` bigtable::AdminEndpointOption ` , and
471- ` bigtable::InstanceAdminEndpointOption ` classes have been removed. Applications
472- should use ` google::cloud::EndpointOption ` instead.
479+ We have removed the ` bigtable::DataEndpointOption ` ,
480+ ` bigtable::AdminEndpointOption ` , and ` bigtable::InstanceAdminEndpointOption `
481+ classes. Applications should use ` google::cloud::EndpointOption ` instead.
473482
474483** Before:**
475484
@@ -488,11 +497,10 @@ auto options = google::cloud::Options{}.set<google::cloud::EndpointOption>("..."
488497<details >
489498<summary >Removed <code >bigtable::DataClient</code > and related functions</summary >
490499
491- The ` bigtable::DataClient ` class and its associated factory functions (e.g.,
492- ` MakeDataClient ` ) have been removed . Applications should now use
500+ We have removed the ` bigtable::DataClient ` class and its associated factory
501+ functions (e.g., ` MakeDataClient ` ). Applications should now use
493502` bigtable::DataConnection ` and ` bigtable::MakeDataConnection() ` instead. For
494- detailed migration steps and examples, please refer to the official migration
495- guide:
503+ detailed migration steps and examples, please refer to the migration guide:
496504
497505[ Migrating from DataClient to DataConnection] ( https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/migrating-from-dataclient )
498506
@@ -501,16 +509,16 @@ guide:
501509<details >
502510<summary >Removed <code >bigtable::MetadataUpdatePolicy</code ></summary >
503511
504- The ` bigtable::MetadataUpdatePolicy ` class has been removed . It was only used in
512+ We have removed the ` bigtable::MetadataUpdatePolicy ` class. It was only used in
505513internal legacy files.
506514
507515</details >
508516
509517<details >
510518<summary >Removed <code >bigtable::AdminClient</code > and <code >bigtable::TableAdmin</code ></summary >
511519
512- The ` bigtable::AdminClient ` class and ` bigtable::TableAdmin ` class have been
513- replaced with ` bigtable_admin::BigtableTableAdminClient ` .
520+ We have replaced the ` bigtable::AdminClient ` class and ` bigtable::TableAdmin `
521+ class with ` bigtable_admin::BigtableTableAdminClient ` .
514522
515523** Before:**
516524
@@ -554,8 +562,9 @@ result = table_admin.DropRowRange(drop_all_rows);
554562
555563<details ><summary ><code >WaitForConsistency</code > is now a free function</summary >
556564
557- With the removal of the ` bigtable::TableAdmin ` class, ` WaitForConsistency ` has
558- been moved to ` bigtable_admin::BigtableTableAdminClient::WaitForConsistency ` .
565+ With the removal of the ` bigtable::TableAdmin ` class, we have moved
566+ ` WaitForConsistency ` to
567+ ` bigtable_admin::BigtableTableAdminClient::WaitForConsistency ` .
559568
560569** Before:**
561570
@@ -594,8 +603,9 @@ auto wait_response = table_admin.WaitForConsistency(wait_request).get();
594603<details >
595604<summary >Removed <code >bigtable::InstanceAdminClient</code > and <code >bigtable::InstanceAdmin</code ></summary >
596605
597- The ` bigtable::InstanceAdminClient ` class and ` bigtable::InstanceAdmin ` class
598- have been replaced with ` bigtable_admin::BigtableInstanceAdminClient ` .
606+ We have replaced the ` bigtable::InstanceAdminClient ` class and
607+ ` bigtable::InstanceAdmin ` class with
608+ ` bigtable_admin::BigtableInstanceAdminClient ` .
599609
600610** Before:**
601611
@@ -622,14 +632,25 @@ auto clusters = instance_admin->ListClusters(
622632
623633</details>
624634
635+ ### IAM
636+
637+ <details>
638+
639+ <summary>Removed <code>iam/retry_traits.h</code> file</summary>
640+
641+ The library no longer exposes `google/cloud/iam/retry_traits.h` header file. It
642+ only contained internal symbols.
643+
644+ </details>
645+
625646### Pubsub
626647
627648<details>
628649 <summary>Removed <code>pubsub::PublisherOptions</code>
629650</summary>
630651#### `pubsub::PublisherOptions`
631652
632- The deprecated `pubsub::PublisherOptions` has been removed . Please use
653+ We have removed the deprecated `pubsub::PublisherOptions`. Please use
633654`google::cloud::Options` instead.
634655
635656The following table shows the mapping from `pubsub::PublisherOptions` methods to
@@ -687,7 +708,7 @@ auto publisher = pubsub::Publisher(pubsub::MakePublisherConnection(
687708</summary>
688709#### `pubsub::SubscriberOptions`
689710
690- The deprecated `pubsub::SubscriberOptions` has been removed . Please use
711+ We have removed the deprecated `pubsub::SubscriberOptions`. Please use
691712`google::cloud::Options` instead.
692713
693714The following table shows the mapping from `pubsub::SubscriberOptions` methods
@@ -740,8 +761,8 @@ auto subscriber = pubsub::Subscriber(pubsub::MakeSubscriberConnection(
740761<details>
741762<summary>All sessions are now Multiplexed Sessions</summary>
742763
743- All SessionPool related options are marked deprecated and are now ignored by the
744- Spanner library and will be removed in the future:
764+ The Spanner library now ignores all SessionPool related options, which are
765+ marked as deprecated and will be removed in the future:
745766
746767- `EnableMultiplexedSessionOption`
747768- `SessionPoolMinSessionsOption`
@@ -756,7 +777,7 @@ Spanner library and will be removed in the future:
756777<summary>Removed <code>spanner::MakeTestRow</code>
757778</summary>
758779
759- The `spanner::MakeTestRow` functions have been removed . Please use
780+ We have removed the `spanner::MakeTestRow` functions. Please use
760781`spanner_mocks::MakeRow` instead.
761782
762783**Before:**
@@ -788,8 +809,8 @@ auto row2 = google::cloud::spanner_mocks::MakeRow(1, "foo", true);
788809<details>
789810<summary>Removed <code>spanner::ClientOptions</code> class</summary>
790811
791- The `spanner::ClientOptions` class has been removed . Use
792- `google::cloud::Options` instead to set the following as needed:
812+ We have removed the `spanner::ClientOptions` class. Use `google::cloud::Options`
813+ instead to set the following as needed:
793814
794815- `spanner::QueryOptimizerVersionOption`
795816- `spanner::QueryOptimizerStatisticsPackageOption`
@@ -838,8 +859,8 @@ file. It only contained internal symbols.
838859<details>
839860<summary>Removed Admin Clients from <code>spanner</code> namespace</summary>
840861
841- The `DatabaseAdminClient` and `InstanceAdminClient` classes (and their
842- associated connection classes and factory functions) have been removed from the
862+ We have removed the `DatabaseAdminClient` and `InstanceAdminClient` classes (and
863+ their associated connection classes and factory functions) from the
843864`google::cloud::spanner` namespace. Please use the replacements in
844865`google::cloud::spanner_admin`.
845866
@@ -990,7 +1011,7 @@ Use the following table to map `ChannelOptions` setters to
9901011<details >
9911012<summary ><code >Client</code > Constructor removal</summary >
9921013
993- The constructor ` Client(ClientOptions) ` is removed . The default constructor
1014+ We have removed the ` Client(ClientOptions) ` constructor . The default constructor
9941015` Client() ` generally uses default options and default credentials. To customize,
9951016use ` Client(Options) ` .
9961017
@@ -1024,8 +1045,8 @@ void CreateClient() {
10241045<details >
10251046<summary >Removed <code >Client(Connection, NoDecorations)</code > constructor</summary >
10261047
1027- The ` Client ` constructor that accepted a ` StorageConnection ` and the
1028- ` NoDecorations ` tag has been removed . This was intended only for test code.
1048+ We have removed the ` Client ` constructor that accepted a ` StorageConnection ` and
1049+ the ` NoDecorations ` tag. This was intended only for test code.
10291050
10301051** Before:**
10311052
@@ -1059,7 +1080,7 @@ void TestClient() {
10591080<details >
10601081<summary >Removed <code >Client::raw_client()</code ></summary >
10611082
1062- The ` Client::raw_client() ` method has been removed . This was intended only for
1083+ We have removed the ` Client::raw_client() ` method. This was intended only for
10631084internal use or testing. If you need access to the underlying connection for
10641085testing purposes, use ` google::cloud::storage::internal::ClientImplDetails ` .
10651086
@@ -1127,10 +1148,10 @@ Bazel should now depend on `@google_cloud_cpp//:storage_grpc`
11271148<details >
11281149<summary >Removed deprecated <code >Oauth2CredentialsOption</code ></summary >
11291150
1130- The ` google::cloud::UnifiedCredentialsOption ` and the unified credentials API
1131- documented at
1151+ You should use the ` google::cloud::UnifiedCredentialsOption ` and the unified
1152+ credentials API documented at
11321153https://docs.cloud.google.com/cpp/docs/reference/common/latest/group__guac
1133- should be used instead.
1154+ instead.
11341155
11351156** Before:**
11361157
@@ -1168,9 +1189,9 @@ auto client = gcs::Client(options);
11681189<details >
11691190<summary >Removed deprecated <code >CreateServiceAccountCredentialsFromFilePath</code ></summary >
11701191
1171- The ` google::cloud::MakeServiceAccountCredentialsFromFile ` factory function and
1172- associated override options ` google::cloud::ScopesOption ` and
1173- ` google::cloud::subjectOption ` should be used instead.
1192+ You should use the ` google::cloud::MakeServiceAccountCredentialsFromFile `
1193+ factory function and associated override options ` google::cloud::ScopesOption `
1194+ and ` google::cloud::subjectOption ` instead.
11741195
11751196** Before:**
11761197
@@ -1212,15 +1233,3 @@ auto client = gcs::Client(options);
12121233```
12131234
12141235</details >
1215-
1216- ### IAM
1217-
1218- <details >
1219-
1220- <summary >Removed <code >iam/retry_traits.h</code > file</summary >
1221-
1222- </details >
1223- The library no longer exposes ` google/cloud/iam/retry_traits.h ` header file. It
1224- only contained internal symbols.
1225-
1226- </details >
0 commit comments