Skip to content

Commit b3258cc

Browse files
committed
formatting
1 parent 4b26f8d commit b3258cc

4 files changed

Lines changed: 47 additions & 36 deletions

File tree

google/cloud/bigtable/tests/admin_integration_test.cc

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ TEST_F(TableAdminIntegrationTest, TableListWithMultipleTables) {
8484

8585
// Delete the tables so future tests have a clean slate.
8686
for (auto const& table_id : ids) {
87-
EXPECT_STATUS_OK(table_admin_->DeleteTable(TableName(project_id(), instance_id(), table_id)));
87+
EXPECT_STATUS_OK(table_admin_->DeleteTable(
88+
TableName(project_id(), instance_id(), table_id)));
8889
}
8990

9091
// Verify the tables were deleted.
@@ -257,11 +258,13 @@ TEST_F(TableAdminIntegrationTest, WaitForConsistencyCheck) {
257258

258259
// Create a bigtable::InstanceAdmin and a bigtable::TableAdmin to create the
259260
// new instance and the new table.
260-
auto instance_admin = std::make_unique<bigtable_admin::BigtableInstanceAdminClient>(
261-
bigtable_admin::MakeBigtableInstanceAdminConnection());
262-
auto table_admin_connection = bigtable_admin::MakeBigtableTableAdminConnection();
261+
auto instance_admin =
262+
std::make_unique<bigtable_admin::BigtableInstanceAdminClient>(
263+
bigtable_admin::MakeBigtableInstanceAdminConnection());
264+
auto table_admin_connection =
265+
bigtable_admin::MakeBigtableTableAdminConnection();
263266
auto table_admin = std::make_unique<bigtable_admin::BigtableTableAdminClient>(
264-
table_admin_connection);
267+
table_admin_connection);
265268

266269
// The instance configuration is involved, it needs two clusters, which must
267270
// be production clusters (and therefore have at least 3 nodes each), and
@@ -319,9 +322,10 @@ TEST_F(TableAdminIntegrationTest, WaitForConsistencyCheck) {
319322

320323
// Wait until all the mutations before the `consistency_token` have propagated
321324
// everywhere.
322-
google::cloud::future<google::cloud::StatusOr<bigtable_admin::Consistency>> result =
323-
google::cloud::bigtable_admin::WaitForConsistency(table_admin_connection,
324-
table_created->name(), consistency_token->consistency_token());
325+
google::cloud::future<google::cloud::StatusOr<bigtable_admin::Consistency>>
326+
result = google::cloud::bigtable_admin::WaitForConsistency(
327+
table_admin_connection, table_created->name(),
328+
consistency_token->consistency_token());
325329
auto is_consistent = result.get();
326330
ASSERT_STATUS_OK(is_consistent);
327331
EXPECT_EQ(bigtable_admin::Consistency::kConsistent, *is_consistent);
@@ -341,18 +345,19 @@ TEST_F(TableAdminIntegrationTest, CreateListGetDeleteTableWithLogging) {
341345
absl::nullopt};
342346
testing_util::ScopedLog log;
343347

344-
auto const instance_name = bigtable::InstanceName(project_id(), instance_id());
348+
auto const instance_name =
349+
bigtable::InstanceName(project_id(), instance_id());
345350

346351
auto const table_id = RandomTableId();
347352
auto const table_name =
348353
bigtable::TableName(project_id(), instance_id(), table_id);
349354

350-
// std::shared_ptr<bigtable::AdminClient> admin_client =
351-
// bigtable::MakeAdminClient(
352-
// bigtable::testing::TableTestEnvironment::project_id(),
353-
// Options{}.set<LoggingComponentsOption>({"rpc"}));
354-
// auto table_admin = std::make_unique<bigtable::TableAdmin>(
355-
// admin_client, bigtable::testing::TableTestEnvironment::instance_id());
355+
// std::shared_ptr<bigtable::AdminClient> admin_client =
356+
// bigtable::MakeAdminClient(
357+
// bigtable::testing::TableTestEnvironment::project_id(),
358+
// Options{}.set<LoggingComponentsOption>({"rpc"}));
359+
// auto table_admin = std::make_unique<bigtable::TableAdmin>(
360+
// admin_client, bigtable::testing::TableTestEnvironment::instance_id());
356361

357362
auto table_admin = std::make_unique<bigtable_admin::BigtableTableAdminClient>(
358363
bigtable_admin::MakeBigtableTableAdminConnection(
@@ -409,12 +414,17 @@ TEST_F(TableAdminIntegrationTest, CreateListGetDeleteTableWithLogging) {
409414
EXPECT_EQ(1, count_matching_families(*table_detailed, "foo"));
410415

411416
// Update table
412-
std::vector<google::bigtable::admin::v2::ModifyColumnFamiliesRequest::Modification> column_modification_list = {
413-
bigtable::ColumnFamilyModification::Create(
414-
"newfam", GC::Intersection(GC::MaxAge(std::chrono::hours(7 * 24)),
415-
GC::MaxNumVersions(1))).as_proto(),
416-
bigtable::ColumnFamilyModification::Update("fam", GC::MaxNumVersions(2)).as_proto(),
417-
bigtable::ColumnFamilyModification::Drop("foo").as_proto()};
417+
std::vector<
418+
google::bigtable::admin::v2::ModifyColumnFamiliesRequest::Modification>
419+
column_modification_list = {
420+
bigtable::ColumnFamilyModification::Create(
421+
"newfam", GC::Intersection(GC::MaxAge(std::chrono::hours(7 * 24)),
422+
GC::MaxNumVersions(1)))
423+
.as_proto(),
424+
bigtable::ColumnFamilyModification::Update("fam",
425+
GC::MaxNumVersions(2))
426+
.as_proto(),
427+
bigtable::ColumnFamilyModification::Drop("foo").as_proto()};
418428

419429
auto table_modified =
420430
table_admin->ModifyColumnFamilies(table_name, column_modification_list);
@@ -446,8 +456,7 @@ TEST_F(TableAdminIntegrationTest, CreateListGetDeleteTableWithLogging) {
446456
EXPECT_THAT(log_lines, Contains(HasSubstr("DeleteTable")));
447457

448458
// Verify that a normal client does not log.
449-
auto no_logging_client =
450-
bigtable_admin::BigtableTableAdminClient(
459+
auto no_logging_client = bigtable_admin::BigtableTableAdminClient(
451460
bigtable_admin::MakeBigtableTableAdminConnection());
452461
(void)no_logging_client.ListTables(list_request);
453462
EXPECT_THAT(log.ExtractLines(), Not(Contains(HasSubstr("ListTables"))));

google/cloud/bigtable/tests/instance_admin_integration_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ TEST_F(InstanceAdminIntegrationTest, CustomWorkers) {
510510

511511
// CompletionQueue `cq` is not being `Run()`, so this should never finish.
512512
auto const instance_id = RandomInstanceId(generator_);
513-
auto create_request = IntegrationTestConfig(instance_id, zone_a_,
513+
auto create_request =
514+
IntegrationTestConfig(instance_id, zone_a_,
514515
bigtable::InstanceConfig::PRODUCTION, 3)
515516
.as_proto();
516517
create_request.set_parent(Project(project_id_).FullName());
@@ -522,7 +523,8 @@ TEST_F(InstanceAdminIntegrationTest, CustomWorkers) {
522523
std::thread t([cq]() mutable { cq.Run(); });
523524
auto instance = instance_fut.get();
524525
ASSERT_STATUS_OK(instance);
525-
EXPECT_STATUS_OK(instance_admin_->DeleteInstance(InstanceName(project_id_, instance_id)));
526+
EXPECT_STATUS_OK(
527+
instance_admin_->DeleteInstance(InstanceName(project_id_, instance_id)));
526528

527529
cq.CancelAll();
528530
cq.Shutdown();

google/cloud/bigtable/wait_for_consistency.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
#include "google/cloud/bigtable/wait_for_consistency.h"
1616
#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h"
17-
#include "google/cloud/bigtable/resource_names.h"
1817
#include "google/cloud/bigtable/admin/bigtable_table_admin_options.h"
1918
#include "google/cloud/bigtable/admin/internal/bigtable_table_admin_option_defaults.h"
19+
#include "google/cloud/bigtable/resource_names.h"
2020
#include "google/cloud/internal/make_status.h"
2121
#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h"
2222
#include <chrono>
@@ -26,11 +26,10 @@ namespace cloud {
2626
namespace bigtable_admin {
2727
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2828

29-
3029
google::cloud::future<StatusOr<Consistency>> WaitForConsistency(
31-
std::shared_ptr<BigtableTableAdminConnection> const& connection,
32-
std::string const& table_id, std::string const& consistency_token,
33-
Options options) {
30+
std::shared_ptr<BigtableTableAdminConnection> const& connection,
31+
std::string const& table_id, std::string const& consistency_token,
32+
Options options) {
3433
auto cq = bigtable_admin_internal::completion_queue(*connection);
3534
if (!cq.ok()) return make_ready_future(StatusOr<Consistency>(cq.status()));
3635

@@ -41,9 +40,9 @@ google::cloud::future<StatusOr<Consistency>> WaitForConsistency(
4140
// ownership cycle. We have made this mistake before. See #7740 for more
4241
// details.
4342
auto client = bigtable_admin::BigtableTableAdminClient(connection);
44-
return bigtable_admin::AsyncWaitForConsistency(*std::move(cq), std::move(client),
45-
table_id,
46-
consistency_token, std::move(options))
43+
return bigtable_admin::AsyncWaitForConsistency(
44+
*std::move(cq), std::move(client), table_id, consistency_token,
45+
std::move(options))
4746
.then([](future<Status> f) -> StatusOr<Consistency> {
4847
auto s = f.get();
4948
if (!s.ok()) return s;
@@ -81,7 +80,8 @@ class AsyncWaitForConsistencyImpl
8180
}
8281

8382
private:
84-
using RespType = StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>;
83+
using RespType =
84+
StatusOr<google::bigtable::admin::v2::CheckConsistencyResponse>;
8585
using TimerResult = StatusOr<std::chrono::system_clock::time_point>;
8686

8787
struct State {

google/cloud/bigtable/wait_for_consistency.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ enum class Consistency {
3434

3535
google::cloud::future<StatusOr<Consistency>> WaitForConsistency(
3636
std::shared_ptr<BigtableTableAdminConnection> const& connection,
37-
std::string const& table_id, std::string const& consistency_token,
38-
Options options = {});
37+
std::string const& table_id, std::string const& consistency_token,
38+
Options options = {});
3939

4040
/**
4141
* Polls until a table is consistent, or until the polling policy has expired.

0 commit comments

Comments
 (0)