Skip to content

Commit

Permalink
refactor(hand-written-products): to use GOOGLE_CLOUD_CPP_NS for inlin…
Browse files Browse the repository at this point in the history
…e namespace (#7441)

Part of: #5976

For {spanner,bigtable,storage,pubsub}, they all now directly use `GOOGLE_CLOUD_CPP_NS` as the name of their inline namespace. This resolves to the exact same thing as it did before, so this is not a breaking change.

The old namespace names of `GOOGLE_CLOUD_CPP_PUBSUB_NS`, `BIGTABLE_CLIENT_NS`, `SPANNER_CLIENT_NS`, and `STORAGE_CLIENT_NS` are now _commented_ as deprecated, but they are still defined to be equivalent to `GOOGLE_CLOUD_CPP_NS`, so this change should not break any customers.

**ATTENTION REVIEWERS:** This PR is mostly search-n-replace changes. The only files with hand edits are:
- `cmake/GoogleCloudCppCommon.cmake`
- `google/cloud/*/version.h`, where the addition is just a comment
  • Loading branch information
devjgm authored Oct 11, 2021
1 parent 677e5f1 commit 6137b15
Show file tree
Hide file tree
Showing 920 changed files with 1,985 additions and 1,978 deletions.
6 changes: 1 addition & 5 deletions cmake/GoogleCloudCppCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ elseif (GOOGLE_CLOUD_CPP_GENERATE_DOXYGEN)
"GOOGLE_CLOUD_CPP_BIGTABLE_IAM_DEPRECATED(x)="
"GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED(x)="
"GOOGLE_CLOUD_CPP_GENERATED_NS=v${PROJECT_VERSION_MAJOR}"
"GOOGLE_CLOUD_CPP_NS=v${PROJECT_VERSION_MAJOR}"
"GOOGLE_CLOUD_CPP_PUBSUB_NS=v${PROJECT_VERSION_MAJOR}"
"BIGTABLE_CLIENT_NS=v${PROJECT_VERSION_MAJOR}"
"SPANNER_CLIENT_NS=v${PROJECT_VERSION_MAJOR}"
"STORAGE_CLIENT_NS=v${PROJECT_VERSION_MAJOR}")
"GOOGLE_CLOUD_CPP_NS=v${PROJECT_VERSION_MAJOR}")
set(DOXYGEN_HTML_TIMESTAMP YES)
set(DOXYGEN_STRIP_FROM_INC_PATH "${PROJECT_SOURCE_DIR}")
set(DOXYGEN_SHOW_USED_FILES NO)
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/admin_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {

namespace btadmin = ::google::bigtable::admin::v2;

Expand Down Expand Up @@ -429,7 +429,7 @@ std::shared_ptr<AdminClient> CreateDefaultAdminClient(std::string project,
internal::MakeOptions(std::move(options)));
}

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/admin_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
// Forward declare some classes so we can be friends.
class TableAdmin;
namespace internal {
Expand Down Expand Up @@ -306,7 +306,7 @@ std::shared_ptr<AdminClient> MakeAdminClient(std::string project,
std::shared_ptr<AdminClient> CreateDefaultAdminClient(std::string project,
ClientOptions options);

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/admin_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace {

TEST(AdminClientTest, Default) {
Expand Down Expand Up @@ -70,7 +70,7 @@ TEST(AdminClientTest, Logging) {
}

} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/app_profile_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
AppProfileConfig AppProfileConfig::MultiClusterUseAny(std::string profile_id) {
AppProfileConfig tmp;
tmp.proto_.set_app_profile_id(std::move(profile_id));
Expand Down Expand Up @@ -56,7 +56,7 @@ void AppProfileUpdateConfig::RemoveIfPresent(std::string const& field_name) {
paths.erase(i);
}

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/app_profile_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
/// Specify the initial configuration for an application profile.
class AppProfileConfig {
public:
Expand Down Expand Up @@ -119,7 +119,7 @@ class AppProfileUpdateConfig {
google::bigtable::admin::v2::UpdateAppProfileRequest proto_;
};

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/app_profile_config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace {
TEST(AppProfileConfig, MultiClusterUseAny) {
auto proto = AppProfileConfig::MultiClusterUseAny("my-profile").as_proto();
Expand Down Expand Up @@ -128,7 +128,7 @@ TEST(AppProfileUpdateConfig, SetSeveral) {
EXPECT_TRUE(HasFieldNameOnce(proto.update_mask(), "single_cluster_routing"));
}
} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/async_read_stream_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace {

namespace btproto = ::google::bigtable::v2;
Expand Down Expand Up @@ -717,7 +717,7 @@ TEST_F(AsyncReadStreamTest, DiscardAfterReturningFalse) {
}

} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/async_row_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
/**
* Objects of this class represent the state of reading rows via AsyncReadRows.
*
Expand Down Expand Up @@ -424,7 +424,7 @@ class AsyncRowReader : public std::enable_shared_from_this<
int recursion_level_;
};

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/async_row_reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace {

namespace btproto = ::google::bigtable::v2;
Expand Down Expand Up @@ -1075,7 +1075,7 @@ TEST_F(TableAsyncReadRowsTest, ReadRowError) {
}

} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/bigtable_version_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
using ::testing::HasSubstr;
using ::testing::Not;
using ::testing::StartsWith;
Expand Down Expand Up @@ -50,7 +50,7 @@ TEST(StorageVersionTest, HasMetadataWhenDefined) {
EXPECT_THAT(version_string(), Not(HasSubstr("+")));
}

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
class Cell;
struct Mutation;
Mutation SetCell(Cell);
Expand Down Expand Up @@ -177,7 +177,7 @@ class Cell {
friend Mutation SetCell(Cell);
};

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/cell_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace {

/// @test Verify Cell instantiation and trivial accessors.
Expand Down Expand Up @@ -95,7 +95,7 @@ TEST(CellTest, RValueRefAccessors) {
}

} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/client_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace internal {
Options&& MakeOptions(ClientOptions&& o) {
if (!o.connection_pool_name_.empty()) {
Expand Down Expand Up @@ -71,7 +71,7 @@ BackgroundThreadsFactory ClientOptions::background_threads_factory() const {
return google::cloud::internal::MakeBackgroundThreadsFactory(opts_);
}

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/client_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
class ClientOptions;
namespace internal {
Options&& MakeOptions(ClientOptions&& o);
Expand Down Expand Up @@ -476,7 +476,7 @@ class ClientOptions {
Options opts_;
};

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/client_options_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
struct ClientOptionsTestTraits {
static std::string const& InstanceAdminEndpoint(
ClientOptions const& options) {
Expand Down Expand Up @@ -585,7 +585,7 @@ TEST(ClientOptionsTest, CustomBackgroundThreads) {
}

} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/cluster_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
// The names for these constants are taken from the proto, and follow the
// conventions from proto files.

Expand All @@ -27,7 +27,7 @@ constexpr ClusterConfig::StorageType ClusterConfig::SSD;
// NOLINTNEXTLINE(readability-identifier-naming)
constexpr ClusterConfig::StorageType ClusterConfig::HDD;

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/cluster_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {

/// Specify the initial configuration for a new cluster.
class ClusterConfig {
Expand Down Expand Up @@ -71,7 +71,7 @@ class ClusterConfig {
google::bigtable::admin::v2::Cluster proto_;
};

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/cluster_config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace {

using ::google::cloud::testing_util::IsProtoEqual;
Expand Down Expand Up @@ -65,7 +65,7 @@ TEST(ClusterConfigTest, SetEncryptionConfig) {
}

} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/bigtable/cluster_list_responses.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
/**
* The response for an asynchronous request listing all the clusters.
*/
Expand All @@ -42,7 +42,7 @@ struct ClusterList {
std::vector<std::string> failed_locations;
};

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/column_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
/**
* Implement a thin wrapper around google::bigtable::admin::v2::GcRule.
*
Expand Down Expand Up @@ -220,7 +220,7 @@ class ColumnFamilyModification {
::google::bigtable::admin::v2::ModifyColumnFamiliesRequest::Modification mod_;
};

} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/column_family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace google {
namespace cloud {
namespace bigtable {
inline namespace BIGTABLE_CLIENT_NS {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace {

using ::google::cloud::testing_util::chrono_literals::operator"" _h;
Expand Down Expand Up @@ -147,7 +147,7 @@ TEST(ColumnFamilyModification, Drop) {
}

} // namespace
} // namespace BIGTABLE_CLIENT_NS
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace bigtable
} // namespace cloud
} // namespace google
Loading

0 comments on commit 6137b15

Please sign in to comment.