Skip to content

Commit

Permalink
mcrouter (-7733873293505197239)
Browse files Browse the repository at this point in the history
Reviewed By: edenzik

Differential Revision: D54108034

fbshipit-source-id: b2b201cc9766ec69d295b5ebbaa6ae09874ad058
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Feb 23, 2024
1 parent ec78cc9 commit e6e5b60
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 56 deletions.
8 changes: 2 additions & 6 deletions third-party/mcrouter/src/mcrouter/flavor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

#include "mcrouter/lib/fbi/cpp/util.h"

namespace facebook {
namespace memcache {
namespace mcrouter {
namespace facebook::memcache::mcrouter {

namespace {

Expand Down Expand Up @@ -170,6 +168,4 @@ bool parse_json_options(

return true;
}
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::mcrouter
8 changes: 2 additions & 6 deletions third-party/mcrouter/src/mcrouter/flavor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -52,6 +50,4 @@ bool parse_json_options(
const folly::dynamic& json,
const std::string& field_name,
std::unordered_map<std::string, std::string>& opts);
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::mcrouter
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#include "AuxiliaryCPUThreadPool.h"
#include <folly/Singleton.h>

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;
Expand All @@ -29,6 +27,4 @@ folly::CPUThreadPoolExecutor& AuxiliaryCPUThreadPool::getThreadPool() {
return *threadPool_;
}

} // namespace mcrouter
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::mcrouter
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
#include <folly/executors/CPUThreadPoolExecutor.h>
#include <folly/synchronization/CallOnce.h>

namespace facebook {
namespace memcache {
namespace mcrouter {
namespace facebook::memcache::mcrouter {

/**
* CPU Thread pool that is shared between router intances.
Expand All @@ -33,6 +31,4 @@ class AuxiliaryCPUThreadPool {
using AuxiliaryCPUThreadPoolSingleton =
folly::Singleton<AuxiliaryCPUThreadPool>;

} // namespace mcrouter
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::mcrouter
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#include "AuxiliaryIOThreadPool.h"
#include <folly/Singleton.h>

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;
Expand All @@ -29,6 +27,4 @@ folly::IOThreadPoolExecutorBase& AuxiliaryIOThreadPool::getThreadPool() {
return *threadPool_;
}

} // namespace mcrouter
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::mcrouter
8 changes: 2 additions & 6 deletions third-party/mcrouter/src/mcrouter/lib/AuxiliaryIOThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
#include <folly/executors/IOThreadPoolExecutor.h>
#include <folly/synchronization/CallOnce.h>

namespace facebook {
namespace memcache {
namespace mcrouter {
namespace facebook::memcache::mcrouter {

/**
* IO Thread pool that is shared between router intances.
Expand All @@ -32,6 +30,4 @@ class AuxiliaryIOThreadPool {

using AuxiliaryIOThreadPoolSingleton = folly::Singleton<AuxiliaryIOThreadPool>;

} // namespace mcrouter
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::mcrouter
6 changes: 2 additions & 4 deletions third-party/mcrouter/src/mcrouter/lib/CacheClientStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include <folly/SpinLock.h>
#include <folly/concurrency/CacheLocality.h>

namespace facebook {
namespace memcache {
namespace facebook::memcache {

struct CacheClientCounters {
size_t fetchCount{0};
Expand Down Expand Up @@ -69,5 +68,4 @@ class CacheClientStats {
lock_;
CacheClientCounters counters_;
};
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache
6 changes: 2 additions & 4 deletions third-party/mcrouter/src/mcrouter/lib/Ch3HashFunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ namespace folly {
struct dynamic;
} // namespace folly

namespace facebook {
namespace memcache {
namespace facebook::memcache {

/* CH3 consistent hashing function object */
class Ch3HashFunc {
Expand All @@ -43,5 +42,4 @@ class Ch3HashFunc {
private:
size_t n_;
};
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache
8 changes: 2 additions & 6 deletions third-party/mcrouter/src/mcrouter/lib/Clocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#include "Clocks.h"
#include <sys/time.h>

namespace facebook {
namespace memcache {
namespace cycles {
namespace facebook::memcache::cycles {

uint64_t getCpuCycles() noexcept {
#if defined(__x86_64__)
Expand Down Expand Up @@ -53,6 +51,4 @@ uint64_t getCpuCycles() noexcept {
#endif
}

} // namespace cycles
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::cycles
8 changes: 2 additions & 6 deletions third-party/mcrouter/src/mcrouter/lib/Clocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

#include <cstdint>

namespace facebook {
namespace memcache {
namespace cycles {
namespace facebook::memcache::cycles {

/**
* Returns the number of cpu cycles since power-on. This clock doesn't involve
Expand All @@ -25,6 +23,4 @@ namespace cycles {
*/
uint64_t getCpuCycles() noexcept;

} // namespace cycles
} // namespace memcache
} // namespace facebook
} // namespace facebook::memcache::cycles

0 comments on commit e6e5b60

Please sign in to comment.