From e6e5b603a98022bdb063a6bcc798f8549a469e4b Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Fri, 23 Feb 2024 08:46:25 -0800 Subject: [PATCH] mcrouter (-7733873293505197239) Reviewed By: edenzik Differential Revision: D54108034 fbshipit-source-id: b2b201cc9766ec69d295b5ebbaa6ae09874ad058 --- third-party/mcrouter/src/mcrouter/flavor.cpp | 8 ++------ third-party/mcrouter/src/mcrouter/flavor.h | 8 ++------ .../mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.cpp | 8 ++------ .../mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.h | 8 ++------ .../mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.cpp | 8 ++------ .../mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.h | 8 ++------ third-party/mcrouter/src/mcrouter/lib/CacheClientStats.h | 6 ++---- third-party/mcrouter/src/mcrouter/lib/Ch3HashFunc.h | 6 ++---- third-party/mcrouter/src/mcrouter/lib/Clocks.cpp | 8 ++------ third-party/mcrouter/src/mcrouter/lib/Clocks.h | 8 ++------ 10 files changed, 20 insertions(+), 56 deletions(-) diff --git a/third-party/mcrouter/src/mcrouter/flavor.cpp b/third-party/mcrouter/src/mcrouter/flavor.cpp index e60dc701a50675..a3bdf176f162b2 100644 --- a/third-party/mcrouter/src/mcrouter/flavor.cpp +++ b/third-party/mcrouter/src/mcrouter/flavor.cpp @@ -20,9 +20,7 @@ #include "mcrouter/lib/fbi/cpp/util.h" -namespace facebook { -namespace memcache { -namespace mcrouter { +namespace facebook::memcache::mcrouter { namespace { @@ -170,6 +168,4 @@ bool parse_json_options( return true; } -} // namespace mcrouter -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::mcrouter diff --git a/third-party/mcrouter/src/mcrouter/flavor.h b/third-party/mcrouter/src/mcrouter/flavor.h index 27419cfd692b28..847000762bf775 100644 --- a/third-party/mcrouter/src/mcrouter/flavor.h +++ b/third-party/mcrouter/src/mcrouter/flavor.h @@ -14,9 +14,7 @@ namespace folly { struct dynamic; } // namespace folly -namespace facebook { -namespace memcache { -namespace mcrouter { +namespace facebook::memcache::mcrouter { /** * Reads mcrouter flavor file and fills the given dictionaries. @@ -52,6 +50,4 @@ bool parse_json_options( const folly::dynamic& json, const std::string& field_name, std::unordered_map& opts); -} // namespace mcrouter -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::mcrouter diff --git a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.cpp b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.cpp index d8a530449165df..072219ff7eab99 100644 --- a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.cpp +++ b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.cpp @@ -8,9 +8,7 @@ #include "AuxiliaryCPUThreadPool.h" #include -namespace facebook { -namespace memcache { -namespace mcrouter { +namespace facebook::memcache::mcrouter { // Number of CPU threads to run in CPU thread pool. constexpr size_t kNumCPUThreads = 5; @@ -29,6 +27,4 @@ folly::CPUThreadPoolExecutor& AuxiliaryCPUThreadPool::getThreadPool() { return *threadPool_; } -} // namespace mcrouter -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::mcrouter diff --git a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.h b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.h index 67993fd15a39a8..05b75c4cedb3e1 100644 --- a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.h +++ b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryCPUThreadPool.h @@ -11,9 +11,7 @@ #include #include -namespace facebook { -namespace memcache { -namespace mcrouter { +namespace facebook::memcache::mcrouter { /** * CPU Thread pool that is shared between router intances. @@ -33,6 +31,4 @@ class AuxiliaryCPUThreadPool { using AuxiliaryCPUThreadPoolSingleton = folly::Singleton; -} // namespace mcrouter -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::mcrouter diff --git a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.cpp b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.cpp index 6cdbee26362060..14b7643ab9a952 100644 --- a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.cpp +++ b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.cpp @@ -8,9 +8,7 @@ #include "AuxiliaryIOThreadPool.h" #include -namespace facebook { -namespace memcache { -namespace mcrouter { +namespace facebook::memcache::mcrouter { // Number of IO threads to run in IO thread pool. constexpr size_t kNumIOThreads = 5; @@ -29,6 +27,4 @@ folly::IOThreadPoolExecutorBase& AuxiliaryIOThreadPool::getThreadPool() { return *threadPool_; } -} // namespace mcrouter -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::mcrouter diff --git a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.h b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.h index d6e9063e1c21e3..8c83bce20ade3a 100644 --- a/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.h +++ b/third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.h @@ -11,9 +11,7 @@ #include #include -namespace facebook { -namespace memcache { -namespace mcrouter { +namespace facebook::memcache::mcrouter { /** * IO Thread pool that is shared between router intances. @@ -32,6 +30,4 @@ class AuxiliaryIOThreadPool { using AuxiliaryIOThreadPoolSingleton = folly::Singleton; -} // namespace mcrouter -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::mcrouter diff --git a/third-party/mcrouter/src/mcrouter/lib/CacheClientStats.h b/third-party/mcrouter/src/mcrouter/lib/CacheClientStats.h index 51abad2fcfd0e2..567461495e1182 100644 --- a/third-party/mcrouter/src/mcrouter/lib/CacheClientStats.h +++ b/third-party/mcrouter/src/mcrouter/lib/CacheClientStats.h @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace memcache { +namespace facebook::memcache { struct CacheClientCounters { size_t fetchCount{0}; @@ -69,5 +68,4 @@ class CacheClientStats { lock_; CacheClientCounters counters_; }; -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache diff --git a/third-party/mcrouter/src/mcrouter/lib/Ch3HashFunc.h b/third-party/mcrouter/src/mcrouter/lib/Ch3HashFunc.h index c86ee0527092b6..372686c6b7bae0 100644 --- a/third-party/mcrouter/src/mcrouter/lib/Ch3HashFunc.h +++ b/third-party/mcrouter/src/mcrouter/lib/Ch3HashFunc.h @@ -16,8 +16,7 @@ namespace folly { struct dynamic; } // namespace folly -namespace facebook { -namespace memcache { +namespace facebook::memcache { /* CH3 consistent hashing function object */ class Ch3HashFunc { @@ -43,5 +42,4 @@ class Ch3HashFunc { private: size_t n_; }; -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache diff --git a/third-party/mcrouter/src/mcrouter/lib/Clocks.cpp b/third-party/mcrouter/src/mcrouter/lib/Clocks.cpp index 16db6e6e901413..daa1dd8dd75e78 100644 --- a/third-party/mcrouter/src/mcrouter/lib/Clocks.cpp +++ b/third-party/mcrouter/src/mcrouter/lib/Clocks.cpp @@ -8,9 +8,7 @@ #include "Clocks.h" #include -namespace facebook { -namespace memcache { -namespace cycles { +namespace facebook::memcache::cycles { uint64_t getCpuCycles() noexcept { #if defined(__x86_64__) @@ -53,6 +51,4 @@ uint64_t getCpuCycles() noexcept { #endif } -} // namespace cycles -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::cycles diff --git a/third-party/mcrouter/src/mcrouter/lib/Clocks.h b/third-party/mcrouter/src/mcrouter/lib/Clocks.h index 0a6f5c56e95a44..c1172e0bd22ffc 100644 --- a/third-party/mcrouter/src/mcrouter/lib/Clocks.h +++ b/third-party/mcrouter/src/mcrouter/lib/Clocks.h @@ -9,9 +9,7 @@ #include -namespace facebook { -namespace memcache { -namespace cycles { +namespace facebook::memcache::cycles { /** * Returns the number of cpu cycles since power-on. This clock doesn't involve @@ -25,6 +23,4 @@ namespace cycles { */ uint64_t getCpuCycles() noexcept; -} // namespace cycles -} // namespace memcache -} // namespace facebook +} // namespace facebook::memcache::cycles