From 00dce3ca1dba9f31dcb5edae06eac74791a892bd Mon Sep 17 00:00:00 2001 From: Chaoguang Lin Date: Mon, 18 May 2020 14:23:17 -0700 Subject: [PATCH] clang-format --- fdbclient/NativeAPI.actor.cpp | 3 ++- fdbclient/SpecialKeySpace.actor.cpp | 9 ++++++--- fdbclient/SystemData.cpp | 3 ++- fdbserver/workloads/DataDistributionMetrics.actor.cpp | 9 +++++---- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index 8aacba3527..aac84db38e 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -607,7 +607,8 @@ DatabaseContext::DatabaseContext(Reference(conflictingKeysRange)); registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, std::make_unique(readConflictRangeKeysRange)); registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, std::make_unique(writeConflictRangeKeysRange)); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::METRICS, std::make_unique(ddStatsRange)); + registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::METRICS, + std::make_unique(ddStatsRange)); registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::WORKERINTERFACE, std::make_unique(KeyRangeRef( LiteralStringRef("\xff\xff/worker_interfaces/"), LiteralStringRef("\xff\xff/worker_interfaces0")))); registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::STATUSJSON, std::make_unique( diff --git a/fdbclient/SpecialKeySpace.actor.cpp b/fdbclient/SpecialKeySpace.actor.cpp index ca5eee6796..689eddeca2 100644 --- a/fdbclient/SpecialKeySpace.actor.cpp +++ b/fdbclient/SpecialKeySpace.actor.cpp @@ -30,7 +30,8 @@ std::unordered_map SpecialKeySpace::moduleToB { SpecialKeySpace::MODULE::STATUSJSON, singleKeyRange(LiteralStringRef("\xff\xff/status/json")) }, { SpecialKeySpace::MODULE::CONNECTIONSTRING, singleKeyRange(LiteralStringRef("\xff\xff/connection_string")) }, { SpecialKeySpace::MODULE::CLUSTERFILEPATH, singleKeyRange(LiteralStringRef("\xff\xff/cluster_file_path")) }, - { SpecialKeySpace::MODULE::METRICS, KeyRangeRef(LiteralStringRef("\xff\xff/metrics/"), LiteralStringRef("\xff\xff/metrics0")) } + { SpecialKeySpace::MODULE::METRICS, + KeyRangeRef(LiteralStringRef("\xff\xff/metrics/"), LiteralStringRef("\xff\xff/metrics0")) } }; // This function will move the given KeySelector as far as possible to the standard form: @@ -314,7 +315,8 @@ Future> ConflictingKeysImpl::getRange(Reference> ddStatsGetRangeActor(Reference ryw, KeyRangeRef kr) { +ACTOR Future> ddStatsGetRangeActor(Reference ryw, + KeyRangeRef kr) { try { auto keys = kr.removePrefix(ddStatsRange.begin); Standalone> resultWithoutPrefix = @@ -335,7 +337,8 @@ ACTOR Future> ddStatsGetRangeActor(Reference> DDStatsRangeImpl::getRange(Reference ryw, KeyRangeRef kr) const { +Future> DDStatsRangeImpl::getRange(Reference ryw, + KeyRangeRef kr) const { return ddStatsGetRangeActor(ryw, kr); } diff --git a/fdbclient/SystemData.cpp b/fdbclient/SystemData.cpp index 4b665f5711..2de268fcd8 100644 --- a/fdbclient/SystemData.cpp +++ b/fdbclient/SystemData.cpp @@ -203,7 +203,8 @@ const KeyRangeRef writeConflictRangeKeysRange = KeyRangeRef(LiteralStringRef("\xff\xff/transaction/write_conflict_range/"), LiteralStringRef("\xff\xff/transaction/write_conflict_range/\xff\xff")); -const KeyRangeRef ddStatsRange = KeyRangeRef(LiteralStringRef("\xff\xff/metrics/dd_stats/"), LiteralStringRef("\xff\xff/metrics/dd_stats/\xff\xff")); +const KeyRangeRef ddStatsRange = + KeyRangeRef(LiteralStringRef("\xff\xff/metrics/dd_stats/"), LiteralStringRef("\xff\xff/metrics/dd_stats/\xff\xff")); const ValueRef ddStatsZeroBytes = LiteralStringRef("0"); // "\xff/storageCache/[[begin]]" := "[[vector]]" diff --git a/fdbserver/workloads/DataDistributionMetrics.actor.cpp b/fdbserver/workloads/DataDistributionMetrics.actor.cpp index c6526c7c3a..6855879475 100644 --- a/fdbserver/workloads/DataDistributionMetrics.actor.cpp +++ b/fdbserver/workloads/DataDistributionMetrics.actor.cpp @@ -66,7 +66,8 @@ struct DataDistributionMetricsWorkload : KVWorkload { TraceEvent(SevError, "NoTransactionsCommitted"); return false; } - Reference tr= Reference(new ReadYourWritesTransaction(cx)); + Reference tr = + Reference(new ReadYourWritesTransaction(cx)); // ReadYourWritesTransaction tr(cx); // TODO : Debug if we use this one, delref(RYW) will throw error try { Standalone result = wait(tr->getRange(ddStatsRange, 100)); @@ -75,12 +76,12 @@ struct DataDistributionMetricsWorkload : KVWorkload { self->numShards = result.size() / 2; if (self->numShards < 1) return false; int64_t totalBytes = 0; - for (int i = 0; i < result.size(); i+=2) { + for (int i = 0; i < result.size(); i += 2) { // totalBytes += readJSONStrictly(kv.value.toString()).get_obj()["ShardBytes"].get_int64(); ASSERT(result[i].key.startsWith(ddStatsRange.begin)); totalBytes += std::stoi(result[i].value.toString()); - ASSERT(result[i+1].key.startsWith(ddStatsRange.begin)); - ASSERT(result[i+1].value == ddStatsZeroBytes); + ASSERT(result[i + 1].key.startsWith(ddStatsRange.begin)); + ASSERT(result[i + 1].value == ddStatsZeroBytes); } self->avgBytes = totalBytes / self->numShards; } catch (Error& e) {