Skip to content

Commit 9429a07

Browse files
authored
impl(v3): revert #15912 (#15913)
1 parent 2b9130f commit 9429a07

11 files changed

Lines changed: 1 addition & 119 deletions

generator/generator_config.proto

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@ message ServiceConfiguration {
167167
// RPCs. If set to false (the default), a no-op resumption function will be
168168
// generated.
169169
bool omit_streaming_updater = 29;
170-
171-
// In rare cases, specifically bigtable::WaitForConsistency, the
172-
// CompletionQueue from the BackgroundThreads owned by the Connection is
173-
// needed elsewhere. This emits a protected accessor and friend function for
174-
// that purpose.
175-
bool emit_completion_queue_accessor = 30;
176170
}
177171

178172
message DiscoveryDocumentDefinedProduct {

generator/generator_config.textproto

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ service {
588588
{rpc_name: "BigtableTableAdmin.CheckConsistency", idempotency: IDEMPOTENT}
589589
]
590590
omit_repo_metadata: true
591-
emit_completion_queue_accessor: true
592591
}
593592
594593
# Billing

generator/internal/connection_generator.cc

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ Status ConnectionGenerator::GenerateHeader() {
5757
{vars("idempotency_policy_header_path"), vars("retry_traits_header_path"),
5858
HasLongrunningMethod() ? "google/cloud/no_await_tag.h" : "",
5959
IsExperimental() ? "google/cloud/experimental_tag.h" : "",
60-
HasEmitCompletionQueueAccessor() ? "google/cloud/completion_queue.h"
61-
: "",
6260
"google/cloud/backoff_policy.h",
6361
HasLongrunningMethod() || HasAsyncMethod() ? "google/cloud/future.h"
6462
: "",
@@ -93,21 +91,7 @@ Status ConnectionGenerator::GenerateHeader() {
9391
}
9492
}
9593

96-
Status result;
97-
if (HasEmitCompletionQueueAccessor()) {
98-
result = HeaderOpenNamespaces();
99-
if (!result.ok()) return result;
100-
HeaderPrint(R"""(class $connection_class_name$;)""");
101-
HeaderCloseNamespaces();
102-
103-
result = HeaderOpenNamespaces(NamespaceType::kInternal);
104-
if (!result.ok()) return result;
105-
HeaderPrint(
106-
R"""(StatusOr<CompletionQueue> completion_queue($product_namespace$::$connection_class_name$ const& conn);)""");
107-
HeaderCloseNamespaces();
108-
}
109-
110-
result = HeaderOpenNamespaces();
94+
auto result = HeaderOpenNamespaces();
11195
if (!result.ok()) return result;
11296

11397
HeaderPrint(R"""(
@@ -331,13 +315,6 @@ class $connection_class_name$ {
331315
__FILE__, __LINE__);
332316
}
333317

334-
if (HasEmitCompletionQueueAccessor()) {
335-
HeaderPrint(R"""( protected:
336-
friend StatusOr<CompletionQueue> $product_internal_namespace$::completion_queue(
337-
$connection_class_name$ const& conn);
338-
virtual StatusOr<CompletionQueue> completion_queue() const;
339-
)""");
340-
}
341318
// close abstract interface Connection base class
342319
HeaderPrint("};\n");
343320

@@ -513,15 +490,6 @@ future<StatusOr<$response_type$>>
513490
__FILE__, __LINE__);
514491
}
515492

516-
if (HasEmitCompletionQueueAccessor()) {
517-
CcPrint(
518-
R"""(
519-
StatusOr<CompletionQueue> $connection_class_name$::completion_queue() const {
520-
return Status(StatusCode::kUnimplemented, "not implemented");
521-
}
522-
)""");
523-
}
524-
525493
if (HasGenerateGrpcTransport()) {
526494
EmitFactoryFunctionDefinition(EndpointLocationStyle());
527495
}

generator/internal/connection_impl_generator.cc

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,6 @@ class $connection_class_name$Impl
133133
std::make_shared<google::cloud::internal::InvocationIdGenerator>();)""");
134134
}
135135

136-
if (HasEmitCompletionQueueAccessor()) {
137-
HeaderPrint(
138-
R"""(
139-
StatusOr<CompletionQueue> completion_queue() const override;
140-
)""");
141-
}
142-
143136
// This closes the *ConnectionImpl class definition.
144137
HeaderPrint("\n};\n");
145138

@@ -215,15 +208,6 @@ std::unique_ptr<PollingPolicy> polling_policy(Options const& options) {
215208
} // namespace
216209
)""");
217210

218-
if (HasEmitCompletionQueueAccessor()) {
219-
CcPrint(R"""(
220-
StatusOr<CompletionQueue> completion_queue(
221-
$product_namespace$::$connection_class_name$ const& conn) {
222-
return conn.completion_queue();
223-
}
224-
)""");
225-
}
226-
227211
// streaming updater functions
228212
if (!OmitStreamingUpdater(vars())) {
229213
for (auto const& method : methods()) {
@@ -258,14 +242,6 @@ void $service_name$$method_name$StreamingUpdater(
258242
CcPrintMethod(method, __FILE__, __LINE__, AsyncMethodDefinition(method));
259243
}
260244

261-
if (HasEmitCompletionQueueAccessor()) {
262-
CcPrint(R"""(
263-
StatusOr<CompletionQueue> $connection_class_name$Impl::completion_queue() const {
264-
return background_->cq();
265-
}
266-
)""");
267-
}
268-
269245
CcCloseNamespaces();
270246
return {};
271247
}

generator/internal/service_code_generator.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,6 @@ bool ServiceCodeGenerator::IsDeprecated() const {
511511
return service_descriptor_->options().deprecated();
512512
}
513513

514-
bool ServiceCodeGenerator::HasEmitCompletionQueueAccessor() const {
515-
return vars().find("emit_completion_queue_accessor") != vars().end() &&
516-
vars().at("emit_completion_queue_accessor") == "true";
517-
}
518-
519514
} // namespace generator_internal
520515
} // namespace cloud
521516
} // namespace google

generator/internal/service_code_generator.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ class ServiceCodeGenerator : public GeneratorInterface {
246246
*/
247247
bool IsDeprecated() const;
248248

249-
bool HasEmitCompletionQueueAccessor() const;
250-
251249
private:
252250
void SetMethods();
253251

generator/standalone_main.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,6 @@ std::vector<std::future<google::cloud::Status>> GenerateCodeFromProtos(
296296
if (service.omit_streaming_updater()) {
297297
args.emplace_back("--cpp_codegen_opt=omit_streaming_updater=true");
298298
}
299-
if (service.emit_completion_queue_accessor()) {
300-
args.emplace_back(
301-
"--cpp_codegen_opt=emit_completion_queue_accessor=true");
302-
}
303-
304299
if (service.generate_round_robin_decorator()) {
305300
args.emplace_back(
306301
"--cpp_codegen_opt=generate_round_robin_decorator=true");

google/cloud/bigtable/admin/bigtable_table_admin_connection.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,6 @@ BigtableTableAdminConnection::AsyncCheckConsistency(
382382
Status(StatusCode::kUnimplemented, "not implemented"));
383383
}
384384

385-
StatusOr<CompletionQueue> BigtableTableAdminConnection::completion_queue()
386-
const {
387-
return Status(StatusCode::kUnimplemented, "not implemented");
388-
}
389-
390385
std::shared_ptr<BigtableTableAdminConnection> MakeBigtableTableAdminConnection(
391386
Options options) {
392387
internal::CheckExpectedOptions<CommonOptionList, GrpcOptionList,

google/cloud/bigtable/admin/bigtable_table_admin_connection.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "google/cloud/bigtable/admin/bigtable_table_admin_connection_idempotency_policy.h"
2323
#include "google/cloud/bigtable/admin/internal/bigtable_table_admin_retry_traits.h"
2424
#include "google/cloud/backoff_policy.h"
25-
#include "google/cloud/completion_queue.h"
2625
#include "google/cloud/future.h"
2726
#include "google/cloud/internal/retry_policy_impl.h"
2827
#include "google/cloud/no_await_tag.h"
@@ -35,27 +34,6 @@
3534
#include "google/longrunning/operations.grpc.pb.h"
3635
#include <memory>
3736

38-
namespace google {
39-
namespace cloud {
40-
namespace bigtable_admin {
41-
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
42-
class BigtableTableAdminConnection;
43-
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
44-
} // namespace bigtable_admin
45-
} // namespace cloud
46-
} // namespace google
47-
48-
namespace google {
49-
namespace cloud {
50-
namespace bigtable_admin_internal {
51-
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
52-
StatusOr<CompletionQueue> completion_queue(
53-
bigtable_admin::BigtableTableAdminConnection const& conn);
54-
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
55-
} // namespace bigtable_admin_internal
56-
} // namespace cloud
57-
} // namespace google
58-
5937
namespace google {
6038
namespace cloud {
6139
namespace bigtable_admin {
@@ -381,11 +359,6 @@ class BigtableTableAdminConnection {
381359
StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>>
382360
AsyncCheckConsistency(
383361
google::bigtable::admin::v2::CheckConsistencyRequest const& request);
384-
385-
protected:
386-
friend StatusOr<CompletionQueue> bigtable_admin_internal::completion_queue(
387-
BigtableTableAdminConnection const& conn);
388-
virtual StatusOr<CompletionQueue> completion_queue() const;
389362
};
390363

391364
/**

google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ std::unique_ptr<PollingPolicy> polling_policy(Options const& options) {
6060

6161
} // namespace
6262

63-
StatusOr<CompletionQueue> completion_queue(
64-
bigtable_admin::BigtableTableAdminConnection const& conn) {
65-
return conn.completion_queue();
66-
}
67-
6863
BigtableTableAdminConnectionImpl::BigtableTableAdminConnectionImpl(
6964
std::unique_ptr<google::cloud::BackgroundThreads> background,
7065
std::shared_ptr<bigtable_admin_internal::BigtableTableAdminStub> stub,
@@ -1298,11 +1293,6 @@ BigtableTableAdminConnectionImpl::AsyncCheckConsistency(
12981293
std::move(current), std::move(request_copy), __func__);
12991294
}
13001295

1301-
StatusOr<CompletionQueue> BigtableTableAdminConnectionImpl::completion_queue()
1302-
const {
1303-
return background_->cq();
1304-
}
1305-
13061296
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
13071297
} // namespace bigtable_admin_internal
13081298
} // namespace cloud

0 commit comments

Comments
 (0)