Skip to content

Commit 6436081

Browse files
committed
update handwritten MergeOptions
1 parent d4c31f8 commit 6436081

7 files changed

Lines changed: 17 additions & 16 deletions

File tree

google/cloud/bigtable/benchmarks/benchmark.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace google {
3232
namespace cloud {
3333
namespace bigtable {
3434
namespace benchmarks {
35+
using ::google::cloud::bigtable_internal::MergeOptions;
3536
using ::google::cloud::internal::GetEnv;
3637

3738
google::cloud::StatusOr<BenchmarkOptions> ParseArgs(
@@ -127,8 +128,7 @@ void Benchmark::DeleteTable() {
127128
}
128129

129130
Table Benchmark::MakeTable(Options connection_opts) const {
130-
auto connection_options =
131-
google::cloud::internal::MergeOptions(std::move(connection_opts), opts_);
131+
auto connection_options = MergeOptions(std::move(connection_opts), opts_);
132132
auto table_opts = Options{}.set<AppProfileIdOption>(options_.app_profile_id);
133133
return Table(MakeDataConnection(std::move(connection_options)),
134134
TableResource(options_.project_id, options_.instance_id,

google/cloud/bigtable/client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace cloud {
2121
namespace bigtable {
2222
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2323

24-
using ::google::cloud::internal::MergeOptions;
24+
using ::google::cloud::bigtable_internal::MergeOptions;
2525
using ::google::cloud::internal::OptionsSpan;
2626

2727
StatusOr<PreparedQuery> Client::PrepareQuery(InstanceResource const& instance,

google/cloud/bigtable/client.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "google/cloud/bigtable/bound_query.h"
1919
#include "google/cloud/bigtable/data_connection.h"
2020
#include "google/cloud/bigtable/instance_resource.h"
21+
#include "google/cloud/bigtable/options.h"
2122
#include "google/cloud/bigtable/prepared_query.h"
2223
#include "google/cloud/bigtable/sql_statement.h"
2324
#include "google/cloud/bigtable/version.h"
@@ -62,8 +63,8 @@ class Client {
6263
*/
6364
explicit Client(std::shared_ptr<DataConnection> conn, Options opts = {})
6465
: conn_(std::move(conn)),
65-
opts_(google::cloud::internal::MergeOptions(std::move(opts),
66-
conn_->options())) {}
66+
opts_(bigtable_internal::MergeOptions(std::move(opts),
67+
conn_->options())) {}
6768

6869
/**
6970
* Prepares a query for future execution.

google/cloud/bigtable/internal/data_connection_impl.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ namespace bigtable_internal {
4848
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
4949
namespace {
5050

51+
using ::google::cloud::bigtable_internal::MergeOptions;
52+
5153
inline std::string const& app_profile_id(Options const& options) {
5254
return options.get<bigtable::AppProfileIdOption>();
5355
}
@@ -224,8 +226,7 @@ DataConnectionImpl::DataConnectionImpl(
224226
: background_(std::move(background)),
225227
stub_manager_(std::move(stub_manager)),
226228
limiter_(std::move(limiter)),
227-
options_(internal::MergeOptions(std::move(options),
228-
DataConnection::options())) {
229+
options_(MergeOptions(std::move(options), DataConnection::options())) {
229230
#ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS
230231
if (options_.get<bigtable::EnableMetricsOption>()) {
231232
// The client_uid is eventually used in conjunction with other data labels
@@ -264,8 +265,7 @@ DataConnectionImpl::DataConnectionImpl(
264265
stub_manager_(std::move(stub_manager)),
265266
operation_context_factory_(std::move(operation_context_factory)),
266267
limiter_(std::move(limiter)),
267-
options_(internal::MergeOptions(std::move(options),
268-
DataConnection::options())) {}
268+
options_(MergeOptions(std::move(options), DataConnection::options())) {}
269269

270270
DataConnectionImpl::DataConnectionImpl(
271271
std::unique_ptr<BackgroundThreads> background,

google/cloud/bigtable/internal/defaults.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ namespace cloud {
3636
namespace bigtable {
3737
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3838
namespace internal {
39-
4039
namespace {
4140

41+
using ::google::cloud::bigtable_internal::MergeOptions;
42+
4243
auto constexpr kBackoffScaling = 2.0;
4344

4445
// As learned from experiments, idle gRPC connections enter IDLE state after 4m.
@@ -219,8 +220,7 @@ Options DefaultOptions(Options opts) {
219220
::google::cloud::internal::DefaultTracingOptions())
220221
.set<GrpcNumChannelsOption>(DefaultConnectionPoolSize());
221222

222-
opts = google::cloud::internal::MergeOptions(std::move(opts),
223-
std::move(defaults));
223+
opts = MergeOptions(std::move(opts), std::move(defaults));
224224

225225
if (!emulator) opts = DefaultConnectionRefreshOptions(std::move(opts));
226226
opts = DefaultChannelArgumentOptions(std::move(opts));

google/cloud/bigtable/table.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace cloud {
2222
namespace bigtable {
2323
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2424

25-
using ::google::cloud::internal::MergeOptions;
25+
using ::google::cloud::bigtable_internal::MergeOptions;
2626
using ::google::cloud::internal::OptionsSpan;
2727

2828
namespace {

google/cloud/bigtable/table.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ class Table {
194194
: table_(std::move(tr)),
195195
table_name_(table_.FullName()),
196196
connection_(std::move(conn)),
197-
options_(google::cloud::internal::MergeOptions(
198-
std::move(options), connection_->options())) {}
197+
options_(bigtable_internal::MergeOptions(std::move(options),
198+
connection_->options())) {}
199199

200200
std::string const& table_name() const { return table_name_; }
201201
std::string const& app_profile_id() const {
@@ -755,7 +755,7 @@ class Table {
755755
};
756756

757757
google::cloud::internal::OptionsSpan span(
758-
google::cloud::internal::MergeOptions(std::move(opts), options_));
758+
bigtable_internal::MergeOptions(std::move(opts), options_));
759759
connection_->AsyncReadRows(table_name_, std::move(on_row_fn),
760760
std::move(on_finish_fn), std::move(row_set),
761761
rows_limit, std::move(filter));

0 commit comments

Comments
 (0)