From 23892d22d3717650a4cb8aa80acc5c9cd1cd7ff0 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 --- mcrouter/flavor.cpp | 8 ++------ mcrouter/flavor.h | 8 ++------ mcrouter/lib/AuxiliaryCPUThreadPool.cpp | 8 ++------ mcrouter/lib/AuxiliaryCPUThreadPool.h | 8 ++------ mcrouter/lib/AuxiliaryIOThreadPool.cpp | 8 ++------ mcrouter/lib/AuxiliaryIOThreadPool.h | 8 ++------ mcrouter/lib/CacheClientStats.h | 6 ++---- mcrouter/lib/Ch3HashFunc.h | 6 ++---- mcrouter/lib/Clocks.cpp | 8 ++------ mcrouter/lib/Clocks.h | 8 ++------ 10 files changed, 20 insertions(+), 56 deletions(-) diff --git a/mcrouter/flavor.cpp b/mcrouter/flavor.cpp index e60dc701a..a3bdf176f 100644 --- a/mcrouter/flavor.cpp +++ b/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/mcrouter/flavor.h b/mcrouter/flavor.h index 27419cfd6..847000762 100644 --- a/mcrouter/flavor.h +++ b/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/mcrouter/lib/AuxiliaryCPUThreadPool.cpp b/mcrouter/lib/AuxiliaryCPUThreadPool.cpp index d8a530449..072219ff7 100644 --- a/mcrouter/lib/AuxiliaryCPUThreadPool.cpp +++ b/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/mcrouter/lib/AuxiliaryCPUThreadPool.h b/mcrouter/lib/AuxiliaryCPUThreadPool.h index 67993fd15..05b75c4ce 100644 --- a/mcrouter/lib/AuxiliaryCPUThreadPool.h +++ b/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/mcrouter/lib/AuxiliaryIOThreadPool.cpp b/mcrouter/lib/AuxiliaryIOThreadPool.cpp index 6cdbee263..14b7643ab 100644 --- a/mcrouter/lib/AuxiliaryIOThreadPool.cpp +++ b/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/mcrouter/lib/AuxiliaryIOThreadPool.h b/mcrouter/lib/AuxiliaryIOThreadPool.h index d6e9063e1..8c83bce20 100644 --- a/mcrouter/lib/AuxiliaryIOThreadPool.h +++ b/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/mcrouter/lib/CacheClientStats.h b/mcrouter/lib/CacheClientStats.h index 51abad2fc..567461495 100644 --- a/mcrouter/lib/CacheClientStats.h +++ b/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/mcrouter/lib/Ch3HashFunc.h b/mcrouter/lib/Ch3HashFunc.h index c86ee0527..372686c6b 100644 --- a/mcrouter/lib/Ch3HashFunc.h +++ b/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/mcrouter/lib/Clocks.cpp b/mcrouter/lib/Clocks.cpp index 16db6e6e9..daa1dd8dd 100644 --- a/mcrouter/lib/Clocks.cpp +++ b/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/mcrouter/lib/Clocks.h b/mcrouter/lib/Clocks.h index 0a6f5c56e..c1172e0bd 100644 --- a/mcrouter/lib/Clocks.h +++ b/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