From c5fb3d1380dc52d20e61d5b75886ebb78761434b Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Fri, 24 Apr 2026 14:48:48 -0400 Subject: [PATCH 1/3] impl(bigtable): add DeadlineOption --- google/cloud/bigtable/CMakeLists.txt | 2 + .../bigtable/bigtable_client_unit_tests.bzl | 1 + .../bigtable/google_cloud_cpp_bigtable.bzl | 1 + google/cloud/bigtable/options.cc | 63 +++++++ google/cloud/bigtable/options.h | 35 ++++ google/cloud/bigtable/options_test.cc | 177 ++++++++++++++++++ 6 files changed, 279 insertions(+) create mode 100644 google/cloud/bigtable/options.cc create mode 100644 google/cloud/bigtable/options_test.cc diff --git a/google/cloud/bigtable/CMakeLists.txt b/google/cloud/bigtable/CMakeLists.txt index 5dc1c42f4ed68..2be88e34d3e0c 100644 --- a/google/cloud/bigtable/CMakeLists.txt +++ b/google/cloud/bigtable/CMakeLists.txt @@ -229,6 +229,7 @@ add_library( mutation_branch.h mutations.cc mutations.h + options.cc options.h polling_policy.cc polling_policy.h @@ -476,6 +477,7 @@ if (BUILD_TESTING) mocks/mock_row_reader_test.cc mutation_batcher_test.cc mutations_test.cc + options_test.cc polling_policy_test.cc prepared_query_test.cc query_row_test.cc diff --git a/google/cloud/bigtable/bigtable_client_unit_tests.bzl b/google/cloud/bigtable/bigtable_client_unit_tests.bzl index 4c9b3784556f4..99c7af16cbaba 100644 --- a/google/cloud/bigtable/bigtable_client_unit_tests.bzl +++ b/google/cloud/bigtable/bigtable_client_unit_tests.bzl @@ -72,6 +72,7 @@ bigtable_client_unit_tests = [ "mocks/mock_row_reader_test.cc", "mutation_batcher_test.cc", "mutations_test.cc", + "options_test.cc", "polling_policy_test.cc", "prepared_query_test.cc", "query_row_test.cc", diff --git a/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl b/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl index e8f2fe5650641..3548270b00fa9 100644 --- a/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl +++ b/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl @@ -222,6 +222,7 @@ google_cloud_cpp_bigtable_srcs = [ "internal/traced_row_reader.cc", "mutation_batcher.cc", "mutations.cc", + "options.cc", "polling_policy.cc", "prepared_query.cc", "query_row.cc", diff --git a/google/cloud/bigtable/options.cc b/google/cloud/bigtable/options.cc new file mode 100644 index 0000000000000..69753dd831b2a --- /dev/null +++ b/google/cloud/bigtable/options.cc @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "google/cloud/bigtable/options.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/options.h" +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options MergeOptions(Options preferred, Options alternatives) { + return MergeOptions(std::move(preferred), std::move(alternatives), + [] { return std::chrono::system_clock::now(); }); +} + +Options MergeOptions( + Options preferred, Options alternatives, + std::function now_fn) { + auto merged_options = + internal::MergeOptions(std::move(preferred), std::move(alternatives)); + + if (merged_options.has()) { + auto deadline = merged_options.get(); + auto existing_fn = + internal::ExtractOption(merged_options); + if (existing_fn.has_value()) { + auto apply_deadline = [existing_fn = *std::move(existing_fn), + now_fn = std::move(now_fn), + deadline](grpc::ClientContext& context) { + existing_fn(context); + context.set_deadline(now_fn() + deadline); + }; + merged_options.set(apply_deadline); + } else { + auto apply_deadline = [now_fn = std::move(now_fn), + deadline](grpc::ClientContext& context) { + context.set_deadline(now_fn() + deadline); + }; + merged_options.set(apply_deadline); + } + } + return merged_options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/options.h b/google/cloud/bigtable/options.h index d75550400fa49..2fdcefa622598 100644 --- a/google/cloud/bigtable/options.h +++ b/google/cloud/bigtable/options.h @@ -44,8 +44,11 @@ #include "google/cloud/bigtable/retry_policy.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/backoff_policy.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/options.h" #include +#include +#include #include namespace google { @@ -250,6 +253,23 @@ struct DataBackoffPolicyOption { using Type = std::shared_ptr; }; +/** + * Option to set the per RPC attempt deadline. + * + * @note If used in conjunction with a LimitedTimeRetryPolicy the last RPC + * attempt could cause the maximum duration of the RetryPolicy to be + * extended up to the RPC attempt deadline duration. + * + * @note If both DeadlineOption and GrpcSetupOption are set, DeadlineOption will + * be applied after GrpcSetupOption, overwriting any changes GrpcSetupOption + * made to grpc::ClientContext::deadline. + * + * @ingroup google-cloud-bigtable-options + */ +struct DeadlineOption { + using Type = std::chrono::milliseconds; +}; + /** * Option to configure the idempotency policy used by `Table`. * @@ -299,6 +319,21 @@ using DataPolicyOptionList = GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable + +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Bigtable specific MergeOptions that has special handling for merging +/// `GrpcSetupOption` and `DeadlineOption`. +Options MergeOptions(Options preferred, Options alternatives); + +/// For testing only. +Options MergeOptions( + Options preferred, Options alternatives, + std::function now_fn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal } // namespace cloud } // namespace google diff --git a/google/cloud/bigtable/options_test.cc b/google/cloud/bigtable/options_test.cc new file mode 100644 index 0000000000000..5cf47046964c1 --- /dev/null +++ b/google/cloud/bigtable/options_test.cc @@ -0,0 +1,177 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "google/cloud/bigtable/options.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/options.h" +#include "google/cloud/testing_util/fake_clock.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +using ::google::cloud::bigtable::DeadlineOption; +using ::google::cloud::internal::GrpcSetupOption; +using ::google::cloud::testing_util::FakeSystemClock; +using ::testing::Eq; + +TEST(MergeOptions, ConnectionDeadlineOption) { + FakeSystemClock clock; + clock.SetTime(std::chrono::system_clock::now()); + auto now_fn = [&] { return clock.Now(); }; + + auto connection_opts = Options{}.set(std::chrono::seconds(1)); + Options client_opts; + + // Merge in a deadline. This should populate the GrpcSetupOption with a call + // to ClientContext::set_deadline + auto merged_client_opts = + MergeOptions(std::move(client_opts), std::move(connection_opts), now_fn); + + ASSERT_TRUE(merged_client_opts.has()); + grpc::ClientContext context; + merged_client_opts.get()(context); + EXPECT_THAT(context.deadline() - clock.Now(), Eq(std::chrono::seconds(1))); +} + +TEST(MergeOptions, ClientOverridesDeadlineOption) { + FakeSystemClock clock; + clock.SetTime(std::chrono::system_clock::now()); + auto now_fn = [&] { return clock.Now(); }; + + auto connection_opts = Options{}.set(std::chrono::seconds(1)); + auto client_opts = Options{}.set(std::chrono::seconds(2)); + + // Merge in a deadline. This should populate the GrpcSetupOption with a call + // to ClientContext::set_deadline + auto merged_client_opts = + MergeOptions(std::move(client_opts), std::move(connection_opts), now_fn); + + ASSERT_TRUE(merged_client_opts.has()); + grpc::ClientContext context; + merged_client_opts.get()(context); + EXPECT_THAT(context.deadline() - clock.Now(), Eq(std::chrono::seconds(2))); +} + +TEST(MergeOptions, CallOverridesAllOtherDeadlineOption) { + FakeSystemClock clock; + clock.SetTime(std::chrono::system_clock::now()); + auto now_fn = [&] { return clock.Now(); }; + + auto connection_opts = Options{}.set(std::chrono::seconds(1)); + auto client_opts = Options{}.set(std::chrono::seconds(2)); + + // Merge in a deadline. This should populate the GrpcSetupOption with a call + // to ClientContext::set_deadline + auto merged_client_opts = + MergeOptions(std::move(client_opts), std::move(connection_opts), now_fn); + + auto call_opts = Options{}.set(std::chrono::seconds(5)); + + auto merged_call_opts = + MergeOptions(std::move(call_opts), std::move(merged_client_opts), now_fn); + + ASSERT_TRUE(merged_call_opts.has()); + grpc::ClientContext context; + merged_call_opts.get()(context); + EXPECT_THAT(context.deadline() - clock.Now(), Eq(std::chrono::seconds(5))); +} + +TEST(MergeOptions, OnlyDeadlineOptionSupersedesGrpcSetupOptionDeadline) { + FakeSystemClock clock; + clock.SetTime(std::chrono::system_clock::now()); + auto now_fn = [&] { return clock.Now(); }; + + auto setup_fn = [&](grpc::ClientContext& context) { + EXPECT_THAT(context.compression_algorithm(), Eq(GRPC_COMPRESS_NONE)); + // compression_algorithm is set to verify the non-deadline aspects of the + // GrpcSetupOption are preserved. + context.set_compression_algorithm(GRPC_COMPRESS_GZIP); + context.set_deadline(now_fn() + std::chrono::seconds(10)); + }; + + auto connection_opts = Options{}.set(setup_fn); + Options client_opts; + + auto merged_client_opts = + MergeOptions(std::move(client_opts), std::move(connection_opts), now_fn); + { + ASSERT_TRUE(merged_client_opts.has()); + grpc::ClientContext context; + merged_client_opts.get()(context); + EXPECT_THAT(context.compression_algorithm(), Eq(GRPC_COMPRESS_GZIP)); + EXPECT_THAT(context.deadline() - clock.Now(), Eq(std::chrono::seconds(10))); + } + + connection_opts = + Options{}.set(setup_fn).set( + std::chrono::seconds(1)); + client_opts = Options{}; + + // Merge in a deadline. This should populate the GrpcSetupOption with a call + // to ClientContext::set_deadline after calling the GrpcSetupOption function. + merged_client_opts = + MergeOptions(std::move(client_opts), std::move(connection_opts), now_fn); + + ASSERT_TRUE(merged_client_opts.has()); + grpc::ClientContext context; + merged_client_opts.get()(context); + EXPECT_THAT(context.compression_algorithm(), Eq(GRPC_COMPRESS_GZIP)); + EXPECT_THAT(context.deadline() - clock.Now(), Eq(std::chrono::seconds(1))); +} + +TEST(MergeOptions, ClientDeadlineOptionCallGrpcSetupOption) { + FakeSystemClock clock; + clock.SetTime(std::chrono::system_clock::now()); + auto now_fn = [&] { return clock.Now(); }; + + auto setup_fn = [&](grpc::ClientContext& context) { + EXPECT_THAT(context.compression_algorithm(), Eq(GRPC_COMPRESS_NONE)); + // compression_algorithm is set to verify the non-deadline aspects of the + // GrpcSetupOption are preserved. + context.set_compression_algorithm(GRPC_COMPRESS_GZIP); + context.set_deadline(now_fn() + std::chrono::seconds(10)); + }; + + auto call_setup_fn = [&](grpc::ClientContext& context) { + EXPECT_THAT(context.compression_algorithm(), Eq(GRPC_COMPRESS_NONE)); + context.set_compression_algorithm(GRPC_COMPRESS_DEFLATE); + }; + + auto connection_opts = Options{}.set(setup_fn); + auto client_opts = Options{}.set(std::chrono::seconds(5)); + auto call_opts = Options{}.set(call_setup_fn); + + auto merged_client_opts = + MergeOptions(std::move(client_opts), std::move(connection_opts), now_fn); + auto merged_call_opts = + MergeOptions(std::move(call_opts), std::move(merged_client_opts), now_fn); + + ASSERT_TRUE(merged_call_opts.has()); + grpc::ClientContext context; + merged_call_opts.get()(context); + EXPECT_THAT(context.compression_algorithm(), Eq(GRPC_COMPRESS_DEFLATE)); + EXPECT_THAT(context.deadline() - clock.Now(), Eq(std::chrono::seconds(5))); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google From aa9e8082d0ba7d4cdeaf5aac93a5f52b9479b09d Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Mon, 27 Apr 2026 13:23:34 -0400 Subject: [PATCH 2/3] update handwritten MergeOptions --- google/cloud/bigtable/benchmarks/benchmark.cc | 4 ++-- google/cloud/bigtable/client.cc | 2 +- google/cloud/bigtable/client.h | 5 +++-- google/cloud/bigtable/internal/data_connection_impl.cc | 6 ++---- google/cloud/bigtable/internal/defaults.cc | 6 +++--- google/cloud/bigtable/table.cc | 2 +- google/cloud/bigtable/table.h | 6 +++--- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/google/cloud/bigtable/benchmarks/benchmark.cc b/google/cloud/bigtable/benchmarks/benchmark.cc index d758bb6b09714..40fa20ff5bfe1 100644 --- a/google/cloud/bigtable/benchmarks/benchmark.cc +++ b/google/cloud/bigtable/benchmarks/benchmark.cc @@ -32,6 +32,7 @@ namespace google { namespace cloud { namespace bigtable { namespace benchmarks { +using ::google::cloud::bigtable_internal::MergeOptions; using ::google::cloud::internal::GetEnv; google::cloud::StatusOr ParseArgs( @@ -127,8 +128,7 @@ void Benchmark::DeleteTable() { } Table Benchmark::MakeTable(Options connection_opts) const { - auto connection_options = - google::cloud::internal::MergeOptions(std::move(connection_opts), opts_); + auto connection_options = MergeOptions(std::move(connection_opts), opts_); auto table_opts = Options{}.set(options_.app_profile_id); return Table(MakeDataConnection(std::move(connection_options)), TableResource(options_.project_id, options_.instance_id, diff --git a/google/cloud/bigtable/client.cc b/google/cloud/bigtable/client.cc index a8a8cec7359f7..893683bdadf4f 100644 --- a/google/cloud/bigtable/client.cc +++ b/google/cloud/bigtable/client.cc @@ -21,7 +21,7 @@ namespace cloud { namespace bigtable { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -using ::google::cloud::internal::MergeOptions; +using ::google::cloud::bigtable_internal::MergeOptions; using ::google::cloud::internal::OptionsSpan; StatusOr Client::PrepareQuery(InstanceResource const& instance, diff --git a/google/cloud/bigtable/client.h b/google/cloud/bigtable/client.h index 68d556a6d8992..00163d13c2730 100644 --- a/google/cloud/bigtable/client.h +++ b/google/cloud/bigtable/client.h @@ -18,6 +18,7 @@ #include "google/cloud/bigtable/bound_query.h" #include "google/cloud/bigtable/data_connection.h" #include "google/cloud/bigtable/instance_resource.h" +#include "google/cloud/bigtable/options.h" #include "google/cloud/bigtable/prepared_query.h" #include "google/cloud/bigtable/sql_statement.h" #include "google/cloud/bigtable/version.h" @@ -62,8 +63,8 @@ class Client { */ explicit Client(std::shared_ptr conn, Options opts = {}) : conn_(std::move(conn)), - opts_(google::cloud::internal::MergeOptions(std::move(opts), - conn_->options())) {} + opts_(bigtable_internal::MergeOptions(std::move(opts), + conn_->options())) {} /** * Prepares a query for future execution. diff --git a/google/cloud/bigtable/internal/data_connection_impl.cc b/google/cloud/bigtable/internal/data_connection_impl.cc index 9dd334aac532f..81ac2fb5d3c68 100644 --- a/google/cloud/bigtable/internal/data_connection_impl.cc +++ b/google/cloud/bigtable/internal/data_connection_impl.cc @@ -224,8 +224,7 @@ DataConnectionImpl::DataConnectionImpl( : background_(std::move(background)), stub_manager_(std::move(stub_manager)), limiter_(std::move(limiter)), - options_(internal::MergeOptions(std::move(options), - DataConnection::options())) { + options_(MergeOptions(std::move(options), DataConnection::options())) { #ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS if (options_.get()) { // The client_uid is eventually used in conjunction with other data labels @@ -264,8 +263,7 @@ DataConnectionImpl::DataConnectionImpl( stub_manager_(std::move(stub_manager)), operation_context_factory_(std::move(operation_context_factory)), limiter_(std::move(limiter)), - options_(internal::MergeOptions(std::move(options), - DataConnection::options())) {} + options_(MergeOptions(std::move(options), DataConnection::options())) {} DataConnectionImpl::DataConnectionImpl( std::unique_ptr background, diff --git a/google/cloud/bigtable/internal/defaults.cc b/google/cloud/bigtable/internal/defaults.cc index 9544730158bda..e26fbf25f69b1 100644 --- a/google/cloud/bigtable/internal/defaults.cc +++ b/google/cloud/bigtable/internal/defaults.cc @@ -36,9 +36,10 @@ namespace cloud { namespace bigtable { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { - namespace { +using ::google::cloud::bigtable_internal::MergeOptions; + auto constexpr kBackoffScaling = 2.0; // As learned from experiments, idle gRPC connections enter IDLE state after 4m. @@ -219,8 +220,7 @@ Options DefaultOptions(Options opts) { ::google::cloud::internal::DefaultTracingOptions()) .set(DefaultConnectionPoolSize()); - opts = google::cloud::internal::MergeOptions(std::move(opts), - std::move(defaults)); + opts = MergeOptions(std::move(opts), std::move(defaults)); if (!emulator) opts = DefaultConnectionRefreshOptions(std::move(opts)); opts = DefaultChannelArgumentOptions(std::move(opts)); diff --git a/google/cloud/bigtable/table.cc b/google/cloud/bigtable/table.cc index 68b7c8016f073..5c7a59815f175 100644 --- a/google/cloud/bigtable/table.cc +++ b/google/cloud/bigtable/table.cc @@ -22,7 +22,7 @@ namespace cloud { namespace bigtable { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -using ::google::cloud::internal::MergeOptions; +using ::google::cloud::bigtable_internal::MergeOptions; using ::google::cloud::internal::OptionsSpan; namespace { diff --git a/google/cloud/bigtable/table.h b/google/cloud/bigtable/table.h index 6539d08961b7b..19a7c35deb678 100644 --- a/google/cloud/bigtable/table.h +++ b/google/cloud/bigtable/table.h @@ -194,8 +194,8 @@ class Table { : table_(std::move(tr)), table_name_(table_.FullName()), connection_(std::move(conn)), - options_(google::cloud::internal::MergeOptions( - std::move(options), connection_->options())) {} + options_(bigtable_internal::MergeOptions(std::move(options), + connection_->options())) {} std::string const& table_name() const { return table_name_; } std::string const& app_profile_id() const { @@ -755,7 +755,7 @@ class Table { }; google::cloud::internal::OptionsSpan span( - google::cloud::internal::MergeOptions(std::move(opts), options_)); + bigtable_internal::MergeOptions(std::move(opts), options_)); connection_->AsyncReadRows(table_name_, std::move(on_row_fn), std::move(on_finish_fn), std::move(row_set), rows_limit, std::move(filter)); From a91f29f9a23ffe5eb57645f7d44480e7c9840f6e Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Mon, 27 Apr 2026 14:13:59 -0400 Subject: [PATCH 3/3] update generated MergeOptions --- generator/internal/client_generator.cc | 40 +-- generator/internal/descriptor_utils.cc | 4 + .../admin/bigtable_instance_admin_client.cc | 275 ++++++++++++------ .../admin/bigtable_table_admin_client.cc | 269 +++++++++++------ 4 files changed, 388 insertions(+), 200 deletions(-) diff --git a/generator/internal/client_generator.cc b/generator/internal/client_generator.cc index c2585c255ee97..10b042ed24606 100644 --- a/generator/internal/client_generator.cc +++ b/generator/internal/client_generator.cc @@ -24,6 +24,7 @@ #include "absl/strings/str_replace.h" #include "google/api/client.pb.h" #include +#include namespace google { namespace cloud { @@ -456,7 +457,10 @@ Status ClientGenerator::GenerateCc() { if (MethodSignatureUsesDeprecatedField()) { CcLocalIncludes({"google/cloud/internal/disable_deprecation_warnings.inc"}); } - CcLocalIncludes({vars("client_header_path")}); + CcLocalIncludes({vars("client_header_path"), + absl::StartsWithIgnoreCase(vars("service_name"), "Bigtable") + ? "google/cloud/bigtable/options.h" + : ""}); CcSystemIncludes({"memory"}); if (get_iam_policy_extension_ && set_iam_policy_extension_) { CcLocalIncludes({vars("options_header_path")}); @@ -473,7 +477,7 @@ Status ClientGenerator::GenerateCc() { CcPrint(R"""( std::shared_ptr<$connection_class_name$> connection, Options opts) : connection_(std::move(connection)), - options_(internal::MergeOptions(std::move(opts), + options_($merge_options_fn$(std::move(opts), connection_->options())) {} $client_class_name$::~$client_class_name$() = default; )"""); @@ -488,7 +492,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< $response_type$>> $client_class_name$::Async$method_name$(Options opts) { internal::OptionsSpan span( - internal::MergeOptions(std::move(opts), options_)); + $merge_options_fn$(std::move(opts), options_)); return connection_->Async$method_name$(); } )"""); @@ -513,7 +517,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< {"\n$return_type$\n"}, // clang-format off {method_string}, - {" internal::OptionsSpan span(internal::MergeOptions(" + {" internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n"}, {" $request_type$ request;\n"}, {method_request_string}, @@ -529,7 +533,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< "\nfuture\n", "\nfuture>\n"}, {method_string}, - {" internal::OptionsSpan span(internal::MergeOptions(" + {" internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n"}, {" $request_type$ request;\n"}, {method_request_string}, @@ -541,7 +545,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< "\nStatus\n", "\nStatusOr<$longrunning_operation_type$>\n"}, {start_method_string}, - {" internal::OptionsSpan span(internal::MergeOptions(" + {" internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n"}, {" $request_type$ request;\n"}, {method_request_string}, @@ -554,7 +558,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< // clang-format off {"\nStreamRange<$range_output_type$>\n"}, {method_string}, - {" internal::OptionsSpan span(internal::MergeOptions(" + {" internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n"}, {" $request_type$ request;\n"}, {method_request_string}, @@ -567,7 +571,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< // clang-format off {"\nStreamRange<$response_type$>\n"}, {method_string}, - {" internal::OptionsSpan span(internal::MergeOptions(" + {" internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n"}, {" $request_type$ request;\n"}, {method_request_string}, @@ -591,7 +595,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< " Options opts) {\n" " internal::CheckExpectedOptions<$service_name$" "BackoffPolicyOption>(opts, __func__);\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n"}, {" "}, {ProtoNameToCppName( @@ -644,7 +648,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< // clang-format off {"$client_class_name$::$method_name$($request_type$ const& request" ", Options opts) {\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n" " return connection_->$method_name$(request);\n" "}\n"} // clang-format on @@ -659,7 +663,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< "\nfuture>\n"}, {"$client_class_name$::$method_name$($request_type$ const& request" ", Options opts) {\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n" " return connection_->$method_name$(request);\n" "}\n"}, @@ -671,7 +675,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< {"$client_class_name$::$method_name$(NoAwaitTag" ", $request_type$ const& request" ", Options opts) {\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n" " return connection_->$method_name$(NoAwaitTag{}, request);\n" "}\n"}, @@ -682,7 +686,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< "\nfuture>\n"}, {"$client_class_name$::$method_name$(" "$longrunning_operation_type$ const& operation, Options opts) {\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n" " return connection_->$method_name$(operation);\n"}, {"}\n"} // clang-format on @@ -694,7 +698,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< {"\nStreamRange<$range_output_type$>\n" "$client_class_name$::$method_name$($request_type$ request" ", Options opts) {\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n" " return connection_->$method_name$(std::move(request));\n" "}\n"} // clang-format on @@ -706,7 +710,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< {"\nStreamRange<$response_type$>\n" "$client_class_name$::$method_name$($request_type$ const& request" ", Options opts) {\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n" " return connection_->$method_name$(request);\n" "}\n"} // clang-format on @@ -733,7 +737,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< {"\nfuture<$return_type$>\n"}, // clang-format off {method_string}, - {" internal::OptionsSpan span(internal::MergeOptions(" + {" internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n"}, {" $request_type$ request;\n"}, {method_request_string}, @@ -752,7 +756,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< // clang-format off {"$client_class_name$::Async$method_name$($request_type$ const& request" ", Options opts) {\n" - " internal::OptionsSpan span(internal::MergeOptions(" + " internal::OptionsSpan span($merge_options_fn$(" "std::move(opts), options_));\n" " return connection_->Async$method_name$(request);\n" "}\n"} // clang-format on @@ -768,7 +772,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< method.return_type(), R"""( $client_class_name$::)""", method.name(), absl::StrReplaceAll(method.parameters(), {{" = {}", ""}}), absl::StrFormat(R"""( { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span($merge_options_fn$(std::move(opts), options_)); return connection_->%s(request); } )""", diff --git a/generator/internal/descriptor_utils.cc b/generator/internal/descriptor_utils.cc index 8aa4e8bc5b044..b7fd0778b4043 100644 --- a/generator/internal/descriptor_utils.cc +++ b/generator/internal/descriptor_utils.cc @@ -725,6 +725,10 @@ VarsDictionary CreateServiceVars( vars["logging_rest_header_path"] = absl::StrCat( vars["product_path"], "internal/", ServiceNameToFilePath(service_name), "_rest_logging_decorator.h"); + vars["merge_options_fn"] = + absl::StartsWithIgnoreCase(service_name, "Bigtable") + ? "bigtable_internal::MergeOptions" + : "internal::MergeOptions"; vars["metadata_class_name"] = absl::StrCat(service_name, "Metadata"); vars["metadata_cc_path"] = absl::StrCat(vars["product_path"], "internal/", ServiceNameToFilePath(service_name), diff --git a/google/cloud/bigtable/admin/bigtable_instance_admin_client.cc b/google/cloud/bigtable/admin/bigtable_instance_admin_client.cc index c1b9646b7c68e..2e6c5990212e2 100644 --- a/google/cloud/bigtable/admin/bigtable_instance_admin_client.cc +++ b/google/cloud/bigtable/admin/bigtable_instance_admin_client.cc @@ -18,6 +18,7 @@ #include "google/cloud/bigtable/admin/bigtable_instance_admin_client.h" #include "google/cloud/bigtable/admin/bigtable_instance_admin_options.h" +#include "google/cloud/bigtable/options.h" #include #include #include @@ -30,8 +31,8 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN BigtableInstanceAdminClient::BigtableInstanceAdminClient( std::shared_ptr connection, Options opts) : connection_(std::move(connection)), - options_( - internal::MergeOptions(std::move(opts), connection_->options())) {} + options_(bigtable_internal::MergeOptions(std::move(opts), + connection_->options())) {} BigtableInstanceAdminClient::~BigtableInstanceAdminClient() = default; future> @@ -40,7 +41,8 @@ BigtableInstanceAdminClient::CreateInstance( google::bigtable::admin::v2::Instance const& instance, std::map const& clusters, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateInstanceRequest request; request.set_parent(parent); request.set_instance_id(instance_id); @@ -55,7 +57,8 @@ BigtableInstanceAdminClient::CreateInstance( google::bigtable::admin::v2::Instance const& instance, std::map const& clusters, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateInstanceRequest request; request.set_parent(parent); request.set_instance_id(instance_id); @@ -68,7 +71,8 @@ future> BigtableInstanceAdminClient::CreateInstance( google::bigtable::admin::v2::CreateInstanceRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateInstance(request); } @@ -77,21 +81,24 @@ BigtableInstanceAdminClient::CreateInstance( NoAwaitTag, google::bigtable::admin::v2::CreateInstanceRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateInstance(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::CreateInstance( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateInstance(operation); } StatusOr BigtableInstanceAdminClient::GetInstance(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetInstanceRequest request; request.set_name(name); return connection_->GetInstance(request); @@ -101,14 +108,16 @@ StatusOr BigtableInstanceAdminClient::GetInstance( google::bigtable::admin::v2::GetInstanceRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetInstance(request); } StatusOr BigtableInstanceAdminClient::ListInstances(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListInstancesRequest request; request.set_parent(parent); return connection_->ListInstances(request); @@ -118,14 +127,16 @@ StatusOr BigtableInstanceAdminClient::ListInstances( google::bigtable::admin::v2::ListInstancesRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListInstances(request); } StatusOr BigtableInstanceAdminClient::UpdateInstance( google::bigtable::admin::v2::Instance const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateInstance(request); } @@ -133,7 +144,8 @@ future> BigtableInstanceAdminClient::PartialUpdateInstance( google::bigtable::admin::v2::Instance const& instance, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::PartialUpdateInstanceRequest request; *request.mutable_instance() = instance; *request.mutable_update_mask() = update_mask; @@ -144,7 +156,8 @@ StatusOr BigtableInstanceAdminClient::PartialUpdateInstance( NoAwaitTag, google::bigtable::admin::v2::Instance const& instance, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::PartialUpdateInstanceRequest request; *request.mutable_instance() = instance; *request.mutable_update_mask() = update_mask; @@ -155,7 +168,8 @@ future> BigtableInstanceAdminClient::PartialUpdateInstance( google::bigtable::admin::v2::PartialUpdateInstanceRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->PartialUpdateInstance(request); } @@ -164,20 +178,23 @@ BigtableInstanceAdminClient::PartialUpdateInstance( NoAwaitTag, google::bigtable::admin::v2::PartialUpdateInstanceRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->PartialUpdateInstance(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::PartialUpdateInstance( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->PartialUpdateInstance(operation); } Status BigtableInstanceAdminClient::DeleteInstance(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteInstanceRequest request; request.set_name(name); return connection_->DeleteInstance(request); @@ -186,7 +203,8 @@ Status BigtableInstanceAdminClient::DeleteInstance(std::string const& name, Status BigtableInstanceAdminClient::DeleteInstance( google::bigtable::admin::v2::DeleteInstanceRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteInstance(request); } @@ -194,7 +212,8 @@ future> BigtableInstanceAdminClient::CreateCluster( std::string const& parent, std::string const& cluster_id, google::bigtable::admin::v2::Cluster const& cluster, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateClusterRequest request; request.set_parent(parent); request.set_cluster_id(cluster_id); @@ -206,7 +225,8 @@ StatusOr BigtableInstanceAdminClient::CreateCluster( NoAwaitTag, std::string const& parent, std::string const& cluster_id, google::bigtable::admin::v2::Cluster const& cluster, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateClusterRequest request; request.set_parent(parent); request.set_cluster_id(cluster_id); @@ -218,7 +238,8 @@ future> BigtableInstanceAdminClient::CreateCluster( google::bigtable::admin::v2::CreateClusterRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateCluster(request); } @@ -227,20 +248,23 @@ BigtableInstanceAdminClient::CreateCluster( NoAwaitTag, google::bigtable::admin::v2::CreateClusterRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateCluster(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::CreateCluster( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateCluster(operation); } StatusOr BigtableInstanceAdminClient::GetCluster(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetClusterRequest request; request.set_name(name); return connection_->GetCluster(request); @@ -250,14 +274,16 @@ StatusOr BigtableInstanceAdminClient::GetCluster( google::bigtable::admin::v2::GetClusterRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetCluster(request); } StatusOr BigtableInstanceAdminClient::ListClusters(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListClustersRequest request; request.set_parent(parent); return connection_->ListClusters(request); @@ -267,14 +293,16 @@ StatusOr BigtableInstanceAdminClient::ListClusters( google::bigtable::admin::v2::ListClustersRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListClusters(request); } future> BigtableInstanceAdminClient::UpdateCluster( google::bigtable::admin::v2::Cluster const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateCluster(request); } @@ -282,14 +310,16 @@ StatusOr BigtableInstanceAdminClient::UpdateCluster( NoAwaitTag, google::bigtable::admin::v2::Cluster const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateCluster(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::UpdateCluster( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateCluster(operation); } @@ -297,7 +327,8 @@ future> BigtableInstanceAdminClient::PartialUpdateCluster( google::bigtable::admin::v2::Cluster const& cluster, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::PartialUpdateClusterRequest request; *request.mutable_cluster() = cluster; *request.mutable_update_mask() = update_mask; @@ -308,7 +339,8 @@ StatusOr BigtableInstanceAdminClient::PartialUpdateCluster( NoAwaitTag, google::bigtable::admin::v2::Cluster const& cluster, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::PartialUpdateClusterRequest request; *request.mutable_cluster() = cluster; *request.mutable_update_mask() = update_mask; @@ -319,7 +351,8 @@ future> BigtableInstanceAdminClient::PartialUpdateCluster( google::bigtable::admin::v2::PartialUpdateClusterRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->PartialUpdateCluster(request); } @@ -328,20 +361,23 @@ BigtableInstanceAdminClient::PartialUpdateCluster( NoAwaitTag, google::bigtable::admin::v2::PartialUpdateClusterRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->PartialUpdateCluster(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::PartialUpdateCluster( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->PartialUpdateCluster(operation); } Status BigtableInstanceAdminClient::DeleteCluster(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteClusterRequest request; request.set_name(name); return connection_->DeleteCluster(request); @@ -350,7 +386,8 @@ Status BigtableInstanceAdminClient::DeleteCluster(std::string const& name, Status BigtableInstanceAdminClient::DeleteCluster( google::bigtable::admin::v2::DeleteClusterRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteCluster(request); } @@ -358,7 +395,8 @@ StatusOr BigtableInstanceAdminClient::CreateAppProfile( std::string const& parent, std::string const& app_profile_id, google::bigtable::admin::v2::AppProfile const& app_profile, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateAppProfileRequest request; request.set_parent(parent); request.set_app_profile_id(app_profile_id); @@ -370,14 +408,16 @@ StatusOr BigtableInstanceAdminClient::CreateAppProfile( google::bigtable::admin::v2::CreateAppProfileRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateAppProfile(request); } StatusOr BigtableInstanceAdminClient::GetAppProfile(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetAppProfileRequest request; request.set_name(name); return connection_->GetAppProfile(request); @@ -387,14 +427,16 @@ StatusOr BigtableInstanceAdminClient::GetAppProfile( google::bigtable::admin::v2::GetAppProfileRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetAppProfile(request); } StreamRange BigtableInstanceAdminClient::ListAppProfiles(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListAppProfilesRequest request; request.set_parent(parent); return connection_->ListAppProfiles(request); @@ -403,7 +445,8 @@ BigtableInstanceAdminClient::ListAppProfiles(std::string const& parent, StreamRange BigtableInstanceAdminClient::ListAppProfiles( google::bigtable::admin::v2::ListAppProfilesRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListAppProfiles(std::move(request)); } @@ -411,7 +454,8 @@ future> BigtableInstanceAdminClient::UpdateAppProfile( google::bigtable::admin::v2::AppProfile const& app_profile, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateAppProfileRequest request; *request.mutable_app_profile() = app_profile; *request.mutable_update_mask() = update_mask; @@ -422,7 +466,8 @@ StatusOr BigtableInstanceAdminClient::UpdateAppProfile( NoAwaitTag, google::bigtable::admin::v2::AppProfile const& app_profile, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateAppProfileRequest request; *request.mutable_app_profile() = app_profile; *request.mutable_update_mask() = update_mask; @@ -433,7 +478,8 @@ future> BigtableInstanceAdminClient::UpdateAppProfile( google::bigtable::admin::v2::UpdateAppProfileRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateAppProfile(request); } @@ -442,21 +488,24 @@ BigtableInstanceAdminClient::UpdateAppProfile( NoAwaitTag, google::bigtable::admin::v2::UpdateAppProfileRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateAppProfile(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::UpdateAppProfile( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateAppProfile(operation); } Status BigtableInstanceAdminClient::DeleteAppProfile(std::string const& name, bool ignore_warnings, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteAppProfileRequest request; request.set_name(name); request.set_ignore_warnings(ignore_warnings); @@ -466,13 +515,15 @@ Status BigtableInstanceAdminClient::DeleteAppProfile(std::string const& name, Status BigtableInstanceAdminClient::DeleteAppProfile( google::bigtable::admin::v2::DeleteAppProfileRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteAppProfile(request); } StatusOr BigtableInstanceAdminClient::GetIamPolicy( std::string const& resource, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::GetIamPolicyRequest request; request.set_resource(resource); return connection_->GetIamPolicy(request); @@ -480,14 +531,16 @@ StatusOr BigtableInstanceAdminClient::GetIamPolicy( StatusOr BigtableInstanceAdminClient::GetIamPolicy( google::iam::v1::GetIamPolicyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetIamPolicy(request); } StatusOr BigtableInstanceAdminClient::SetIamPolicy( std::string const& resource, google::iam::v1::Policy const& policy, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::SetIamPolicyRequest request; request.set_resource(resource); *request.mutable_policy() = policy; @@ -498,7 +551,8 @@ StatusOr BigtableInstanceAdminClient::SetIamPolicy( std::string const& resource, IamUpdater const& updater, Options opts) { internal::CheckExpectedOptions( opts, __func__); - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::GetIamPolicyRequest get_request; get_request.set_resource(resource); google::iam::v1::SetIamPolicyRequest set_request; @@ -531,7 +585,8 @@ StatusOr BigtableInstanceAdminClient::SetIamPolicy( StatusOr BigtableInstanceAdminClient::SetIamPolicy( google::iam::v1::SetIamPolicyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->SetIamPolicy(request); } @@ -539,7 +594,8 @@ StatusOr BigtableInstanceAdminClient::TestIamPermissions( std::string const& resource, std::vector const& permissions, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::TestIamPermissionsRequest request; request.set_resource(resource); *request.mutable_permissions() = {permissions.begin(), permissions.end()}; @@ -549,14 +605,16 @@ BigtableInstanceAdminClient::TestIamPermissions( StatusOr BigtableInstanceAdminClient::TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->TestIamPermissions(request); } StreamRange BigtableInstanceAdminClient::ListHotTablets(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListHotTabletsRequest request; request.set_parent(parent); return connection_->ListHotTablets(request); @@ -565,7 +623,8 @@ BigtableInstanceAdminClient::ListHotTablets(std::string const& parent, StreamRange BigtableInstanceAdminClient::ListHotTablets( google::bigtable::admin::v2::ListHotTabletsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListHotTablets(std::move(request)); } @@ -574,7 +633,8 @@ BigtableInstanceAdminClient::CreateLogicalView( std::string const& parent, google::bigtable::admin::v2::LogicalView const& logical_view, std::string const& logical_view_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateLogicalViewRequest request; request.set_parent(parent); *request.mutable_logical_view() = logical_view; @@ -587,7 +647,8 @@ BigtableInstanceAdminClient::CreateLogicalView( NoAwaitTag, std::string const& parent, google::bigtable::admin::v2::LogicalView const& logical_view, std::string const& logical_view_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateLogicalViewRequest request; request.set_parent(parent); *request.mutable_logical_view() = logical_view; @@ -599,7 +660,8 @@ future> BigtableInstanceAdminClient::CreateLogicalView( google::bigtable::admin::v2::CreateLogicalViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateLogicalView(request); } @@ -608,21 +670,24 @@ BigtableInstanceAdminClient::CreateLogicalView( NoAwaitTag, google::bigtable::admin::v2::CreateLogicalViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateLogicalView(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::CreateLogicalView( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateLogicalView(operation); } StatusOr BigtableInstanceAdminClient::GetLogicalView(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetLogicalViewRequest request; request.set_name(name); return connection_->GetLogicalView(request); @@ -632,14 +697,16 @@ StatusOr BigtableInstanceAdminClient::GetLogicalView( google::bigtable::admin::v2::GetLogicalViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetLogicalView(request); } StreamRange BigtableInstanceAdminClient::ListLogicalViews(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListLogicalViewsRequest request; request.set_parent(parent); return connection_->ListLogicalViews(request); @@ -649,7 +716,8 @@ StreamRange BigtableInstanceAdminClient::ListLogicalViews( google::bigtable::admin::v2::ListLogicalViewsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListLogicalViews(std::move(request)); } @@ -657,7 +725,8 @@ future> BigtableInstanceAdminClient::UpdateLogicalView( google::bigtable::admin::v2::LogicalView const& logical_view, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateLogicalViewRequest request; *request.mutable_logical_view() = logical_view; *request.mutable_update_mask() = update_mask; @@ -668,7 +737,8 @@ StatusOr BigtableInstanceAdminClient::UpdateLogicalView( NoAwaitTag, google::bigtable::admin::v2::LogicalView const& logical_view, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateLogicalViewRequest request; *request.mutable_logical_view() = logical_view; *request.mutable_update_mask() = update_mask; @@ -679,7 +749,8 @@ future> BigtableInstanceAdminClient::UpdateLogicalView( google::bigtable::admin::v2::UpdateLogicalViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateLogicalView(request); } @@ -688,20 +759,23 @@ BigtableInstanceAdminClient::UpdateLogicalView( NoAwaitTag, google::bigtable::admin::v2::UpdateLogicalViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateLogicalView(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::UpdateLogicalView( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateLogicalView(operation); } Status BigtableInstanceAdminClient::DeleteLogicalView(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteLogicalViewRequest request; request.set_name(name); return connection_->DeleteLogicalView(request); @@ -710,7 +784,8 @@ Status BigtableInstanceAdminClient::DeleteLogicalView(std::string const& name, Status BigtableInstanceAdminClient::DeleteLogicalView( google::bigtable::admin::v2::DeleteLogicalViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteLogicalView(request); } @@ -719,7 +794,8 @@ BigtableInstanceAdminClient::CreateMaterializedView( std::string const& parent, google::bigtable::admin::v2::MaterializedView const& materialized_view, std::string const& materialized_view_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateMaterializedViewRequest request; request.set_parent(parent); *request.mutable_materialized_view() = materialized_view; @@ -732,7 +808,8 @@ BigtableInstanceAdminClient::CreateMaterializedView( NoAwaitTag, std::string const& parent, google::bigtable::admin::v2::MaterializedView const& materialized_view, std::string const& materialized_view_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateMaterializedViewRequest request; request.set_parent(parent); *request.mutable_materialized_view() = materialized_view; @@ -744,7 +821,8 @@ future> BigtableInstanceAdminClient::CreateMaterializedView( google::bigtable::admin::v2::CreateMaterializedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateMaterializedView(request); } @@ -753,21 +831,24 @@ BigtableInstanceAdminClient::CreateMaterializedView( NoAwaitTag, google::bigtable::admin::v2::CreateMaterializedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateMaterializedView(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::CreateMaterializedView( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateMaterializedView(operation); } StatusOr BigtableInstanceAdminClient::GetMaterializedView(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetMaterializedViewRequest request; request.set_name(name); return connection_->GetMaterializedView(request); @@ -777,14 +858,16 @@ StatusOr BigtableInstanceAdminClient::GetMaterializedView( google::bigtable::admin::v2::GetMaterializedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetMaterializedView(request); } StreamRange BigtableInstanceAdminClient::ListMaterializedViews(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListMaterializedViewsRequest request; request.set_parent(parent); return connection_->ListMaterializedViews(request); @@ -794,7 +877,8 @@ StreamRange BigtableInstanceAdminClient::ListMaterializedViews( google::bigtable::admin::v2::ListMaterializedViewsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListMaterializedViews(std::move(request)); } @@ -802,7 +886,8 @@ future> BigtableInstanceAdminClient::UpdateMaterializedView( google::bigtable::admin::v2::MaterializedView const& materialized_view, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateMaterializedViewRequest request; *request.mutable_materialized_view() = materialized_view; *request.mutable_update_mask() = update_mask; @@ -814,7 +899,8 @@ BigtableInstanceAdminClient::UpdateMaterializedView( NoAwaitTag, google::bigtable::admin::v2::MaterializedView const& materialized_view, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateMaterializedViewRequest request; *request.mutable_materialized_view() = materialized_view; *request.mutable_update_mask() = update_mask; @@ -825,7 +911,8 @@ future> BigtableInstanceAdminClient::UpdateMaterializedView( google::bigtable::admin::v2::UpdateMaterializedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateMaterializedView(request); } @@ -834,20 +921,23 @@ BigtableInstanceAdminClient::UpdateMaterializedView( NoAwaitTag, google::bigtable::admin::v2::UpdateMaterializedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateMaterializedView(NoAwaitTag{}, request); } future> BigtableInstanceAdminClient::UpdateMaterializedView( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateMaterializedView(operation); } Status BigtableInstanceAdminClient::DeleteMaterializedView( std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteMaterializedViewRequest request; request.set_name(name); return connection_->DeleteMaterializedView(request); @@ -856,7 +946,8 @@ Status BigtableInstanceAdminClient::DeleteMaterializedView( Status BigtableInstanceAdminClient::DeleteMaterializedView( google::bigtable::admin::v2::DeleteMaterializedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteMaterializedView(request); } diff --git a/google/cloud/bigtable/admin/bigtable_table_admin_client.cc b/google/cloud/bigtable/admin/bigtable_table_admin_client.cc index 347aa10bba977..5a710b59ab279 100644 --- a/google/cloud/bigtable/admin/bigtable_table_admin_client.cc +++ b/google/cloud/bigtable/admin/bigtable_table_admin_client.cc @@ -18,6 +18,7 @@ #include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" #include "google/cloud/bigtable/admin/bigtable_table_admin_options.h" +#include "google/cloud/bigtable/options.h" #include #include #include @@ -30,15 +31,16 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN BigtableTableAdminClient::BigtableTableAdminClient( std::shared_ptr connection, Options opts) : connection_(std::move(connection)), - options_( - internal::MergeOptions(std::move(opts), connection_->options())) {} + options_(bigtable_internal::MergeOptions(std::move(opts), + connection_->options())) {} BigtableTableAdminClient::~BigtableTableAdminClient() = default; StatusOr BigtableTableAdminClient::CreateTable( std::string const& parent, std::string const& table_id, google::bigtable::admin::v2::Table const& table, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateTableRequest request; request.set_parent(parent); request.set_table_id(table_id); @@ -50,13 +52,15 @@ StatusOr BigtableTableAdminClient::CreateTable( google::bigtable::admin::v2::CreateTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateTable(request); } StreamRange BigtableTableAdminClient::ListTables(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListTablesRequest request; request.set_parent(parent); return connection_->ListTables(request); @@ -65,13 +69,15 @@ BigtableTableAdminClient::ListTables(std::string const& parent, Options opts) { StreamRange BigtableTableAdminClient::ListTables( google::bigtable::admin::v2::ListTablesRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListTables(std::move(request)); } StatusOr BigtableTableAdminClient::GetTable( std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetTableRequest request; request.set_name(name); return connection_->GetTable(request); @@ -79,7 +85,8 @@ StatusOr BigtableTableAdminClient::GetTable( StatusOr BigtableTableAdminClient::GetTable( google::bigtable::admin::v2::GetTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetTable(request); } @@ -87,7 +94,8 @@ future> BigtableTableAdminClient::UpdateTable( google::bigtable::admin::v2::Table const& table, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateTableRequest request; *request.mutable_table() = table; *request.mutable_update_mask() = update_mask; @@ -97,7 +105,8 @@ BigtableTableAdminClient::UpdateTable( StatusOr BigtableTableAdminClient::UpdateTable( NoAwaitTag, google::bigtable::admin::v2::Table const& table, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateTableRequest request; *request.mutable_table() = table; *request.mutable_update_mask() = update_mask; @@ -108,27 +117,31 @@ future> BigtableTableAdminClient::UpdateTable( google::bigtable::admin::v2::UpdateTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateTable(request); } StatusOr BigtableTableAdminClient::UpdateTable( NoAwaitTag, google::bigtable::admin::v2::UpdateTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateTable(NoAwaitTag{}, request); } future> BigtableTableAdminClient::UpdateTable( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateTable(operation); } Status BigtableTableAdminClient::DeleteTable(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteTableRequest request; request.set_name(name); return connection_->DeleteTable(request); @@ -137,13 +150,15 @@ Status BigtableTableAdminClient::DeleteTable(std::string const& name, Status BigtableTableAdminClient::DeleteTable( google::bigtable::admin::v2::DeleteTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteTable(request); } future> BigtableTableAdminClient::UndeleteTable(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UndeleteTableRequest request; request.set_name(name); return connection_->UndeleteTable(request); @@ -152,7 +167,8 @@ BigtableTableAdminClient::UndeleteTable(std::string const& name, Options opts) { StatusOr BigtableTableAdminClient::UndeleteTable(NoAwaitTag, std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UndeleteTableRequest request; request.set_name(name); return connection_->UndeleteTable(NoAwaitTag{}, request); @@ -162,7 +178,8 @@ future> BigtableTableAdminClient::UndeleteTable( google::bigtable::admin::v2::UndeleteTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UndeleteTable(request); } @@ -171,14 +188,16 @@ BigtableTableAdminClient::UndeleteTable( NoAwaitTag, google::bigtable::admin::v2::UndeleteTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UndeleteTable(NoAwaitTag{}, request); } future> BigtableTableAdminClient::UndeleteTable( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UndeleteTable(operation); } @@ -187,7 +206,8 @@ BigtableTableAdminClient::CreateAuthorizedView( std::string const& parent, google::bigtable::admin::v2::AuthorizedView const& authorized_view, std::string const& authorized_view_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateAuthorizedViewRequest request; request.set_parent(parent); *request.mutable_authorized_view() = authorized_view; @@ -200,7 +220,8 @@ BigtableTableAdminClient::CreateAuthorizedView( NoAwaitTag, std::string const& parent, google::bigtable::admin::v2::AuthorizedView const& authorized_view, std::string const& authorized_view_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateAuthorizedViewRequest request; request.set_parent(parent); *request.mutable_authorized_view() = authorized_view; @@ -212,7 +233,8 @@ future> BigtableTableAdminClient::CreateAuthorizedView( google::bigtable::admin::v2::CreateAuthorizedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateAuthorizedView(request); } @@ -221,21 +243,24 @@ BigtableTableAdminClient::CreateAuthorizedView( NoAwaitTag, google::bigtable::admin::v2::CreateAuthorizedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateAuthorizedView(NoAwaitTag{}, request); } future> BigtableTableAdminClient::CreateAuthorizedView( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateAuthorizedView(operation); } StreamRange BigtableTableAdminClient::ListAuthorizedViews(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListAuthorizedViewsRequest request; request.set_parent(parent); return connection_->ListAuthorizedViews(request); @@ -245,14 +270,16 @@ StreamRange BigtableTableAdminClient::ListAuthorizedViews( google::bigtable::admin::v2::ListAuthorizedViewsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListAuthorizedViews(std::move(request)); } StatusOr BigtableTableAdminClient::GetAuthorizedView(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetAuthorizedViewRequest request; request.set_name(name); return connection_->GetAuthorizedView(request); @@ -262,7 +289,8 @@ StatusOr BigtableTableAdminClient::GetAuthorizedView( google::bigtable::admin::v2::GetAuthorizedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetAuthorizedView(request); } @@ -270,7 +298,8 @@ future> BigtableTableAdminClient::UpdateAuthorizedView( google::bigtable::admin::v2::AuthorizedView const& authorized_view, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateAuthorizedViewRequest request; *request.mutable_authorized_view() = authorized_view; *request.mutable_update_mask() = update_mask; @@ -282,7 +311,8 @@ BigtableTableAdminClient::UpdateAuthorizedView( NoAwaitTag, google::bigtable::admin::v2::AuthorizedView const& authorized_view, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateAuthorizedViewRequest request; *request.mutable_authorized_view() = authorized_view; *request.mutable_update_mask() = update_mask; @@ -293,7 +323,8 @@ future> BigtableTableAdminClient::UpdateAuthorizedView( google::bigtable::admin::v2::UpdateAuthorizedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateAuthorizedView(request); } @@ -302,20 +333,23 @@ BigtableTableAdminClient::UpdateAuthorizedView( NoAwaitTag, google::bigtable::admin::v2::UpdateAuthorizedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateAuthorizedView(NoAwaitTag{}, request); } future> BigtableTableAdminClient::UpdateAuthorizedView( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateAuthorizedView(operation); } Status BigtableTableAdminClient::DeleteAuthorizedView(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteAuthorizedViewRequest request; request.set_name(name); return connection_->DeleteAuthorizedView(request); @@ -324,7 +358,8 @@ Status BigtableTableAdminClient::DeleteAuthorizedView(std::string const& name, Status BigtableTableAdminClient::DeleteAuthorizedView( google::bigtable::admin::v2::DeleteAuthorizedViewRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteAuthorizedView(request); } @@ -334,7 +369,8 @@ BigtableTableAdminClient::ModifyColumnFamilies( std::vector const& modifications, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ModifyColumnFamiliesRequest request; request.set_name(name); *request.mutable_modifications() = {modifications.begin(), @@ -346,21 +382,24 @@ StatusOr BigtableTableAdminClient::ModifyColumnFamilies( google::bigtable::admin::v2::ModifyColumnFamiliesRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ModifyColumnFamilies(request); } Status BigtableTableAdminClient::DropRowRange( google::bigtable::admin::v2::DropRowRangeRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DropRowRange(request); } StatusOr BigtableTableAdminClient::GenerateConsistencyToken(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GenerateConsistencyTokenRequest request; request.set_name(name); return connection_->GenerateConsistencyToken(request); @@ -370,7 +409,8 @@ StatusOr BigtableTableAdminClient::GenerateConsistencyToken( google::bigtable::admin::v2::GenerateConsistencyTokenRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GenerateConsistencyToken(request); } @@ -378,7 +418,8 @@ StatusOr BigtableTableAdminClient::CheckConsistency(std::string const& name, std::string const& consistency_token, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CheckConsistencyRequest request; request.set_name(name); request.set_consistency_token(consistency_token); @@ -389,7 +430,8 @@ StatusOr BigtableTableAdminClient::CheckConsistency( google::bigtable::admin::v2::CheckConsistencyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CheckConsistency(request); } @@ -397,7 +439,8 @@ future> BigtableTableAdminClient::CreateBackup( std::string const& parent, std::string const& backup_id, google::bigtable::admin::v2::Backup const& backup, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateBackupRequest request; request.set_parent(parent); request.set_backup_id(backup_id); @@ -408,7 +451,8 @@ BigtableTableAdminClient::CreateBackup( StatusOr BigtableTableAdminClient::CreateBackup( NoAwaitTag, std::string const& parent, std::string const& backup_id, google::bigtable::admin::v2::Backup const& backup, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateBackupRequest request; request.set_parent(parent); request.set_backup_id(backup_id); @@ -420,27 +464,31 @@ future> BigtableTableAdminClient::CreateBackup( google::bigtable::admin::v2::CreateBackupRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateBackup(request); } StatusOr BigtableTableAdminClient::CreateBackup( NoAwaitTag, google::bigtable::admin::v2::CreateBackupRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateBackup(NoAwaitTag{}, request); } future> BigtableTableAdminClient::CreateBackup( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateBackup(operation); } StatusOr BigtableTableAdminClient::GetBackup(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetBackupRequest request; request.set_name(name); return connection_->GetBackup(request); @@ -450,7 +498,8 @@ StatusOr BigtableTableAdminClient::GetBackup( google::bigtable::admin::v2::GetBackupRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetBackup(request); } @@ -458,7 +507,8 @@ StatusOr BigtableTableAdminClient::UpdateBackup( google::bigtable::admin::v2::Backup const& backup, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateBackupRequest request; *request.mutable_backup() = backup; *request.mutable_update_mask() = update_mask; @@ -469,13 +519,15 @@ StatusOr BigtableTableAdminClient::UpdateBackup( google::bigtable::admin::v2::UpdateBackupRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateBackup(request); } Status BigtableTableAdminClient::DeleteBackup(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteBackupRequest request; request.set_name(name); return connection_->DeleteBackup(request); @@ -484,13 +536,15 @@ Status BigtableTableAdminClient::DeleteBackup(std::string const& name, Status BigtableTableAdminClient::DeleteBackup( google::bigtable::admin::v2::DeleteBackupRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteBackup(request); } StreamRange BigtableTableAdminClient::ListBackups(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListBackupsRequest request; request.set_parent(parent); return connection_->ListBackups(request); @@ -499,7 +553,8 @@ BigtableTableAdminClient::ListBackups(std::string const& parent, Options opts) { StreamRange BigtableTableAdminClient::ListBackups( google::bigtable::admin::v2::ListBackupsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListBackups(std::move(request)); } @@ -507,21 +562,24 @@ future> BigtableTableAdminClient::RestoreTable( google::bigtable::admin::v2::RestoreTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->RestoreTable(request); } StatusOr BigtableTableAdminClient::RestoreTable( NoAwaitTag, google::bigtable::admin::v2::RestoreTableRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->RestoreTable(NoAwaitTag{}, request); } future> BigtableTableAdminClient::RestoreTable( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->RestoreTable(operation); } @@ -530,7 +588,8 @@ BigtableTableAdminClient::CopyBackup( std::string const& parent, std::string const& backup_id, std::string const& source_backup, google::protobuf::Timestamp const& expire_time, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CopyBackupRequest request; request.set_parent(parent); request.set_backup_id(backup_id); @@ -543,7 +602,8 @@ StatusOr BigtableTableAdminClient::CopyBackup( NoAwaitTag, std::string const& parent, std::string const& backup_id, std::string const& source_backup, google::protobuf::Timestamp const& expire_time, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CopyBackupRequest request; request.set_parent(parent); request.set_backup_id(backup_id); @@ -556,27 +616,31 @@ future> BigtableTableAdminClient::CopyBackup( google::bigtable::admin::v2::CopyBackupRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CopyBackup(request); } StatusOr BigtableTableAdminClient::CopyBackup( NoAwaitTag, google::bigtable::admin::v2::CopyBackupRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CopyBackup(NoAwaitTag{}, request); } future> BigtableTableAdminClient::CopyBackup( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CopyBackup(operation); } StatusOr BigtableTableAdminClient::GetIamPolicy( std::string const& resource, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::GetIamPolicyRequest request; request.set_resource(resource); return connection_->GetIamPolicy(request); @@ -584,14 +648,16 @@ StatusOr BigtableTableAdminClient::GetIamPolicy( StatusOr BigtableTableAdminClient::GetIamPolicy( google::iam::v1::GetIamPolicyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetIamPolicy(request); } StatusOr BigtableTableAdminClient::SetIamPolicy( std::string const& resource, google::iam::v1::Policy const& policy, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::SetIamPolicyRequest request; request.set_resource(resource); *request.mutable_policy() = policy; @@ -602,7 +668,8 @@ StatusOr BigtableTableAdminClient::SetIamPolicy( std::string const& resource, IamUpdater const& updater, Options opts) { internal::CheckExpectedOptions( opts, __func__); - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::GetIamPolicyRequest get_request; get_request.set_resource(resource); google::iam::v1::SetIamPolicyRequest set_request; @@ -635,7 +702,8 @@ StatusOr BigtableTableAdminClient::SetIamPolicy( StatusOr BigtableTableAdminClient::SetIamPolicy( google::iam::v1::SetIamPolicyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->SetIamPolicy(request); } @@ -643,7 +711,8 @@ StatusOr BigtableTableAdminClient::TestIamPermissions( std::string const& resource, std::vector const& permissions, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::iam::v1::TestIamPermissionsRequest request; request.set_resource(resource); *request.mutable_permissions() = {permissions.begin(), permissions.end()}; @@ -653,7 +722,8 @@ BigtableTableAdminClient::TestIamPermissions( StatusOr BigtableTableAdminClient::TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->TestIamPermissions(request); } @@ -662,7 +732,8 @@ BigtableTableAdminClient::CreateSchemaBundle( std::string const& parent, std::string const& schema_bundle_id, google::bigtable::admin::v2::SchemaBundle const& schema_bundle, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateSchemaBundleRequest request; request.set_parent(parent); request.set_schema_bundle_id(schema_bundle_id); @@ -675,7 +746,8 @@ BigtableTableAdminClient::CreateSchemaBundle( NoAwaitTag, std::string const& parent, std::string const& schema_bundle_id, google::bigtable::admin::v2::SchemaBundle const& schema_bundle, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CreateSchemaBundleRequest request; request.set_parent(parent); request.set_schema_bundle_id(schema_bundle_id); @@ -687,7 +759,8 @@ future> BigtableTableAdminClient::CreateSchemaBundle( google::bigtable::admin::v2::CreateSchemaBundleRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateSchemaBundle(request); } @@ -696,14 +769,16 @@ BigtableTableAdminClient::CreateSchemaBundle( NoAwaitTag, google::bigtable::admin::v2::CreateSchemaBundleRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateSchemaBundle(NoAwaitTag{}, request); } future> BigtableTableAdminClient::CreateSchemaBundle( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->CreateSchemaBundle(operation); } @@ -711,7 +786,8 @@ future> BigtableTableAdminClient::UpdateSchemaBundle( google::bigtable::admin::v2::SchemaBundle const& schema_bundle, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateSchemaBundleRequest request; *request.mutable_schema_bundle() = schema_bundle; *request.mutable_update_mask() = update_mask; @@ -722,7 +798,8 @@ StatusOr BigtableTableAdminClient::UpdateSchemaBundle( NoAwaitTag, google::bigtable::admin::v2::SchemaBundle const& schema_bundle, google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::UpdateSchemaBundleRequest request; *request.mutable_schema_bundle() = schema_bundle; *request.mutable_update_mask() = update_mask; @@ -733,7 +810,8 @@ future> BigtableTableAdminClient::UpdateSchemaBundle( google::bigtable::admin::v2::UpdateSchemaBundleRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateSchemaBundle(request); } @@ -742,21 +820,24 @@ BigtableTableAdminClient::UpdateSchemaBundle( NoAwaitTag, google::bigtable::admin::v2::UpdateSchemaBundleRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateSchemaBundle(NoAwaitTag{}, request); } future> BigtableTableAdminClient::UpdateSchemaBundle( google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->UpdateSchemaBundle(operation); } StatusOr BigtableTableAdminClient::GetSchemaBundle(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::GetSchemaBundleRequest request; request.set_name(name); return connection_->GetSchemaBundle(request); @@ -766,14 +847,16 @@ StatusOr BigtableTableAdminClient::GetSchemaBundle( google::bigtable::admin::v2::GetSchemaBundleRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->GetSchemaBundle(request); } StreamRange BigtableTableAdminClient::ListSchemaBundles(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::ListSchemaBundlesRequest request; request.set_parent(parent); return connection_->ListSchemaBundles(request); @@ -783,13 +866,15 @@ StreamRange BigtableTableAdminClient::ListSchemaBundles( google::bigtable::admin::v2::ListSchemaBundlesRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->ListSchemaBundles(std::move(request)); } Status BigtableTableAdminClient::DeleteSchemaBundle(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::DeleteSchemaBundleRequest request; request.set_name(name); return connection_->DeleteSchemaBundle(request); @@ -798,7 +883,8 @@ Status BigtableTableAdminClient::DeleteSchemaBundle(std::string const& name, Status BigtableTableAdminClient::DeleteSchemaBundle( google::bigtable::admin::v2::DeleteSchemaBundleRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->DeleteSchemaBundle(request); } @@ -806,7 +892,8 @@ future> BigtableTableAdminClient::AsyncCheckConsistency( std::string const& name, std::string const& consistency_token, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); google::bigtable::admin::v2::CheckConsistencyRequest request; request.set_name(name); request.set_consistency_token(consistency_token); @@ -817,7 +904,8 @@ future> BigtableTableAdminClient::AsyncCheckConsistency( google::bigtable::admin::v2::CheckConsistencyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->AsyncCheckConsistency(request); } @@ -825,7 +913,8 @@ future> BigtableTableAdminClient::WaitForConsistency( google::bigtable::admin::v2::CheckConsistencyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + internal::OptionsSpan span( + bigtable_internal::MergeOptions(std::move(opts), options_)); return connection_->WaitForConsistency(request); }