Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions generator/generator_config.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ service {
"ReadModifyWriteRow",
"ReadRows",
"SampleRowKeys",
"PingAndWarm",
"PrepareQuery"
]
omit_repo_metadata: true
Expand Down
21 changes: 21 additions & 0 deletions google/cloud/bigtable/internal/bigtable_auth_decorator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,27 @@ BigtableAuth::AsyncCheckAndMutateRow(
});
}

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
BigtableAuth::AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) {
return auth_->AsyncConfigureContext(std::move(context))
.then([cq, child = child_, options = std::move(options),
request](future<StatusOr<std::shared_ptr<grpc::ClientContext>>>
f) mutable {
auto context = f.get();
if (!context) {
return make_ready_future(
StatusOr<google::bigtable::v2::PingAndWarmResponse>(
std::move(context).status()));
}
return child->AsyncPingAndWarm(cq, *std::move(context),
std::move(options), request);
});
}

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
BigtableAuth::AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/bigtable/internal/bigtable_auth_decorator.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ class BigtableAuth : public BigtableStub {
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::CheckAndMutateRowRequest const& request) override;

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>> AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) override;

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
10 changes: 10 additions & 0 deletions google/cloud/bigtable/internal/bigtable_channel_refresh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ BigtableChannelRefresh::AsyncCheckAndMutateRow(
std::move(options), request);
}

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
BigtableChannelRefresh::AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) {
return child_->AsyncPingAndWarm(cq, std::move(context), std::move(options),
request);
}

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
BigtableChannelRefresh::AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/bigtable/internal/bigtable_channel_refresh.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ class BigtableChannelRefresh : public BigtableStub {
google::cloud::internal::ImmutableOptions,
google::bigtable::v2::CheckAndMutateRowRequest const& request) override;

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>> AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) override;

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
18 changes: 18 additions & 0 deletions google/cloud/bigtable/internal/bigtable_logging_decorator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,24 @@ BigtableLogging::AsyncCheckAndMutateRow(
tracing_options_);
}

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
BigtableLogging::AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) {
return google::cloud::internal::LogWrapper(
[this](google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) {
return child_->AsyncPingAndWarm(cq, std::move(context),
std::move(options), request);
},
cq, std::move(context), std::move(options), request, __func__,
tracing_options_);
}

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
BigtableLogging::AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/bigtable/internal/bigtable_logging_decorator.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ class BigtableLogging : public BigtableStub {
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::CheckAndMutateRowRequest const& request) override;

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>> AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) override;

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
36 changes: 36 additions & 0 deletions google/cloud/bigtable/internal/bigtable_metadata_decorator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,42 @@ BigtableMetadata::AsyncCheckAndMutateRow(
std::move(options), request);
}

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
BigtableMetadata::AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) {
std::vector<std::string> params;
params.reserve(2);

static auto* name_matcher = [] {
return new google::cloud::internal::RoutingMatcher<
google::bigtable::v2::PingAndWarmRequest>{
"name=",
{
{[](google::bigtable::v2::PingAndWarmRequest const& request)
-> std::string const& { return request.name(); },
std::regex{"(projects/[^/]+/instances/[^/]+)",
std::regex::optimize}},
}};
}();
name_matcher->AppendParam(request, params);

if (!request.app_profile_id().empty()) {
params.push_back(absl::StrCat(
"app_profile_id=", internal::UrlEncode(request.app_profile_id())));
}

if (params.empty()) {
SetMetadata(*context, *options);
} else {
SetMetadata(*context, *options, absl::StrJoin(params, "&"));
}
return child_->AsyncPingAndWarm(cq, std::move(context), std::move(options),
request);
}

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
BigtableMetadata::AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ class BigtableMetadata : public BigtableStub {
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::CheckAndMutateRowRequest const& request) override;

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>> AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) override;

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ BigtableRoundRobin::AsyncCheckAndMutateRow(
std::move(options), request);
}

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
BigtableRoundRobin::AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) {
return Child()->AsyncPingAndWarm(cq, std::move(context), std::move(options),
request);
}

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
BigtableRoundRobin::AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ class BigtableRoundRobin : public BigtableStub {
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::CheckAndMutateRowRequest const& request) override;

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>> AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) override;

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
18 changes: 18 additions & 0 deletions google/cloud/bigtable/internal/bigtable_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,24 @@ DefaultBigtableStub::AsyncCheckAndMutateRow(
request, std::move(context));
}

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
DefaultBigtableStub::AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
google::cloud::internal::ImmutableOptions,
google::bigtable::v2::PingAndWarmRequest const& request) {
return internal::MakeUnaryRpcImpl<google::bigtable::v2::PingAndWarmRequest,
google::bigtable::v2::PingAndWarmResponse>(
cq,
[this](grpc::ClientContext* context,
google::bigtable::v2::PingAndWarmRequest const& request,
grpc::CompletionQueue* cq) {
return grpc_stub_->AsyncPingAndWarm(context, request, cq);
},
request, std::move(context));
}

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
DefaultBigtableStub::AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
12 changes: 12 additions & 0 deletions google/cloud/bigtable/internal/bigtable_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ class BigtableStub {
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::CheckAndMutateRowRequest const& request) = 0;

virtual future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
AsyncPingAndWarm(google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) = 0;

virtual future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down Expand Up @@ -222,6 +228,12 @@ class DefaultBigtableStub : public BigtableStub {
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::CheckAndMutateRowRequest const& request) override;

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>> AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) override;

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
14 changes: 14 additions & 0 deletions google/cloud/bigtable/internal/bigtable_tracing_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@ BigtableTracingStub::AsyncCheckAndMutateRow(
return internal::EndSpan(std::move(context), std::move(span), std::move(f));
}

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>
BigtableTracingStub::AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) {
auto span =
internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "PingAndWarm");
internal::OTelScope scope(span);
internal::InjectTraceContext(*context, *propagator_);
auto f = child_->AsyncPingAndWarm(cq, context, std::move(options), request);
return internal::EndSpan(std::move(context), std::move(span), std::move(f));
}

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
BigtableTracingStub::AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/bigtable/internal/bigtable_tracing_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ class BigtableTracingStub : public BigtableStub {
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::CheckAndMutateRowRequest const& request) override;

future<StatusOr<google::bigtable::v2::PingAndWarmResponse>> AsyncPingAndWarm(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::bigtable::v2::PingAndWarmRequest const& request) override;

future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>
AsyncReadModifyWriteRow(
google::cloud::CompletionQueue& cq,
Expand Down
7 changes: 7 additions & 0 deletions google/cloud/bigtable/testing/mock_bigtable_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ class MockBigtableStub : public bigtable_internal::BigtableStub {
google::cloud::internal::ImmutableOptions,
google::bigtable::v2::CheckAndMutateRowRequest const&),
(override));
MOCK_METHOD(future<StatusOr<google::bigtable::v2::PingAndWarmResponse>>,
AsyncPingAndWarm,
(google::cloud::CompletionQueue&,
std::shared_ptr<grpc::ClientContext>,
google::cloud::internal::ImmutableOptions,
google::bigtable::v2::PingAndWarmRequest const&),
(override));
MOCK_METHOD(
future<StatusOr<google::bigtable::v2::ReadModifyWriteRowResponse>>,
AsyncReadModifyWriteRow,
Expand Down