@@ -136,9 +136,8 @@ class DefaultAdminClient : public google::cloud::bigtable::AdminClient {
136136 // Introduce an early `private:` section because this type is used to define
137137 // the public interface, it should not be part of the public interface.
138138 struct AdminTraits {
139- static std::string const & Endpoint (
140- google::cloud::bigtable::ClientOptions& options) {
141- return options.admin_endpoint ();
139+ static std::string const & Endpoint (Options const & options) {
140+ return options.get <AdminEndpointOption>();
142141 }
143142 };
144143
@@ -148,8 +147,7 @@ class DefaultAdminClient : public google::cloud::bigtable::AdminClient {
148147 public:
149148 using AdminStubPtr = Impl::StubPtr;
150149
151- DefaultAdminClient (std::string project,
152- google::cloud::bigtable::ClientOptions options)
150+ DefaultAdminClient (std::string project, Options options)
153151 : project_(std::move(project)), impl_(std::move(options)) {}
154152
155153 std::string const & project () const override { return project_; }
@@ -438,26 +436,36 @@ class DefaultAdminClient : public google::cloud::bigtable::AdminClient {
438436
439437 private:
440438 google::cloud::BackgroundThreadsFactory BackgroundThreadsFactory () override {
441- return impl_.Options (). background_threads_factory ();
439+ return impl_.BackgroundThreadsFactory ();
442440 }
443441
444442 std::string project_;
445443 Impl impl_;
446444};
447445
448- std::shared_ptr<AdminClient> CreateDefaultAdminClient (
449- std::string project,
450- ClientOptions options) { // NOLINT(performance-unnecessary-value-param)
451- std::shared_ptr<AdminClient> client =
452- std::make_shared<DefaultAdminClient>(std::move (project), options);
453- if (options.tracing_enabled (" rpc" )) {
446+ std::shared_ptr<AdminClient> MakeAdminClient (std::string project,
447+ Options options) {
448+ options = internal::DefaultOptions (std::move (options));
449+ bool tracing_enabled = google::cloud::internal::Contains (
450+ options.get <TracingComponentsOption>(), " rpc" );
451+ auto tracing_options = options.get <GrpcTracingOptionsOption>();
452+
453+ std::shared_ptr<AdminClient> client = std::make_shared<DefaultAdminClient>(
454+ std::move (project), std::move (options));
455+ if (tracing_enabled) {
454456 GCP_LOG (INFO) << " Enabled logging for gRPC calls" ;
455457 client = std::make_shared<internal::LoggingAdminClient>(
456- std::move (client), options. tracing_options ( ));
458+ std::move (client), std::move (tracing_options ));
457459 }
458460 return client;
459461}
460462
463+ std::shared_ptr<AdminClient> CreateDefaultAdminClient (std::string project,
464+ ClientOptions options) {
465+ return MakeAdminClient (std::move (project),
466+ internal::MakeOptions (std::move (options)));
467+ }
468+
461469} // namespace BIGTABLE_CLIENT_NS
462470} // namespace bigtable
463471} // namespace cloud
0 commit comments