proxygen
folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex > Class Template Reference

#include <ConcurrentHashMap.h>

Classes

class  ConstIterator
 

Public Types

typedef KeyType key_type
 
typedef ValueType mapped_type
 
typedef std::pair< const KeyType, ValueType > value_type
 
typedef std::size_t size_type
 
typedef HashFn hasher
 
typedef KeyEqual key_equal
 
typedef ConstIterator const_iterator
 

Public Member Functions

 ConcurrentHashMap (size_t size=8, size_t max_size=0)
 
 ConcurrentHashMap (ConcurrentHashMap &&o) noexcept
 
ConcurrentHashMapoperator= (ConcurrentHashMap &&o)
 
 ~ConcurrentHashMap ()
 
bool empty () const noexcept
 
ConstIterator find (const KeyType &k) const
 
ConstIterator cend () const noexcept
 
ConstIterator cbegin () const noexcept
 
ConstIterator end () const noexcept
 
ConstIterator begin () const noexcept
 
std::pair< ConstIterator, bool > insert (std::pair< key_type, mapped_type > &&foo)
 
template<typename Key , typename Value >
std::pair< ConstIterator, bool > insert (Key &&k, Value &&v)
 
template<typename Key , typename... Args>
std::pair< ConstIterator, bool > try_emplace (Key &&k, Args &&...args)
 
template<typename... Args>
std::pair< ConstIterator, bool > emplace (Args &&...args)
 
template<typename Key , typename Value >
std::pair< ConstIterator, bool > insert_or_assign (Key &&k, Value &&v)
 
template<typename Key , typename Value >
folly::Optional< ConstIteratorassign (Key &&k, Value &&v)
 
template<typename Key , typename Value >
folly::Optional< ConstIteratorassign_if_equal (Key &&k, const ValueType &expected, Value &&desired)
 
const ValueType operator[] (const KeyType &key)
 
const ValueType at (const KeyType &key) const
 
size_type erase (const key_type &k)
 
ConstIterator erase (ConstIterator &pos)
 
void clear ()
 
void reserve (size_t count)
 
size_t size () const noexcept
 
float max_load_factor () const
 
void max_load_factor (float factor)
 

Private Types

using SegmentT = detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >
 

Private Member Functions

uint64_t pickSegment (const KeyType &k) const
 
SegmentTensureSegment (uint64_t i) const
 

Private Attributes

float load_factor_ = 1.05
 
Atom< SegmentT * > segments_ [NumShards]
 
size_t size_ {0}
 
size_t max_size_ {0}
 

Static Private Attributes

static constexpr uint64_t NumShards = (1 << ShardBits)
 

Detailed Description

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
class folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >

Based on Java's ConcurrentHashMap

Readers are always wait-free. Writers are sharded, but take a lock.

The interface is as close to std::unordered_map as possible, but there are a handful of changes:

  • Iterators hold hazard pointers to the returned elements. Elements can only be accessed while Iterators are still valid!
  • Therefore operator[] and at() return copies, since they do not return an iterator. The returned value is const, to remind you that changes do not affect the value in the map.
  • erase() calls the hash function, and may fail if the hash function throws an exception.
  • clear() initializes new segments, and is not noexcept.
  • The interface adds assign_if_equal, since find() doesn't take a lock.
  • Only const version of find() is supported, and const iterators. Mutation must use functions provided, like assign().
  • iteration iterates over all the buckets in the table, unlike std::unordered_map which iterates over a linked list of elements. If the table is sparse, this may be more expensive.
  • rehash policy is a power of two, using supplied factor.
  • Allocator must be stateless.
  • ValueTypes without copy constructors will work, but pessimize the implementation.

Comparisons: Single-threaded performance is extremely similar to std::unordered_map.

Multithreaded performance beats anything except the lock-free atomic maps (AtomicUnorderedMap, AtomicHashMap), BUT only if you can perfectly size the atomic maps, and you don't need erase(). If you don't know the size in advance or your workload frequently calls erase(), this is the better choice.

Definition at line 83 of file ConcurrentHashMap.h.

Member Typedef Documentation

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
typedef ConstIterator folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::const_iterator

Definition at line 108 of file ConcurrentHashMap.h.

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
typedef HashFn folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::hasher

Definition at line 106 of file ConcurrentHashMap.h.

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
typedef KeyEqual folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::key_equal

Definition at line 107 of file ConcurrentHashMap.h.

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
typedef KeyType folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::key_type

Definition at line 100 of file ConcurrentHashMap.h.

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
typedef ValueType folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::mapped_type

Definition at line 103 of file ConcurrentHashMap.h.

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
using folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::SegmentT = detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex>
private

Definition at line 92 of file ConcurrentHashMap.h.

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
typedef std::size_t folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size_type

Definition at line 105 of file ConcurrentHashMap.h.

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
typedef std::pair<const KeyType, ValueType> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::value_type

Definition at line 104 of file ConcurrentHashMap.h.

Constructor & Destructor Documentation

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConcurrentHashMap ( size_t  size = 8,
size_t  max_size = 0 
)
inlineexplicit

Definition at line 118 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_size_, folly::nextPowTwo(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size_, and uint64_t.

118  {
120  if (max_size != 0) {
121  max_size_ = folly::nextPowTwo(max_size);
122  }
123  CHECK(max_size_ == 0 || max_size_ >= size_);
124  for (uint64_t i = 0; i < NumShards; i++) {
125  segments_[i].store(nullptr, std::memory_order_relaxed);
126  }
127  }
constexpr T nextPowTwo(T const v)
Definition: Bits.h:149
static constexpr uint64_t NumShards
size_t size() const noexcept
Atom< SegmentT * > segments_[NumShards]
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConcurrentHashMap ( ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex > &&  o)
inlinenoexcept

Definition at line 129 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, and uint64_t.

130  : size_(o.size_), max_size_(o.max_size_) {
131  for (uint64_t i = 0; i < NumShards; i++) {
132  segments_[i].store(
133  o.segments_[i].load(std::memory_order_relaxed),
134  std::memory_order_relaxed);
135  o.segments_[i].store(nullptr, std::memory_order_relaxed);
136  }
137  }
static constexpr uint64_t NumShards
Atom< SegmentT * > segments_[NumShards]
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::~ConcurrentHashMap ( )
inline

Definition at line 161 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, uint64_t, and uint8_t.

161  {
162  for (uint64_t i = 0; i < NumShards; i++) {
163  auto seg = segments_[i].load(std::memory_order_relaxed);
164  if (seg) {
165  seg->~SegmentT();
166  Allocator().deallocate((uint8_t*)seg, sizeof(SegmentT));
167  }
168  }
169  }
static constexpr uint64_t NumShards
Atom< SegmentT * > segments_[NumShards]
detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex > SegmentT

Member Function Documentation

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
template<typename Key , typename Value >
folly::Optional<ConstIterator> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign ( Key &&  k,
Value &&  v 
)
inline

Definition at line 276 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConstIterator::it_, k, folly::gen::move, folly::none, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_.

Referenced by TEST().

276  {
277  auto segment = pickSegment(k);
278  ConstIterator res(this, segment);
279  auto seg = segments_[segment].load(std::memory_order_acquire);
280  if (!seg) {
281  return none;
282  } else {
283  auto r =
284  seg->assign(res.it_, std::forward<Key>(k), std::forward<Value>(v));
285  if (!r) {
286  return none;
287  }
288  }
289  return std::move(res);
290  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
uint64_t pickSegment(const KeyType &k) const
Atom< SegmentT * > segments_[NumShards]
KeyT k
constexpr None none
Definition: Optional.h:87
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
template<typename Key , typename Value >
folly::Optional<ConstIterator> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign_if_equal ( Key &&  k,
const ValueType &  expected,
Value &&  desired 
)
inline

Definition at line 295 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConstIterator::it_, k, folly::gen::move, folly::none, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_.

Referenced by TEST().

295  {
296  auto segment = pickSegment(k);
297  ConstIterator res(this, segment);
298  auto seg = segments_[segment].load(std::memory_order_acquire);
299  if (!seg) {
300  return none;
301  } else {
302  auto r = seg->assign_if_equal(
303  res.it_,
304  std::forward<Key>(k),
305  expected,
306  std::forward<Value>(desired));
307  if (!r) {
308  return none;
309  }
310  }
311  return std::move(res);
312  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
uint64_t pickSegment(const KeyType &k) const
Atom< SegmentT * > segments_[NumShards]
KeyT k
constexpr None none
Definition: Optional.h:87
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
const ValueType folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::at ( const KeyType &  key) const
inline

Definition at line 321 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find().

Referenced by TEST().

321  {
322  auto item = find(key);
323  if (item == cend()) {
324  throw std::out_of_range("at(): value out of range");
325  }
326  return item->second;
327  }
ConstIterator cend() const noexcept
ConstIterator find(const KeyType &k) const
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
ConstIterator folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::begin ( ) const
inlinenoexcept
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
ConstIterator folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cbegin ( ) const
inlinenoexcept

Definition at line 197 of file ConcurrentHashMap.h.

Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::begin(), and TEST().

197  {
198  return ConstIterator(this);
199  }
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
ConstIterator folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend ( ) const
inlinenoexcept
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
void folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::clear ( )
inline

Definition at line 351 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, and uint64_t.

Referenced by TEST().

351  {
352  for (uint64_t i = 0; i < NumShards; i++) {
353  auto seg = segments_[i].load(std::memory_order_acquire);
354  if (seg) {
355  seg->clear();
356  }
357  }
358  }
static constexpr uint64_t NumShards
Atom< SegmentT * > segments_[NumShards]
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
template<typename... Args>
std::pair<ConstIterator, bool> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::emplace ( Args &&...  args)
inline

Definition at line 245 of file ConcurrentHashMap.h.

References folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::emplace(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ensureSegment(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment(), and uint8_t.

Referenced by TEST().

245  {
246  using Node = typename SegmentT::Node;
247  auto node = (Node*)Allocator().allocate(sizeof(Node));
248  new (node) Node(std::forward<Args>(args)...);
249  auto segment = pickSegment(node->getItem().first);
250  std::pair<ConstIterator, bool> res(
251  std::piecewise_construct,
252  std::forward_as_tuple(this, segment),
253  std::forward_as_tuple(false));
254  res.second = ensureSegment(segment)->emplace(
255  res.first.it_, node->getItem().first, node);
256  if (!res.second) {
257  node->~Node();
258  Allocator().deallocate((uint8_t*)node, sizeof(Node));
259  }
260  return res;
261  }
SegmentT * ensureSegment(uint64_t i) const
concurrenthashmap::NodeT< KeyType, ValueType, Allocator, Atom > Node
bool emplace(Iterator &it, const KeyType &k, Node *node)
uint64_t pickSegment(const KeyType &k) const
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
bool folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::empty ( ) const
inlinenoexcept

Definition at line 171 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, and uint64_t.

Referenced by TEST().

171  {
172  for (uint64_t i = 0; i < NumShards; i++) {
173  auto seg = segments_[i].load(std::memory_order_acquire);
174  if (seg) {
175  if (!seg->empty()) {
176  return false;
177  }
178  }
179  }
180  return true;
181  }
static constexpr uint64_t NumShards
Atom< SegmentT * > segments_[NumShards]
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
ConstIterator folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::end ( ) const
inlinenoexcept

Definition at line 201 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend().

201  {
202  return cend();
203  }
ConstIterator cend() const noexcept
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
SegmentT* folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ensureSegment ( uint64_t  i) const
inlineprivate

Definition at line 493 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_size_, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size_, and uint8_t.

Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::emplace(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConstIterator::next(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::try_emplace().

493  {
494  SegmentT* seg = segments_[i].load(std::memory_order_acquire);
495  if (!seg) {
496  SegmentT* newseg = (SegmentT*)Allocator().allocate(sizeof(SegmentT));
497  newseg = new (newseg)
498  SegmentT(size_ >> ShardBits, load_factor_, max_size_ >> ShardBits);
499  if (!segments_[i].compare_exchange_strong(seg, newseg)) {
500  // seg is updated with new value, delete ours.
501  newseg->~SegmentT();
502  Allocator().deallocate((uint8_t*)newseg, sizeof(SegmentT));
503  } else {
504  seg = newseg;
505  }
506  }
507  return seg;
508  }
Atom< SegmentT * > segments_[NumShards]
detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex > SegmentT
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
size_type folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase ( const key_type k)
inline

Definition at line 331 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_.

Referenced by TEST().

331  {
332  auto segment = pickSegment(k);
333  auto seg = segments_[segment].load(std::memory_order_acquire);
334  if (!seg) {
335  return 0;
336  } else {
337  return seg->erase(k);
338  }
339  }
uint64_t pickSegment(const KeyType &k) const
Atom< SegmentT * > segments_[NumShards]
KeyT k
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
ConstIterator folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase ( ConstIterator pos)
inline
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
ConstIterator folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find ( const KeyType &  k) const
inline
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
std::pair<ConstIterator, bool> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert ( std::pair< key_type, mapped_type > &&  foo)
inline

Definition at line 209 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ensureSegment(), folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::insert(), folly::gen::move, and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment().

Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::operator[](), and TEST().

210  {
211  auto segment = pickSegment(foo.first);
212  std::pair<ConstIterator, bool> res(
213  std::piecewise_construct,
214  std::forward_as_tuple(this, segment),
215  std::forward_as_tuple(false));
216  res.second = ensureSegment(segment)->insert(res.first.it_, std::move(foo));
217  return res;
218  }
SegmentT * ensureSegment(uint64_t i) const
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
uint64_t pickSegment(const KeyType &k) const
bool insert(Iterator &it, std::pair< key_type, mapped_type > &&foo)
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
template<typename Key , typename Value >
std::pair<ConstIterator, bool> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert ( Key &&  k,
Value &&  v 
)
inline

Definition at line 221 of file ConcurrentHashMap.h.

References testing::Args(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ensureSegment(), folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::insert(), k, testing::Key(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment().

221  {
222  auto segment = pickSegment(k);
223  std::pair<ConstIterator, bool> res(
224  std::piecewise_construct,
225  std::forward_as_tuple(this, segment),
226  std::forward_as_tuple(false));
227  res.second = ensureSegment(segment)->insert(
228  res.first.it_, std::forward<Key>(k), std::forward<Value>(v));
229  return res;
230  }
SegmentT * ensureSegment(uint64_t i) const
uint64_t pickSegment(const KeyType &k) const
bool insert(Iterator &it, std::pair< key_type, mapped_type > &&foo)
KeyT k
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
template<typename Key , typename Value >
std::pair<ConstIterator, bool> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign ( Key &&  k,
Value &&  v 
)
inline

Definition at line 264 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ensureSegment(), folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::insert_or_assign(), k, and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment().

Referenced by TEST().

264  {
265  auto segment = pickSegment(k);
266  std::pair<ConstIterator, bool> res(
267  std::piecewise_construct,
268  std::forward_as_tuple(this, segment),
269  std::forward_as_tuple(false));
270  res.second = ensureSegment(segment)->insert_or_assign(
271  res.first.it_, std::forward<Key>(k), std::forward<Value>(v));
272  return res;
273  }
bool insert_or_assign(Iterator &it, Key &&k, Value &&v)
SegmentT * ensureSegment(uint64_t i) const
uint64_t pickSegment(const KeyType &k) const
KeyT k
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
float folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_load_factor ( ) const
inline
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
void folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_load_factor ( float  factor)
inline

Definition at line 386 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, and uint64_t.

386  {
387  for (uint64_t i = 0; i < NumShards; i++) {
388  auto seg = segments_[i].load(std::memory_order_acquire);
389  if (seg) {
390  seg->max_load_factor(factor);
391  }
392  }
393  }
static constexpr uint64_t NumShards
Atom< SegmentT * > segments_[NumShards]
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
ConcurrentHashMap& folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::operator= ( ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex > &&  o)
inline

Definition at line 139 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_size_, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size_, uint64_t, and uint8_t.

139  {
140  for (uint64_t i = 0; i < NumShards; i++) {
141  auto seg = segments_[i].load(std::memory_order_relaxed);
142  if (seg) {
143  seg->~SegmentT();
144  Allocator().deallocate((uint8_t*)seg, sizeof(SegmentT));
145  }
146  segments_[i].store(
147  o.segments_[i].load(std::memory_order_relaxed),
148  std::memory_order_relaxed);
149  o.segments_[i].store(nullptr, std::memory_order_relaxed);
150  }
151  size_ = o.size_;
152  max_size_ = o.max_size_;
153  return *this;
154  }
static constexpr uint64_t NumShards
Atom< SegmentT * > segments_[NumShards]
detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex > SegmentT
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
const ValueType folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::operator[] ( const KeyType &  key)
inline

Definition at line 316 of file ConcurrentHashMap.h.

References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert().

316  {
317  auto item = insert(key, ValueType());
318  return item.first->second;
319  }
std::pair< ConstIterator, bool > insert(std::pair< key_type, mapped_type > &&foo)
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
uint64_t folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment ( const KeyType &  k) const
inlineprivate

Definition at line 479 of file ConcurrentHashMap.h.

References h, and k.

Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign_if_equal(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::emplace(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::try_emplace().

479  {
480  auto h = HashFn()(k);
481  // Use the lowest bits for our shard bits.
482  //
483  // This works well even if the hash function is biased towards the
484  // low bits: The sharding will happen in the segments_ instead of
485  // in the segment buckets, so we'll still get write sharding as
486  // well.
487  //
488  // Low-bit bias happens often for std::hash using small numbers,
489  // since the integer hash function is the identity function.
490  return h & (NumShards - 1);
491  }
*than *hazptr_holder h
Definition: Hazptr.h:116
static constexpr uint64_t NumShards
KeyT k
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
void folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::reserve ( size_t  count)
inline

Definition at line 360 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, and uint64_t.

Referenced by TEST().

360  {
361  count = count >> ShardBits;
362  for (uint64_t i = 0; i < NumShards; i++) {
363  auto seg = segments_[i].load(std::memory_order_acquire);
364  if (seg) {
365  seg->rehash(count);
366  }
367  }
368  }
static constexpr uint64_t NumShards
int * count
Atom< SegmentT * > segments_[NumShards]
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
size_t folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size ( ) const
inlinenoexcept

Definition at line 371 of file ConcurrentHashMap.h.

References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_, and uint64_t.

Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConcurrentHashMap(), and TEST().

371  {
372  size_t res = 0;
373  for (uint64_t i = 0; i < NumShards; i++) {
374  auto seg = segments_[i].load(std::memory_order_acquire);
375  if (seg) {
376  res += seg->size();
377  }
378  }
379  return res;
380  }
static constexpr uint64_t NumShards
Atom< SegmentT * > segments_[NumShards]
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
template<typename Key , typename... Args>
std::pair<ConstIterator, bool> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::try_emplace ( Key &&  k,
Args &&...  args 
)
inline

Definition at line 233 of file ConcurrentHashMap.h.

References testing::Args(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ensureSegment(), k, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::pickSegment(), and folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::try_emplace().

Referenced by TEST().

233  {
234  auto segment = pickSegment(k);
235  std::pair<ConstIterator, bool> res(
236  std::piecewise_construct,
237  std::forward_as_tuple(this, segment),
238  std::forward_as_tuple(false));
239  res.second = ensureSegment(segment)->try_emplace(
240  res.first.it_, std::forward<Key>(k), std::forward<Args>(args)...);
241  return res;
242  }
SegmentT * ensureSegment(uint64_t i) const
bool try_emplace(Iterator &it, Key &&k, Args &&...args)
uint64_t pickSegment(const KeyType &k) const
KeyT k

Member Data Documentation

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
float folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::load_factor_ = 1.05
private
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
size_t folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_size_ {0}
private
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
constexpr uint64_t folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::NumShards = (1 << ShardBits)
staticprivate
template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
Atom<SegmentT*> folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::segments_[NumShards]
mutableprivate

Definition at line 510 of file ConcurrentHashMap.h.

Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign_if_equal(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::clear(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConcurrentHashMap(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::empty(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ensureSegment(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_load_factor(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConstIterator::next(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::operator=(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::reserve(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::~ConcurrentHashMap().

template<typename KeyType, typename ValueType, typename HashFn = std::hash<KeyType>, typename KeyEqual = std::equal_to<KeyType>, typename Allocator = std::allocator<uint8_t>, uint8_t ShardBits = 8, template< typename > class Atom = std::atomic, class Mutex = std::mutex>
size_t folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size_ {0}
private

The documentation for this class was generated from the following file: