From 692b8421bc53d820deb5f3456498d7e7e3b6cb8f Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Sun, 20 Sep 2026 11:15:40 -0400 Subject: [PATCH 1/3] feat: add OperationContext base class and refactor bigtable --- .../bigtable/internal/operation_context.h | 9 +-- .../bigtable/testing/mock_bigtable_stub.h | 1 + google/cloud/google_cloud_cpp_grpc_utils.bzl | 1 + .../cloud/google_cloud_cpp_grpc_utils.cmake | 1 + google/cloud/internal/operation_context.h | 62 +++++++++++++++++++ 5 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 google/cloud/internal/operation_context.h diff --git a/google/cloud/bigtable/internal/operation_context.h b/google/cloud/bigtable/internal/operation_context.h index 739f34242671e..f58291409c78e 100644 --- a/google/cloud/bigtable/internal/operation_context.h +++ b/google/cloud/bigtable/internal/operation_context.h @@ -17,6 +17,7 @@ #include "google/cloud/bigtable/version.h" #include "google/cloud/internal/clock.h" +#include "google/cloud/internal/operation_context.h" #include "google/cloud/status.h" #include #include @@ -56,7 +57,7 @@ class Metric; * } * @endcode */ -class OperationContext { +class OperationContext : public ::google::cloud::internal::OperationContext { public: using Clock = ::google::cloud::internal::SteadyClock; @@ -69,12 +70,12 @@ class OperationContext { // Called when a stub is selected from a channel pool. void StubSelection(StubSelectionParams const& params); // Called before each RPC attempt. - void PreCall(grpc::ClientContext& client_context); + void PreCall(grpc::ClientContext& client_context) override; // Called after receiving RPC attempt response. void PostCall(grpc::ClientContext const& client_context, - google::cloud::Status const& status); + google::cloud::Status const& status) override; // A hook that executes at the end of a client operation. - void OnDone(Status const& status); + void OnDone(Status const& status) override; // Called during operations that allow the user to iterate over data // synchronously or asynchronously. void ElementRequest(grpc::ClientContext const& client_context); diff --git a/google/cloud/bigtable/testing/mock_bigtable_stub.h b/google/cloud/bigtable/testing/mock_bigtable_stub.h index 8bd14c9beb11a..3a3b39dddbd2c 100644 --- a/google/cloud/bigtable/testing/mock_bigtable_stub.h +++ b/google/cloud/bigtable/testing/mock_bigtable_stub.h @@ -16,6 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_BIGTABLE_STUB_H #include "google/cloud/bigtable/internal/bigtable_stub.h" +#include "google/cloud/bigtable/internal/operation_context.h" #include "google/cloud/testing_util/mock_async_streaming_read_rpc.h" #include diff --git a/google/cloud/google_cloud_cpp_grpc_utils.bzl b/google/cloud/google_cloud_cpp_grpc_utils.bzl index d565700024f2c..193036f6510a9 100644 --- a/google/cloud/google_cloud_cpp_grpc_utils.bzl +++ b/google/cloud/google_cloud_cpp_grpc_utils.bzl @@ -67,6 +67,7 @@ google_cloud_cpp_grpc_utils_hdrs = [ "internal/grpc_service_account_authentication.h", "internal/log_wrapper.h", "internal/minimal_iam_credentials_stub.h", + "internal/operation_context.h", "internal/populate_grpc_options.h", "internal/resumable_streaming_read_rpc.h", "internal/retry_loop.h", diff --git a/google/cloud/google_cloud_cpp_grpc_utils.cmake b/google/cloud/google_cloud_cpp_grpc_utils.cmake index adb6674fa42e9..10c9c3f509706 100644 --- a/google/cloud/google_cloud_cpp_grpc_utils.cmake +++ b/google/cloud/google_cloud_cpp_grpc_utils.cmake @@ -89,6 +89,7 @@ add_library( internal/log_wrapper.h internal/minimal_iam_credentials_stub.cc internal/minimal_iam_credentials_stub.h + internal/operation_context.h internal/populate_grpc_options.cc internal/populate_grpc_options.h internal/resumable_streaming_read_rpc.h diff --git a/google/cloud/internal/operation_context.h b/google/cloud/internal/operation_context.h new file mode 100644 index 0000000000000..ed179a99926d6 --- /dev/null +++ b/google/cloud/internal/operation_context.h @@ -0,0 +1,62 @@ +// 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OPERATION_CONTEXT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OPERATION_CONTEXT_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace internal { + +/** + * An abstract base class for service-specific operation contexts across + * retries. + * + * This provides lifecycle hooks (`PreCall`, `PostCall`, `OnDone`) for generated + * stubs and decorators. + */ +class OperationContext { + public: + virtual ~OperationContext() = default; + + // Called before each RPC attempt to inject headers and update state. + virtual void PreCall(grpc::ClientContext& context) = 0; + + // Called after receiving an RPC attempt response. + virtual void PostCall(grpc::ClientContext const& context, + Status const& status) = 0; + + // Called when the overall logical operation completes across all attempts. + virtual void OnDone(Status const& status) = 0; +}; + +class NoopOperationContext : public OperationContext { + public: + ~NoopOperationContext() override = default; + void PreCall(grpc::ClientContext&) override {} + void PostCall(grpc::ClientContext const&, Status const&) override {} + void OnDone(Status const&) override {} +}; + +} // namespace internal +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OPERATION_CONTEXT_H From 8eb74b532fd685a28a1766ff3beb2fe1fb85445a Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Sun, 20 Sep 2026 11:24:25 -0400 Subject: [PATCH 2/3] generator update for OperationContext changes --- generator/generator_config.proto | 5 +++-- generator/generator_config.textproto | 2 +- generator/internal/codegen_utils_test.cc | 8 +++---- generator/internal/descriptor_utils.cc | 22 +++++++++----------- generator/internal/service_code_generator.cc | 4 ++-- generator/internal/service_code_generator.h | 4 ++-- generator/internal/stub_generator.cc | 8 +++---- generator/standalone_main.cc | 4 ++-- 8 files changed, 28 insertions(+), 29 deletions(-) diff --git a/generator/generator_config.proto b/generator/generator_config.proto index 84582f76c40a6..a30dab96e678b 100644 --- a/generator/generator_config.proto +++ b/generator/generator_config.proto @@ -184,8 +184,9 @@ message ServiceConfiguration { repeated BespokeMethod bespoke_methods = 30; // If set to `true`, the stub class methods will include an additional - // parameter of type `google::cloud::bigtable_internal::OperationContext&`. - bool experimental_bigtable_operation_context = 31; + // parameter of type + // `google::cloud::_internal::OperationContext&`. + bool experimental_operation_context = 31; } message DiscoveryDocumentDefinedProduct { diff --git a/generator/generator_config.textproto b/generator/generator_config.textproto index ead53ac05c05b..3018b6cfa0335 100644 --- a/generator/generator_config.textproto +++ b/generator/generator_config.textproto @@ -584,7 +584,7 @@ service { omit_connection: true omit_stub_factory: true generate_round_robin_decorator: true - experimental_bigtable_operation_context: true + experimental_operation_context: true omitted_rpcs: [ "GenerateInitialChangeStreamPartitions", "ReadChangeStream" diff --git a/generator/internal/codegen_utils_test.cc b/generator/internal/codegen_utils_test.cc index 7b52663d35382..63790fadb73b7 100644 --- a/generator/internal/codegen_utils_test.cc +++ b/generator/internal/codegen_utils_test.cc @@ -323,13 +323,13 @@ TEST(ProcessCommandLineArgs, ProcessExperimental) { EXPECT_THAT(*result, Contains(Pair("experimental", "true"))); } -TEST(ProcessCommandLineArgs, ProcessExperimentalBigtableOperationContext) { +TEST(ProcessCommandLineArgs, ProcessExperimentalOperationContext) { auto result = ProcessCommandLineArgs( "product_path=google/cloud/bigtable/" - ",experimental_bigtable_operation_context=true"); + ",experimental_operation_context=true"); ASSERT_THAT(result, IsOk()); - EXPECT_THAT(*result, Contains(Pair("experimental_bigtable_operation_context", - "true"))); + EXPECT_THAT(*result, + Contains(Pair("experimental_operation_context", "true"))); } TEST(ProcessCommandLineArgs, ProcessServiceNameMapping) { diff --git a/generator/internal/descriptor_utils.cc b/generator/internal/descriptor_utils.cc index dbf667d62474c..a9fd8615e3763 100644 --- a/generator/internal/descriptor_utils.cc +++ b/generator/internal/descriptor_utils.cc @@ -850,27 +850,25 @@ VarsDictionary CreateServiceVars( SetRetryStatusCodeExpression(vars); vars["transient_errors_comment"] = TransientErrorsComment(vars); SetLongrunningOperationServiceVars(descriptor, vars); - auto const experimental_bigtable_operation_context = - vars.find("experimental_bigtable_operation_context"); - if (experimental_bigtable_operation_context != vars.end() && - experimental_bigtable_operation_context->second == "true") { + auto const experimental_operation_context = + vars.find("experimental_operation_context"); + if (experimental_operation_context != vars.end() && + experimental_operation_context->second == "true") { + auto const& ns = vars.find("product_internal_namespace")->second; vars["op_ctx_decl"] = - ",\n google::cloud::bigtable_internal::OperationContext& " - "operation_context"; + absl::StrCat(",\n ", ns, "::OperationContext& operation_context"); vars["op_ctx_arg"] = ", operation_context"; vars["op_ctx_cap"] = ", &operation_context"; vars["op_ctx_stub_decl"] = - ",\n google::cloud::bigtable_internal::OperationContext&"; + absl::StrCat(",\n ", ns, "::OperationContext&"); vars["op_ctx_shared_decl"] = - ",\n " - "std::shared_ptr " - "operation_context"; + absl::StrCat(",\n std::shared_ptr<", ns, + "::OperationContext> operation_context"); vars["op_ctx_shared_arg"] = ", std::move(operation_context)"; vars["op_ctx_shared_cap"] = ", operation_context = std::move(operation_context)"; vars["op_ctx_shared_stub_decl"] = - ",\n " - "std::shared_ptr"; + absl::StrCat(",\n std::shared_ptr<", ns, "::OperationContext>"); } else { vars["op_ctx_decl"] = ""; vars["op_ctx_arg"] = ""; diff --git a/generator/internal/service_code_generator.cc b/generator/internal/service_code_generator.cc index b7b1dad62bf38..8f99fe2251cd6 100644 --- a/generator/internal/service_code_generator.cc +++ b/generator/internal/service_code_generator.cc @@ -105,8 +105,8 @@ bool ServiceCodeGenerator::IsExperimental() const { return iter != vars().end() && iter->second == "true"; } -bool ServiceCodeGenerator::HasExperimentalBigtableOperationContext() const { - auto iter = vars().find("experimental_bigtable_operation_context"); +bool ServiceCodeGenerator::HasExperimentalOperationContext() const { + auto iter = vars().find("experimental_operation_context"); return iter != vars().end() && iter->second == "true"; } diff --git a/generator/internal/service_code_generator.h b/generator/internal/service_code_generator.h index f85fdfeabd5dd..2635706f07aab 100644 --- a/generator/internal/service_code_generator.h +++ b/generator/internal/service_code_generator.h @@ -128,9 +128,9 @@ class ServiceCodeGenerator : public GeneratorInterface { bool IsExperimental() const; /** - * Determines if the service enables experimental Bigtable OperationContext. + * Determines if the service enables experimental OperationContext. */ - bool HasExperimentalBigtableOperationContext() const; + bool HasExperimentalOperationContext() const; /** * Determines if the service contains at least one method that requires diff --git a/generator/internal/stub_generator.cc b/generator/internal/stub_generator.cc index 205599a8ce9fa..7e6247f5b1d19 100644 --- a/generator/internal/stub_generator.cc +++ b/generator/internal/stub_generator.cc @@ -85,15 +85,15 @@ Status StubGenerator::GenerateHeader() { HeaderProtobufGenCodeIncludes( {vars("proto_grpc_header_path"), include_lro_header ? "google/longrunning/operations.grpc.pb.h" : ""}); + HeaderLocalIncludes( + {HasExperimentalOperationContext() + ? absl::StrCat(vars("product_path"), "internal/operation_context.h") + : ""}); HeaderSystemIncludes({"memory", "utility"}); HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; - if (HasExperimentalBigtableOperationContext()) { - HeaderPrint("\nclass OperationContext;\n"); - } - // Abstract interface Stub base class HeaderPrint( // clang-format off "\n" diff --git a/generator/standalone_main.cc b/generator/standalone_main.cc index fc4ee09150668..3ef12319db596 100644 --- a/generator/standalone_main.cc +++ b/generator/standalone_main.cc @@ -303,9 +303,9 @@ std::vector> GenerateCodeFromProtos( args.emplace_back( "--cpp_codegen_opt=generate_round_robin_decorator=true"); } - if (service.experimental_bigtable_operation_context()) { + if (service.experimental_operation_context()) { args.emplace_back( - "--cpp_codegen_opt=experimental_bigtable_operation_context=true"); + "--cpp_codegen_opt=experimental_operation_context=true"); } args.emplace_back("--cpp_codegen_opt=service_endpoint_env_var=" + service.service_endpoint_env_var()); From 1d399c2b71310ef729258fe29e69a7bb4d17c7fd Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Sun, 20 Sep 2026 11:24:39 -0400 Subject: [PATCH 3/3] regenerated bigtable code --- .../internal/bigtable_auth_decorator.cc | 57 ++-- .../internal/bigtable_auth_decorator.h | 143 ++++----- .../internal/bigtable_channel_refresh.cc | 42 +-- .../internal/bigtable_channel_refresh.h | 89 ++--- .../internal/bigtable_logging_decorator.cc | 57 ++-- .../internal/bigtable_logging_decorator.h | 143 ++++----- .../internal/bigtable_metadata_decorator.cc | 57 ++-- .../internal/bigtable_metadata_decorator.h | 143 ++++----- ...igtable_random_two_least_used_decorator.cc | 57 ++-- ...bigtable_random_two_least_used_decorator.h | 85 +++-- .../bigtable_round_robin_decorator.cc | 57 ++-- .../internal/bigtable_round_robin_decorator.h | 143 ++++----- .../cloud/bigtable/internal/bigtable_stub.cc | 42 +-- .../cloud/bigtable/internal/bigtable_stub.h | 303 ++++++++---------- .../internal/bigtable_tracing_stub.cc | 57 ++-- .../bigtable/internal/bigtable_tracing_stub.h | 143 ++++----- 16 files changed, 740 insertions(+), 878 deletions(-) diff --git a/google/cloud/bigtable/internal/bigtable_auth_decorator.cc b/google/cloud/bigtable/internal/bigtable_auth_decorator.cc index d1987006b0e68..5e97fe06bf7be 100644 --- a/google/cloud/bigtable/internal/bigtable_auth_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_auth_decorator.cc @@ -41,8 +41,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using ErrorStream = ::google::cloud::internal::StreamingReadRpcError< google::bigtable::v2::ReadRowsResponse>; auto status = auth_->ConfigureContext(*context); @@ -56,8 +55,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using ErrorStream = ::google::cloud::internal::StreamingReadRpcError< google::bigtable::v2::SampleRowKeysResponse>; auto status = auth_->ConfigureContext(*context); @@ -69,7 +67,7 @@ BigtableAuth::SampleRowKeys( StatusOr BigtableAuth::MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; return child_->MutateRow(context, options, request, operation_context); @@ -80,8 +78,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using ErrorStream = ::google::cloud::internal::StreamingReadRpcError< google::bigtable::v2::MutateRowsResponse>; auto status = auth_->ConfigureContext(*context); @@ -94,7 +91,7 @@ StatusOr BigtableAuth::CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; return child_->CheckAndMutateRow(context, options, request, @@ -104,7 +101,7 @@ BigtableAuth::CheckAndMutateRow( StatusOr BigtableAuth::PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; return child_->PingAndWarm(context, options, request, operation_context); @@ -114,7 +111,7 @@ StatusOr BigtableAuth::ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; return child_->ReadModifyWriteRow(context, options, request, @@ -124,7 +121,7 @@ BigtableAuth::ReadModifyWriteRow( StatusOr BigtableAuth::PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; return child_->PrepareQuery(context, options, request, operation_context); @@ -135,8 +132,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using ErrorStream = ::google::cloud::internal::StreamingReadRpcError< google::bigtable::v2::ExecuteQueryResponse>; auto status = auth_->ConfigureContext(*context); @@ -149,7 +145,7 @@ StatusOr BigtableAuth::GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; return child_->GetClientConfiguration(context, options, request, @@ -163,8 +159,7 @@ BigtableAuth::AsyncOpenTable( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>; @@ -186,8 +181,7 @@ BigtableAuth::AsyncOpenAuthorizedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>; @@ -209,8 +203,7 @@ BigtableAuth::AsyncOpenMaterializedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>; @@ -232,8 +225,7 @@ BigtableAuth::AsyncReadRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using StreamAuth = google::cloud::internal::AsyncStreamingReadRpcAuth< google::bigtable::v2::ReadRowsResponse>; @@ -255,8 +247,7 @@ BigtableAuth::AsyncSampleRowKeys( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using StreamAuth = google::cloud::internal::AsyncStreamingReadRpcAuth< google::bigtable::v2::SampleRowKeysResponse>; @@ -277,8 +268,7 @@ BigtableAuth::AsyncMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return auth_->AsyncConfigureContext(std::move(context)) .then([cq, child = child_, options = std::move(options), request, operation_context = std::move(operation_context)]( @@ -303,8 +293,7 @@ BigtableAuth::AsyncMutateRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using StreamAuth = google::cloud::internal::AsyncStreamingReadRpcAuth< google::bigtable::v2::MutateRowsResponse>; @@ -325,8 +314,7 @@ BigtableAuth::AsyncCheckAndMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return auth_->AsyncConfigureContext(std::move(context)) .then([cq, child = child_, options = std::move(options), request, operation_context = std::move(operation_context)]( @@ -350,8 +338,7 @@ BigtableAuth::AsyncPingAndWarm( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return auth_->AsyncConfigureContext(std::move(context)) .then([cq, child = child_, options = std::move(options), request, operation_context = std::move(operation_context)]( @@ -375,8 +362,7 @@ BigtableAuth::AsyncReadModifyWriteRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return auth_->AsyncConfigureContext(std::move(context)) .then([cq, child = child_, options = std::move(options), request, operation_context = std::move(operation_context)]( @@ -400,8 +386,7 @@ BigtableAuth::AsyncPrepareQuery( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return auth_->AsyncConfigureContext(std::move(context)) .then([cq, child = child_, options = std::move(options), request, operation_context = std::move(operation_context)]( diff --git a/google/cloud/bigtable/internal/bigtable_auth_decorator.h b/google/cloud/bigtable/internal/bigtable_auth_decorator.h index 955ed16f7a349..2c38966b791c2 100644 --- a/google/cloud/bigtable/internal/bigtable_auth_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_auth_decorator.h @@ -45,136 +45,124 @@ class BigtableAuth : public BigtableStub { google::bigtable::v2::ReadRowsResponse>> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; std::unique_ptr> - SampleRowKeys( - std::shared_ptr context, Options const& options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + SampleRowKeys(std::shared_ptr context, + Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> - ExecuteQuery( - std::shared_ptr context, Options const& options, - google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) override; + ExecuteQuery(std::shared_ptr context, + Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenTable( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenTable(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncMutateRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( @@ -182,16 +170,16 @@ class BigtableAuth : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( @@ -199,17 +187,16 @@ class BigtableAuth : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) override; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; private: std::shared_ptr auth_; diff --git a/google/cloud/bigtable/internal/bigtable_channel_refresh.cc b/google/cloud/bigtable/internal/bigtable_channel_refresh.cc index a484dde4c483d..76df90e866d4f 100644 --- a/google/cloud/bigtable/internal/bigtable_channel_refresh.cc +++ b/google/cloud/bigtable/internal/bigtable_channel_refresh.cc @@ -24,7 +24,7 @@ std::unique_ptr client_context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->ReadRows(std::move(client_context), options, request, std::move(operation_context)); } @@ -34,7 +34,7 @@ std::unique_ptr client_context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->SampleRowKeys(std::move(client_context), options, request, std::move(operation_context)); } @@ -43,7 +43,7 @@ StatusOr BigtableChannelRefresh::MutateRow( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return child_->MutateRow(client_context, options, request, operation_context); } @@ -52,7 +52,7 @@ std::unique_ptr client_context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->MutateRows(std::move(client_context), options, request, std::move(operation_context)); } @@ -61,7 +61,7 @@ StatusOr BigtableChannelRefresh::CheckAndMutateRow( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return child_->CheckAndMutateRow(client_context, options, request, operation_context); } @@ -70,7 +70,7 @@ StatusOr BigtableChannelRefresh::PingAndWarm( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return child_->PingAndWarm(client_context, options, request, operation_context); } @@ -79,7 +79,7 @@ StatusOr BigtableChannelRefresh::ReadModifyWriteRow( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return child_->ReadModifyWriteRow(client_context, options, request, operation_context); } @@ -88,7 +88,7 @@ StatusOr BigtableChannelRefresh::PrepareQuery( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return child_->PrepareQuery(client_context, options, request, operation_context); } @@ -98,7 +98,7 @@ std::unique_ptr client_context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->ExecuteQuery(std::move(client_context), options, request, std::move(operation_context)); } @@ -110,7 +110,7 @@ BigtableChannelRefresh::AsyncReadRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncReadRows(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -122,7 +122,7 @@ BigtableChannelRefresh::AsyncSampleRowKeys( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncSampleRowKeys(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -133,7 +133,7 @@ BigtableChannelRefresh::AsyncMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncMutateRow(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -145,7 +145,7 @@ BigtableChannelRefresh::AsyncMutateRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncMutateRows(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -156,7 +156,7 @@ BigtableChannelRefresh::AsyncCheckAndMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncCheckAndMutateRow(cq, std::move(context), std::move(options), request, std::move(operation_context)); @@ -168,7 +168,7 @@ BigtableChannelRefresh::AsyncPingAndWarm( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncPingAndWarm(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -179,7 +179,7 @@ BigtableChannelRefresh::AsyncReadModifyWriteRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncReadModifyWriteRow(cq, std::move(context), std::move(options), request, std::move(operation_context)); @@ -191,7 +191,7 @@ BigtableChannelRefresh::AsyncPrepareQuery( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncPrepareQuery(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -200,7 +200,7 @@ StatusOr BigtableChannelRefresh::GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return child_->GetClientConfiguration(context, options, request, operation_context); } @@ -212,7 +212,7 @@ BigtableChannelRefresh::AsyncOpenTable( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncOpenTable(cq, std::move(context), std::move(options), std::move(operation_context)); } @@ -224,7 +224,7 @@ BigtableChannelRefresh::AsyncOpenAuthorizedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncOpenAuthorizedView( cq, std::move(context), std::move(options), std::move(operation_context)); } @@ -236,7 +236,7 @@ BigtableChannelRefresh::AsyncOpenMaterializedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return child_->AsyncOpenMaterializedView( cq, std::move(context), std::move(options), std::move(operation_context)); } diff --git a/google/cloud/bigtable/internal/bigtable_channel_refresh.h b/google/cloud/bigtable/internal/bigtable_channel_refresh.h index f9ce9fe9fa3a0..9719e3caed7a3 100644 --- a/google/cloud/bigtable/internal/bigtable_channel_refresh.h +++ b/google/cloud/bigtable/internal/bigtable_channel_refresh.h @@ -47,53 +47,57 @@ class BigtableChannelRefresh : public BigtableStub { ReadRows(std::shared_ptr client_context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr> SampleRowKeys(std::shared_ptr client_context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> MutateRows(std::shared_ptr client_context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& client_context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& client, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> ExecuteQuery(std::shared_ptr client_context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> @@ -101,23 +105,25 @@ class BigtableChannelRefresh : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) override; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> @@ -125,7 +131,8 @@ class BigtableChannelRefresh : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( @@ -133,14 +140,16 @@ class BigtableChannelRefresh : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( @@ -148,20 +157,21 @@ class BigtableChannelRefresh : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr operation_context) override; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, @@ -169,25 +179,26 @@ class BigtableChannelRefresh : public BigtableStub { AsyncOpenTable(google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr operation_context) override; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr operation_context) override; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; private: std::shared_ptr child_; diff --git a/google/cloud/bigtable/internal/bigtable_logging_decorator.cc b/google/cloud/bigtable/internal/bigtable_logging_decorator.cc index 3b7d75b658c68..ba27cd94f044f 100644 --- a/google/cloud/bigtable/internal/bigtable_logging_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_logging_decorator.cc @@ -48,8 +48,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( std::shared_ptr context, Options const& options, @@ -75,8 +74,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( std::shared_ptr context, Options const& options, @@ -100,7 +98,7 @@ BigtableLogging::SampleRowKeys( StatusOr BigtableLogging::MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return google::cloud::internal::LogWrapper( [this, &operation_context]( grpc::ClientContext& context, Options const& options, @@ -115,8 +113,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( std::shared_ptr context, Options const& options, @@ -141,7 +138,7 @@ StatusOr BigtableLogging::CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return google::cloud::internal::LogWrapper( [this, &operation_context]( grpc::ClientContext& context, Options const& options, @@ -156,7 +153,7 @@ StatusOr BigtableLogging::PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return google::cloud::internal::LogWrapper( [this, &operation_context]( grpc::ClientContext& context, Options const& options, @@ -171,7 +168,7 @@ StatusOr BigtableLogging::ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return google::cloud::internal::LogWrapper( [this, &operation_context]( grpc::ClientContext& context, Options const& options, @@ -186,7 +183,7 @@ StatusOr BigtableLogging::PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return google::cloud::internal::LogWrapper( [this, &operation_context]( grpc::ClientContext& context, Options const& options, @@ -202,8 +199,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( std::shared_ptr context, Options const& options, @@ -228,7 +224,7 @@ StatusOr BigtableLogging::GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return google::cloud::internal::LogWrapper( [this, &operation_context]( grpc::ClientContext& context, Options const& options, @@ -246,8 +242,7 @@ BigtableLogging::AsyncOpenTable( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using LoggingStream = ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< google::bigtable::v2::SessionRequest, @@ -271,8 +266,7 @@ BigtableLogging::AsyncOpenAuthorizedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using LoggingStream = ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< google::bigtable::v2::SessionRequest, @@ -296,8 +290,7 @@ BigtableLogging::AsyncOpenMaterializedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using LoggingStream = ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< google::bigtable::v2::SessionRequest, @@ -321,8 +314,7 @@ BigtableLogging::AsyncReadRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using LoggingStream = ::google::cloud::internal::AsyncStreamingReadRpcLogging< google::bigtable::v2::ReadRowsResponse>; @@ -347,8 +339,7 @@ BigtableLogging::AsyncSampleRowKeys( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using LoggingStream = ::google::cloud::internal::AsyncStreamingReadRpcLogging< google::bigtable::v2::SampleRowKeysResponse>; @@ -372,8 +363,7 @@ BigtableLogging::AsyncMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( google::cloud::CompletionQueue& cq, @@ -395,8 +385,7 @@ BigtableLogging::AsyncMutateRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { using LoggingStream = ::google::cloud::internal::AsyncStreamingReadRpcLogging< google::bigtable::v2::MutateRowsResponse>; @@ -420,8 +409,7 @@ BigtableLogging::AsyncCheckAndMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( google::cloud::CompletionQueue& cq, @@ -442,8 +430,7 @@ BigtableLogging::AsyncPingAndWarm( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( google::cloud::CompletionQueue& cq, @@ -464,8 +451,7 @@ BigtableLogging::AsyncReadModifyWriteRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( google::cloud::CompletionQueue& cq, @@ -486,8 +472,7 @@ BigtableLogging::AsyncPrepareQuery( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return google::cloud::internal::LogWrapper( [this, operation_context = std::move(operation_context)]( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_logging_decorator.h b/google/cloud/bigtable/internal/bigtable_logging_decorator.h index 96fa28fb19026..9e04ed81d0c49 100644 --- a/google/cloud/bigtable/internal/bigtable_logging_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_logging_decorator.h @@ -45,136 +45,124 @@ class BigtableLogging : public BigtableStub { google::bigtable::v2::ReadRowsResponse>> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; std::unique_ptr> - SampleRowKeys( - std::shared_ptr context, Options const& options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + SampleRowKeys(std::shared_ptr context, + Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> - ExecuteQuery( - std::shared_ptr context, Options const& options, - google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) override; + ExecuteQuery(std::shared_ptr context, + Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenTable( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenTable(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncMutateRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( @@ -182,16 +170,16 @@ class BigtableLogging : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( @@ -199,17 +187,16 @@ class BigtableLogging : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) override; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; private: std::shared_ptr child_; diff --git a/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc b/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc index 5ca7f51cec268..5fef22c35cfb9 100644 --- a/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc @@ -54,8 +54,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(3); @@ -112,8 +111,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(3); @@ -168,7 +166,7 @@ BigtableMetadata::SampleRowKeys( StatusOr BigtableMetadata::MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { std::vector params; params.reserve(2); @@ -209,8 +207,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); @@ -251,7 +248,7 @@ StatusOr BigtableMetadata::CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { std::vector params; params.reserve(2); @@ -292,7 +289,7 @@ StatusOr BigtableMetadata::PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { std::vector params; params.reserve(2); @@ -326,7 +323,7 @@ StatusOr BigtableMetadata::ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { std::vector params; params.reserve(2); @@ -367,7 +364,7 @@ StatusOr BigtableMetadata::PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { std::vector params; params.reserve(2); @@ -402,8 +399,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); @@ -438,7 +434,7 @@ StatusOr BigtableMetadata::GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { SetMetadata(context, options); return child_->GetClientConfiguration(context, options, request, operation_context); @@ -451,8 +447,7 @@ BigtableMetadata::AsyncOpenTable( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { SetMetadata(*context, *options); return child_->AsyncOpenTable(cq, std::move(context), std::move(options), std::move(operation_context)); @@ -465,8 +460,7 @@ BigtableMetadata::AsyncOpenAuthorizedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { SetMetadata(*context, *options); return child_->AsyncOpenAuthorizedView( cq, std::move(context), std::move(options), std::move(operation_context)); @@ -479,8 +473,7 @@ BigtableMetadata::AsyncOpenMaterializedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { SetMetadata(*context, *options); return child_->AsyncOpenMaterializedView( cq, std::move(context), std::move(options), std::move(operation_context)); @@ -493,8 +486,7 @@ BigtableMetadata::AsyncReadRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(3); @@ -553,8 +545,7 @@ BigtableMetadata::AsyncSampleRowKeys( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(3); @@ -612,8 +603,7 @@ BigtableMetadata::AsyncMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); @@ -657,8 +647,7 @@ BigtableMetadata::AsyncMutateRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); @@ -701,8 +690,7 @@ BigtableMetadata::AsyncCheckAndMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); @@ -746,8 +734,7 @@ BigtableMetadata::AsyncPingAndWarm( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); @@ -784,8 +771,7 @@ BigtableMetadata::AsyncReadModifyWriteRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); @@ -829,8 +815,7 @@ BigtableMetadata::AsyncPrepareQuery( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { std::vector params; params.reserve(2); diff --git a/google/cloud/bigtable/internal/bigtable_metadata_decorator.h b/google/cloud/bigtable/internal/bigtable_metadata_decorator.h index 93546ccafaee4..080087684fe2d 100644 --- a/google/cloud/bigtable/internal/bigtable_metadata_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_metadata_decorator.h @@ -45,136 +45,124 @@ class BigtableMetadata : public BigtableStub { google::bigtable::v2::ReadRowsResponse>> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; std::unique_ptr> - SampleRowKeys( - std::shared_ptr context, Options const& options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + SampleRowKeys(std::shared_ptr context, + Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> - ExecuteQuery( - std::shared_ptr context, Options const& options, - google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) override; + ExecuteQuery(std::shared_ptr context, + Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenTable( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenTable(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncMutateRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( @@ -182,16 +170,16 @@ class BigtableMetadata : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( @@ -199,17 +187,16 @@ class BigtableMetadata : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) override; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; private: void SetMetadata(grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc index 2cb501b017754..632be385db5b4 100644 --- a/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h" +#include "google/cloud/bigtable/internal/operation_context.h" #include "google/cloud/async_streaming_read_write_rpc.h" #include "google/cloud/internal/async_streaming_read_rpc.h" #include "google/cloud/internal/streaming_read_rpc.h" @@ -103,7 +104,7 @@ class AsyncStreamingReadWriteRpcTracking template Response UnaryHelper(std::shared_ptr>& pool, - OperationContext& oc, + bigtable_internal::OperationContext& oc, std::function const& fn) { SelectedChannel selection = pool->GetChannelRandomTwoLeastUsed(); @@ -118,7 +119,8 @@ Response UnaryHelper(std::shared_ptr>& pool, template Response AsyncHelper(std::shared_ptr>& pool, - std::shared_ptr const& operation_context, + std::shared_ptr const& + operation_context, std::function const& fn) { SelectedChannel selection = pool->GetChannelRandomTwoLeastUsed(); @@ -136,7 +138,8 @@ Response AsyncHelper(std::shared_ptr>& pool, template std::unique_ptr> StreamingHelper( std::shared_ptr>& pool, - std::shared_ptr const& operation_context, + std::shared_ptr const& + operation_context, std::function>( BigtableStub&)> const& fn) { SelectedChannel selection = @@ -159,7 +162,8 @@ std::unique_ptr> StreamingHelper( template std::unique_ptr> AsyncStreamingHelper( std::shared_ptr>& pool, - std::shared_ptr const& operation_context, + std::shared_ptr const& + operation_context, std::function>( BigtableStub&)> const& fn) { SelectedChannel selection = @@ -182,7 +186,8 @@ std::unique_ptr> AsyncStreamingHelper( template std::unique_ptr> AsyncStreamingHelper(std::shared_ptr>& pool, - std::shared_ptr const& operation_context, + std::shared_ptr const& + operation_context, std::function>(BigtableStub&)> const& fn) { SelectedChannel selection = @@ -211,7 +216,7 @@ std::unique_ptr< BigtableRandomTwoLeastUsed::ReadRows( std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return StreamingHelper( pool_, operation_context, [&, context = std::move(context), @@ -226,7 +231,7 @@ std::unique_ptr< BigtableRandomTwoLeastUsed::SampleRowKeys( std::shared_ptr context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return StreamingHelper( pool_, operation_context, [&, context = std::move(context), @@ -240,7 +245,7 @@ StatusOr BigtableRandomTwoLeastUsed::MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return UnaryHelper>( pool_, operation_context, [&](BigtableStub& stub) { return stub.MutateRow(context, options, request, operation_context); @@ -252,7 +257,7 @@ std::unique_ptr< BigtableRandomTwoLeastUsed::MutateRows( std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return StreamingHelper( pool_, operation_context, [&, context = std::move(context), @@ -266,7 +271,7 @@ StatusOr BigtableRandomTwoLeastUsed::CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return UnaryHelper>( pool_, operation_context, [&](BigtableStub& stub) { return stub.CheckAndMutateRow(context, options, request, @@ -278,7 +283,7 @@ StatusOr BigtableRandomTwoLeastUsed::PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return UnaryHelper>( pool_, operation_context, [&](BigtableStub& stub) { return stub.PingAndWarm(context, options, request, operation_context); @@ -289,7 +294,7 @@ StatusOr BigtableRandomTwoLeastUsed::ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return UnaryHelper< StatusOr>( pool_, operation_context, [&](BigtableStub& stub) { @@ -302,7 +307,7 @@ StatusOr BigtableRandomTwoLeastUsed::PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return UnaryHelper>( pool_, operation_context, [&](BigtableStub& stub) { return stub.PrepareQuery(context, options, request, operation_context); @@ -314,7 +319,7 @@ std::unique_ptr< BigtableRandomTwoLeastUsed::ExecuteQuery( std::shared_ptr context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return StreamingHelper( pool_, operation_context, [&, context = std::move(context), @@ -330,7 +335,7 @@ BigtableRandomTwoLeastUsed::AsyncReadRows( CompletionQueue const& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncStreamingHelper( pool_, operation_context, [&, context = std::move(context), options = std::move(options), @@ -346,7 +351,7 @@ BigtableRandomTwoLeastUsed::AsyncSampleRowKeys( CompletionQueue const& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncStreamingHelper( pool_, operation_context, [&, context = std::move(context), options = std::move(options), @@ -362,7 +367,7 @@ BigtableRandomTwoLeastUsed::AsyncMutateRow( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncHelper>>( pool_, operation_context, [&, context = std::move(context), options = std::move(options), @@ -378,7 +383,7 @@ BigtableRandomTwoLeastUsed::AsyncMutateRows( CompletionQueue const& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncStreamingHelper( pool_, operation_context, [&, context = std::move(context), options = std::move(options), @@ -393,7 +398,7 @@ BigtableRandomTwoLeastUsed::AsyncCheckAndMutateRow( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncHelper< future>>( pool_, operation_context, @@ -410,7 +415,7 @@ BigtableRandomTwoLeastUsed::AsyncPingAndWarm( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncHelper< future>>( pool_, operation_context, @@ -426,7 +431,7 @@ BigtableRandomTwoLeastUsed::AsyncReadModifyWriteRow( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncHelper< future>>( pool_, operation_context, @@ -443,7 +448,7 @@ BigtableRandomTwoLeastUsed::AsyncPrepareQuery( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncHelper< future>>( pool_, operation_context, @@ -459,7 +464,7 @@ StatusOr BigtableRandomTwoLeastUsed::GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return UnaryHelper>( pool_, operation_context, [&](BigtableStub& stub) { return stub.GetClientConfiguration(context, options, request, @@ -473,7 +478,7 @@ std::unique_ptr< BigtableRandomTwoLeastUsed::AsyncOpenTable( CompletionQueue const& cq, std::shared_ptr context, internal::ImmutableOptions options, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncStreamingHelper( pool_, operation_context, @@ -490,7 +495,7 @@ std::unique_ptr< BigtableRandomTwoLeastUsed::AsyncOpenAuthorizedView( CompletionQueue const& cq, std::shared_ptr context, internal::ImmutableOptions options, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncStreamingHelper( pool_, operation_context, @@ -508,7 +513,7 @@ std::unique_ptr< BigtableRandomTwoLeastUsed::AsyncOpenMaterializedView( CompletionQueue const& cq, std::shared_ptr context, internal::ImmutableOptions options, - std::shared_ptr operation_context) { + std::shared_ptr operation_context) { return AsyncStreamingHelper( pool_, operation_context, diff --git a/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h index 48ddd67cf0d77..10ffb9915b544 100644 --- a/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h @@ -43,53 +43,57 @@ class BigtableRandomTwoLeastUsed : public BigtableStub { internal::StreamingReadRpc> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr< internal::StreamingReadRpc> SampleRowKeys(std::shared_ptr context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr< internal::StreamingReadRpc> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr< internal::StreamingReadRpc> ExecuteQuery(std::shared_ptr context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr< internal::AsyncStreamingReadRpc> @@ -97,21 +101,24 @@ class BigtableRandomTwoLeastUsed : public BigtableStub { std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr> - AsyncSampleRowKeys( - CompletionQueue const& cq, std::shared_ptr context, - internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr operation_context) override; + AsyncSampleRowKeys(CompletionQueue const& cq, + std::shared_ptr context, + internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr< internal::AsyncStreamingReadRpc> @@ -119,39 +126,44 @@ class BigtableRandomTwoLeastUsed : public BigtableStub { std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( CompletionQueue& cq, std::shared_ptr context, internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - CompletionQueue& cq, std::shared_ptr context, - internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr operation_context) override; + AsyncPrepareQuery(CompletionQueue& cq, + std::shared_ptr context, + internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - OperationContext& operation_context) override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr< AsyncStreamingReadWriteRpc context, internal::ImmutableOptions options, - std::shared_ptr operation_context) override; + std::shared_ptr + operation_context) override; std::unique_ptr< AsyncStreamingReadWriteRpc> - AsyncOpenAuthorizedView( - CompletionQueue const& cq, std::shared_ptr context, - internal::ImmutableOptions options, - std::shared_ptr operation_context) override; + AsyncOpenAuthorizedView(CompletionQueue const& cq, + std::shared_ptr context, + internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr< AsyncStreamingReadWriteRpc> - AsyncOpenMaterializedView( - CompletionQueue const& cq, std::shared_ptr context, - internal::ImmutableOptions options, - std::shared_ptr operation_context) override; + AsyncOpenMaterializedView(CompletionQueue const& cq, + std::shared_ptr context, + internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; private: std::shared_ptr> pool_; diff --git a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc index 5df35deb3f3fd..4fccd463fb9cb 100644 --- a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc @@ -38,8 +38,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->ReadRows(std::move(context), options, request, std::move(operation_context)); } @@ -49,8 +48,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->SampleRowKeys(std::move(context), options, request, std::move(operation_context)); } @@ -58,7 +56,7 @@ BigtableRoundRobin::SampleRowKeys( StatusOr BigtableRoundRobin::MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return Child()->MutateRow(context, options, request, operation_context); } @@ -67,8 +65,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->MutateRows(std::move(context), options, request, std::move(operation_context)); } @@ -77,7 +74,7 @@ StatusOr BigtableRoundRobin::CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return Child()->CheckAndMutateRow(context, options, request, operation_context); } @@ -86,7 +83,7 @@ StatusOr BigtableRoundRobin::PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return Child()->PingAndWarm(context, options, request, operation_context); } @@ -94,7 +91,7 @@ StatusOr BigtableRoundRobin::ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return Child()->ReadModifyWriteRow(context, options, request, operation_context); } @@ -103,7 +100,7 @@ StatusOr BigtableRoundRobin::PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return Child()->PrepareQuery(context, options, request, operation_context); } @@ -112,8 +109,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->ExecuteQuery(std::move(context), options, request, std::move(operation_context)); } @@ -122,7 +118,7 @@ StatusOr BigtableRoundRobin::GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { return Child()->GetClientConfiguration(context, options, request, operation_context); } @@ -134,8 +130,7 @@ BigtableRoundRobin::AsyncOpenTable( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncOpenTable(cq, std::move(context), std::move(options), std::move(operation_context)); } @@ -147,8 +142,7 @@ BigtableRoundRobin::AsyncOpenAuthorizedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncOpenAuthorizedView( cq, std::move(context), std::move(options), std::move(operation_context)); } @@ -160,8 +154,7 @@ BigtableRoundRobin::AsyncOpenMaterializedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncOpenMaterializedView( cq, std::move(context), std::move(options), std::move(operation_context)); } @@ -173,8 +166,7 @@ BigtableRoundRobin::AsyncReadRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncReadRows(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -186,8 +178,7 @@ BigtableRoundRobin::AsyncSampleRowKeys( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncSampleRowKeys(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -198,8 +189,7 @@ BigtableRoundRobin::AsyncMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncMutateRow(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -211,8 +201,7 @@ BigtableRoundRobin::AsyncMutateRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncMutateRows(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -223,8 +212,7 @@ BigtableRoundRobin::AsyncCheckAndMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncCheckAndMutateRow(cq, std::move(context), std::move(options), request, std::move(operation_context)); @@ -236,8 +224,7 @@ BigtableRoundRobin::AsyncPingAndWarm( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncPingAndWarm(cq, std::move(context), std::move(options), request, std::move(operation_context)); } @@ -248,8 +235,7 @@ BigtableRoundRobin::AsyncReadModifyWriteRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncReadModifyWriteRow(cq, std::move(context), std::move(options), request, std::move(operation_context)); @@ -261,8 +247,7 @@ BigtableRoundRobin::AsyncPrepareQuery( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { return Child()->AsyncPrepareQuery(cq, std::move(context), std::move(options), request, std::move(operation_context)); } diff --git a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h index 95bf02e7c06d5..01403a14a38f4 100644 --- a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h @@ -43,136 +43,124 @@ class BigtableRoundRobin : public BigtableStub { google::bigtable::v2::ReadRowsResponse>> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; std::unique_ptr> - SampleRowKeys( - std::shared_ptr context, Options const& options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + SampleRowKeys(std::shared_ptr context, + Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> - ExecuteQuery( - std::shared_ptr context, Options const& options, - google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) override; + ExecuteQuery(std::shared_ptr context, + Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenTable( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenTable(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncMutateRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( @@ -180,16 +168,16 @@ class BigtableRoundRobin : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( @@ -197,17 +185,16 @@ class BigtableRoundRobin : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) override; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; private: std::shared_ptr Child(); diff --git a/google/cloud/bigtable/internal/bigtable_stub.cc b/google/cloud/bigtable/internal/bigtable_stub.cc index ccad440812389..026d523c21add 100644 --- a/google/cloud/bigtable/internal/bigtable_stub.cc +++ b/google/cloud/bigtable/internal/bigtable_stub.cc @@ -40,7 +40,7 @@ std::unique_ptr context, Options const&, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr) { + std::shared_ptr) { auto stream = grpc_stub_->ReadRows(context.get(), request); return std::make_unique>(std::move(context), @@ -52,7 +52,7 @@ std::unique_ptr context, Options const&, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr) { + std::shared_ptr) { auto stream = grpc_stub_->SampleRowKeys(context.get(), request); return std::make_unique>(std::move(context), @@ -63,7 +63,7 @@ StatusOr DefaultBigtableStub::MutateRow( grpc::ClientContext& context, Options const&, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext&) { + bigtable_internal::OperationContext&) { google::bigtable::v2::MutateRowResponse response; auto status = grpc_stub_->MutateRow(&context, request, &response); if (!status.ok()) { @@ -77,7 +77,7 @@ std::unique_ptr context, Options const&, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr) { + std::shared_ptr) { auto stream = grpc_stub_->MutateRows(context.get(), request); return std::make_unique>(std::move(context), @@ -88,7 +88,7 @@ StatusOr DefaultBigtableStub::CheckAndMutateRow( grpc::ClientContext& context, Options const&, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext&) { + bigtable_internal::OperationContext&) { google::bigtable::v2::CheckAndMutateRowResponse response; auto status = grpc_stub_->CheckAndMutateRow(&context, request, &response); if (!status.ok()) { @@ -101,7 +101,7 @@ StatusOr DefaultBigtableStub::PingAndWarm( grpc::ClientContext& context, Options const&, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext&) { + bigtable_internal::OperationContext&) { google::bigtable::v2::PingAndWarmResponse response; auto status = grpc_stub_->PingAndWarm(&context, request, &response); if (!status.ok()) { @@ -114,7 +114,7 @@ StatusOr DefaultBigtableStub::ReadModifyWriteRow( grpc::ClientContext& context, Options const&, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext&) { + bigtable_internal::OperationContext&) { google::bigtable::v2::ReadModifyWriteRowResponse response; auto status = grpc_stub_->ReadModifyWriteRow(&context, request, &response); if (!status.ok()) { @@ -127,7 +127,7 @@ StatusOr DefaultBigtableStub::PrepareQuery( grpc::ClientContext& context, Options const&, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext&) { + bigtable_internal::OperationContext&) { google::bigtable::v2::PrepareQueryResponse response; auto status = grpc_stub_->PrepareQuery(&context, request, &response); if (!status.ok()) { @@ -141,7 +141,7 @@ std::unique_ptr context, Options const&, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr) { + std::shared_ptr) { auto stream = grpc_stub_->ExecuteQuery(context.get(), request); return std::make_unique>(std::move(context), @@ -152,7 +152,7 @@ StatusOr DefaultBigtableStub::GetClientConfiguration( grpc::ClientContext& context, Options const&, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext&) { + bigtable_internal::OperationContext&) { google::bigtable::v2::ClientConfiguration response; auto status = grpc_stub_->GetClientConfiguration(&context, request, &response); @@ -169,7 +169,7 @@ DefaultBigtableStub::AsyncOpenTable( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr) { + std::shared_ptr) { return google::cloud::internal::MakeStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>( @@ -186,7 +186,7 @@ DefaultBigtableStub::AsyncOpenAuthorizedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr) { + std::shared_ptr) { return google::cloud::internal::MakeStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>( @@ -203,7 +203,7 @@ DefaultBigtableStub::AsyncOpenMaterializedView( google::cloud::CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr) { + std::shared_ptr) { return google::cloud::internal::MakeStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>( @@ -220,7 +220,7 @@ DefaultBigtableStub::AsyncReadRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return google::cloud::internal::MakeStreamingReadRpc< google::bigtable::v2::ReadRowsRequest, google::bigtable::v2::ReadRowsResponse>( @@ -239,7 +239,7 @@ DefaultBigtableStub::AsyncSampleRowKeys( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return google::cloud::internal::MakeStreamingReadRpc< google::bigtable::v2::SampleRowKeysRequest, google::bigtable::v2::SampleRowKeysResponse>( @@ -258,7 +258,7 @@ DefaultBigtableStub::AsyncMutateRow( // NOLINTNEXTLINE(performance-unnecessary-value-param) google::cloud::internal::ImmutableOptions, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return internal::MakeUnaryRpcImpl( cq, @@ -277,7 +277,7 @@ DefaultBigtableStub::AsyncMutateRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return google::cloud::internal::MakeStreamingReadRpc< google::bigtable::v2::MutateRowsRequest, google::bigtable::v2::MutateRowsResponse>( @@ -296,7 +296,7 @@ DefaultBigtableStub::AsyncCheckAndMutateRow( // NOLINTNEXTLINE(performance-unnecessary-value-param) google::cloud::internal::ImmutableOptions, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return internal::MakeUnaryRpcImpl< google::bigtable::v2::CheckAndMutateRowRequest, google::bigtable::v2::CheckAndMutateRowResponse>( @@ -316,7 +316,7 @@ DefaultBigtableStub::AsyncPingAndWarm( // NOLINTNEXTLINE(performance-unnecessary-value-param) google::cloud::internal::ImmutableOptions, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return internal::MakeUnaryRpcImpl( cq, @@ -335,7 +335,7 @@ DefaultBigtableStub::AsyncReadModifyWriteRow( // NOLINTNEXTLINE(performance-unnecessary-value-param) google::cloud::internal::ImmutableOptions, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return internal::MakeUnaryRpcImpl< google::bigtable::v2::ReadModifyWriteRowRequest, google::bigtable::v2::ReadModifyWriteRowResponse>( @@ -355,7 +355,7 @@ DefaultBigtableStub::AsyncPrepareQuery( // NOLINTNEXTLINE(performance-unnecessary-value-param) google::cloud::internal::ImmutableOptions, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr) { + std::shared_ptr) { return internal::MakeUnaryRpcImpl( cq, diff --git a/google/cloud/bigtable/internal/bigtable_stub.h b/google/cloud/bigtable/internal/bigtable_stub.h index cd3c8a6785e07..d619724fda26c 100644 --- a/google/cloud/bigtable/internal/bigtable_stub.h +++ b/google/cloud/bigtable/internal/bigtable_stub.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_STUB_H +#include "google/cloud/bigtable/internal/operation_context.h" #include "google/cloud/async_streaming_read_write_rpc.h" #include "google/cloud/completion_queue.h" #include "google/cloud/future.h" @@ -39,8 +40,6 @@ namespace cloud { namespace bigtable_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class OperationContext; - class BigtableStub { public: virtual ~BigtableStub() = 0; @@ -49,140 +48,127 @@ class BigtableStub { google::bigtable::v2::ReadRowsResponse>> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) = 0; virtual std::unique_ptr> - SampleRowKeys( - std::shared_ptr context, Options const& options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) = 0; + SampleRowKeys(std::shared_ptr context, + Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) = 0; virtual StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& - operation_context) = 0; + bigtable_internal::OperationContext& operation_context) = 0; virtual std::unique_ptr> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) = 0; virtual StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& - operation_context) = 0; + bigtable_internal::OperationContext& operation_context) = 0; virtual StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& - operation_context) = 0; + bigtable_internal::OperationContext& operation_context) = 0; virtual StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& - operation_context) = 0; + bigtable_internal::OperationContext& operation_context) = 0; virtual StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& - operation_context) = 0; + bigtable_internal::OperationContext& operation_context) = 0; virtual std::unique_ptr> - ExecuteQuery( - std::shared_ptr context, Options const& options, - google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) = 0; + ExecuteQuery(std::shared_ptr context, + Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request, + std::shared_ptr + operation_context) = 0; virtual StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& - operation_context) = 0; + bigtable_internal::OperationContext& operation_context) = 0; virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenTable( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) = 0; + AsyncOpenTable(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) = 0; virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) = 0; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) = 0; virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) = 0; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) = 0; virtual std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) = 0; + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request, + std::shared_ptr + operation_context) = 0; virtual std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) = 0; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) = 0; virtual future> - AsyncMutateRow( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) = 0; + AsyncMutateRow(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowRequest const& request, + std::shared_ptr + operation_context) = 0; virtual std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) = 0; + AsyncMutateRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request, + std::shared_ptr + operation_context) = 0; virtual future> AsyncCheckAndMutateRow( @@ -190,17 +176,16 @@ class BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) = 0; virtual future> - AsyncPingAndWarm( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) = 0; + AsyncPingAndWarm(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request, + std::shared_ptr + operation_context) = 0; virtual future> AsyncReadModifyWriteRow( @@ -208,17 +193,16 @@ class BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) = 0; virtual future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) = 0; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) = 0; }; class DefaultBigtableStub : public BigtableStub { @@ -231,136 +215,124 @@ class DefaultBigtableStub : public BigtableStub { google::bigtable::v2::ReadRowsResponse>> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; std::unique_ptr> - SampleRowKeys( - std::shared_ptr context, Options const& options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + SampleRowKeys(std::shared_ptr context, + Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> - ExecuteQuery( - std::shared_ptr context, Options const& options, - google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) override; + ExecuteQuery(std::shared_ptr context, + Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenTable( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenTable(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncMutateRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( @@ -368,16 +340,16 @@ class DefaultBigtableStub : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( @@ -385,17 +357,16 @@ class DefaultBigtableStub : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) override; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; private: std::unique_ptr grpc_stub_; diff --git a/google/cloud/bigtable/internal/bigtable_tracing_stub.cc b/google/cloud/bigtable/internal/bigtable_tracing_stub.cc index 8463db58e7039..45603795384a5 100644 --- a/google/cloud/bigtable/internal/bigtable_tracing_stub.cc +++ b/google/cloud/bigtable/internal/bigtable_tracing_stub.cc @@ -40,8 +40,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "ReadRows"); auto scope = opentelemetry::trace::Scope(span); internal::InjectTraceContext(*context, *propagator_); @@ -57,8 +56,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "SampleRowKeys"); auto scope = opentelemetry::trace::Scope(span); @@ -74,7 +72,7 @@ StatusOr BigtableTracingStub::MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "MutateRow"); auto scope = opentelemetry::trace::Scope(span); @@ -89,8 +87,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "MutateRows"); auto scope = opentelemetry::trace::Scope(span); @@ -106,7 +103,7 @@ StatusOr BigtableTracingStub::CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "CheckAndMutateRow"); auto scope = opentelemetry::trace::Scope(span); @@ -120,7 +117,7 @@ StatusOr BigtableTracingStub::PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "PingAndWarm"); auto scope = opentelemetry::trace::Scope(span); @@ -134,7 +131,7 @@ StatusOr BigtableTracingStub::ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "ReadModifyWriteRow"); auto scope = opentelemetry::trace::Scope(span); @@ -148,7 +145,7 @@ StatusOr BigtableTracingStub::PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "PrepareQuery"); auto scope = opentelemetry::trace::Scope(span); @@ -163,8 +160,7 @@ std::unique_ptr context, Options const& options, google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "ExecuteQuery"); auto scope = opentelemetry::trace::Scope(span); @@ -180,7 +176,7 @@ StatusOr BigtableTracingStub::GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) { + bigtable_internal::OperationContext& operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "GetClientConfiguration"); auto scope = opentelemetry::trace::Scope(span); @@ -196,8 +192,7 @@ std::unique_ptr< BigtableTracingStub::AsyncOpenTable( CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "OpenTable"); internal::OTelScope scope(span); @@ -216,8 +211,7 @@ std::unique_ptr< BigtableTracingStub::AsyncOpenAuthorizedView( CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "OpenAuthorizedView"); internal::OTelScope scope(span); @@ -236,8 +230,7 @@ std::unique_ptr< BigtableTracingStub::AsyncOpenMaterializedView( CompletionQueue const& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "OpenMaterializedView"); internal::OTelScope scope(span); @@ -257,8 +250,7 @@ BigtableTracingStub::AsyncReadRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "ReadRows"); internal::OTelScope scope(span); internal::InjectTraceContext(*context, *propagator_); @@ -276,8 +268,7 @@ BigtableTracingStub::AsyncSampleRowKeys( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "SampleRowKeys"); internal::OTelScope scope(span); @@ -295,8 +286,7 @@ BigtableTracingStub::AsyncMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "MutateRow"); internal::OTelScope scope(span); @@ -313,8 +303,7 @@ BigtableTracingStub::AsyncMutateRows( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "MutateRows"); internal::OTelScope scope(span); @@ -332,8 +321,7 @@ BigtableTracingStub::AsyncCheckAndMutateRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "CheckAndMutateRow"); internal::OTelScope scope(span); @@ -349,8 +337,7 @@ BigtableTracingStub::AsyncPingAndWarm( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "PingAndWarm"); internal::OTelScope scope(span); @@ -366,8 +353,7 @@ BigtableTracingStub::AsyncReadModifyWriteRow( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "ReadModifyWriteRow"); internal::OTelScope scope(span); @@ -383,8 +369,7 @@ BigtableTracingStub::AsyncPrepareQuery( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) { + std::shared_ptr operation_context) { auto span = internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "PrepareQuery"); internal::OTelScope scope(span); diff --git a/google/cloud/bigtable/internal/bigtable_tracing_stub.h b/google/cloud/bigtable/internal/bigtable_tracing_stub.h index 43a244dbc80bd..e393add68c3ca 100644 --- a/google/cloud/bigtable/internal/bigtable_tracing_stub.h +++ b/google/cloud/bigtable/internal/bigtable_tracing_stub.h @@ -43,136 +43,124 @@ class BigtableTracingStub : public BigtableStub { google::bigtable::v2::ReadRowsResponse>> ReadRows(std::shared_ptr context, Options const& options, google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; std::unique_ptr> - SampleRowKeys( - std::shared_ptr context, Options const& options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + SampleRowKeys(std::shared_ptr context, + Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; StatusOr MutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> MutateRows(std::shared_ptr context, Options const& options, google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr + std::shared_ptr operation_context) override; StatusOr CheckAndMutateRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PingAndWarm( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PingAndWarmRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr ReadModifyWriteRow( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; StatusOr PrepareQuery( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr> - ExecuteQuery( - std::shared_ptr context, Options const& options, - google::bigtable::v2::ExecuteQueryRequest const& request, - std::shared_ptr - operation_context) override; + ExecuteQuery(std::shared_ptr context, + Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request, + std::shared_ptr + operation_context) override; StatusOr GetClientConfiguration( grpc::ClientContext& context, Options const& options, google::bigtable::v2::GetClientConfigurationRequest const& request, - google::cloud::bigtable_internal::OperationContext& operation_context) - override; + bigtable_internal::OperationContext& operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenTable( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenTable(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenAuthorizedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenAuthorizedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::bigtable::v2::SessionRequest, google::bigtable::v2::SessionResponse>> - AsyncOpenMaterializedView( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - std::shared_ptr - operation_context) override; + AsyncOpenMaterializedView(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::ReadRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request, + std::shared_ptr + operation_context) override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::SampleRowKeysRequest const& request, - std::shared_ptr - operation_context) override; + AsyncSampleRowKeys(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncMutateRow( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::MutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows( - google::cloud::CompletionQueue const& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::MutateRowsRequest const& request, - std::shared_ptr - operation_context) override; + AsyncMutateRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request, + std::shared_ptr + operation_context) override; future> AsyncCheckAndMutateRow( @@ -180,16 +168,16 @@ class BigtableTracingStub : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncPingAndWarm( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PingAndWarmRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> AsyncReadModifyWriteRow( @@ -197,17 +185,16 @@ class BigtableTracingStub : public BigtableStub { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::ReadModifyWriteRowRequest const& request, - std::shared_ptr - operation_context) override; + std::shared_ptr operation_context) + override; future> - AsyncPrepareQuery( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::bigtable::v2::PrepareQueryRequest const& request, - std::shared_ptr - operation_context) override; + AsyncPrepareQuery(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request, + std::shared_ptr + operation_context) override; private: std::shared_ptr child_;