23 template<
typename K,
typename V,
typename M>
27 auto itr = cache_.find(key);
28 if (itr != cache_.end()) {
34 template<
typename K,
typename V,
typename M>
41 template<
typename K,
typename V,
typename M>
44 size_t nErased = cache_.erase(key);
52 template<
typename K,
typename V,
typename M>
58 template<
typename K,
typename V,
typename M>
68 template<
typename K,
typename V,
typename M>
74 template<
typename K,
typename V,
typename M>
80 for (
const auto& kv :
data) {
82 folly::convertTo<K>(kv[0]),
83 folly::convertTo<V>(kv[1]));
87 LOG(ERROR) <<
"Load cache failed with type error: " 89 }
catch (
const std::out_of_range& err) {
90 LOG(ERROR) <<
"Load cache failed with key error: " 92 }
catch (
const std::exception& err) {
93 LOG(ERROR) <<
"Load cache failed with error: " 103 template<
typename K,
typename V,
typename M>
109 for (
const auto& kv : cache_) {
112 return std::make_pair(
std::move(dynObj), version_);
113 }
catch (
const std::exception& err) {
114 LOG(ERROR) <<
"Converting cache to folly::dynamic failed with error: "
uint64_t CacheDataVersion
constexpr detail::Map< Move > move
requires E e noexcept(noexcept(s.error(std::move(e))))
folly::Optional< V > get(const K &key)
constexpr auto size(C const &c) -> decltype(c.size())
void push_back(dynamic const &)
static void array(EmptyArrayTag)
static constexpr uint64_t data[1]
dynamic toDynamic(const T &)