Zero  0.1.0
page_evictioner_selector_random.hpp
Go to the documentation of this file.
1 #ifndef __PAGE_EVICTIONER_SELECTOR_RANDOM_HPP
2 #define __PAGE_EVICTIONER_SELECTOR_RANDOM_HPP
3 
5 
6 #include <random>
7 #include <cstdlib>
8 #include <ctime>
9 #include <chrono>
10 
11 namespace zero::buffer_pool {
12 
18  struct SeedGenerator {
19  private:
24  };
25 
36  template<typename seed_type>
38 #if __SIZEOF_INT128__
39  static_assert(std::is_same<seed_type, uint32_t>::value
40  || std::is_same<seed_type, uint64_t>::value
41  || std::is_same<seed_type, __uint128_t>::value, "'seed_type' is of unsupported type!");
42 #else // __SIZEOF_INT128__
43  static_assert(std::is_same<seed_type, uint32_t>::value
44  || std::is_same<seed_type, uint64_t>::value, "'seed_type' is of unsupported type!");
45 #endif // __SIZEOF_INT128__
46 
47  private:
53  static seed_type getSeed() noexcept {};
54  };
55 
63  template<>
64  struct SeedGeneratorChrono<uint32_t> {
70  static inline uint32_t getSeed() noexcept {
71  return static_cast<uint32_t>(chrono::high_resolution_clock::now().time_since_epoch().count());
72  };
73  };
74 
82  template<>
83  struct SeedGeneratorChrono<uint64_t> {
89  static inline uint64_t getSeed() noexcept {
90  return static_cast<uint64_t>(chrono::high_resolution_clock::now().time_since_epoch().count());
91  };
92  };
93 
94 #if __SIZEOF_INT128__
95 
105  template<>
106  struct SeedGeneratorChrono<__uint128_t> {
112  static inline __uint128_t getSeed() noexcept {
113  return (static_cast<__uint128_t>(chrono::high_resolution_clock::now().time_since_epoch().count()) << 64)
114  + chrono::high_resolution_clock::now().time_since_epoch().count();
115  };
116  };
117 
118 #endif // __SIZEOF_INT128__
119 
130  template<typename seed_type>
132 #if __SIZEOF_INT128__
133  static_assert(std::is_same<seed_type, uint32_t>::value
134  || std::is_same<seed_type, uint64_t>::value
135  || std::is_same<seed_type, __uint128_t>::value, "'seed_type' is of unsupported type!");
136 #else // __SIZEOF_INT128__
137  static_assert(std::is_same<seed_type, uint32_t>::value
138  || std::is_same<seed_type, uint64_t>::value, "'seed_type' is of unsupported type!");
139 #endif // __SIZEOF_INT128__
140 
141  private:
147  static seed_type getSeed() noexcept {};
148  };
149 
157  template<>
158  struct SeedGeneratorRandomDevice<uint32_t> {
164  static inline uint32_t getSeed() noexcept {
165  std::random_device randomDevice;
166 
167  return randomDevice();
168  };
169  };
170 
179  template<>
180  struct SeedGeneratorRandomDevice<uint64_t> {
186  static inline uint64_t getSeed() noexcept {
187  std::random_device randomDevice;
188 
189  return ((static_cast<uint64_t>(randomDevice()) << 32) | static_cast<uint64_t>(randomDevice()));
190  };
191  };
192 
193 #if __SIZEOF_INT128__
194 
205  template<>
206  struct SeedGeneratorRandomDevice<__uint128_t> {
212  static inline __uint128_t getSeed() noexcept {
213  std::random_device randomDevice;
214 
215  return (static_cast<__uint128_t>((static_cast<uint64_t>(randomDevice()) << 32)
216  | static_cast<uint64_t>(randomDevice())) << 64)
217  + ((static_cast<uint64_t>(randomDevice()) << 32) | static_cast<uint64_t>(randomDevice()));
218  };
219  };
220 
221 #endif // __SIZEOF_INT128__
222 
263  template<class random_number_generator, class random_distribution, class ... seed_generators>
265  public:
271  explicit PageEvictionerSelectorRANDOMExternal(const BufferPool* bufferPool) :
272  PageEvictionerSelector(bufferPool),
273  _randomNumberGenerator(seed_generators::getSeed() ...),
274  _randomDistribution(1, _maxBufferpoolIndex) {};
275 
283  inline bf_idx select() noexcept final {
284  return static_cast<bf_idx>(_randomDistribution(_randomNumberGenerator));
285  };
286 
294  inline void updateOnPageHit(bf_idx idx) noexcept final {};
295 
303  inline void updateOnPageUnfix(bf_idx idx) noexcept final {};
304 
314  inline void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final {};
315 
324  inline void updateOnPageFixed(bf_idx idx) noexcept final {};
325 
334  inline void updateOnPageDirty(bf_idx idx) noexcept final {};
335 
344  inline void updateOnPageBlocked(bf_idx idx) noexcept final {};
345 
354  inline void updateOnPageSwizzled(bf_idx idx) noexcept final {};
355 
364  inline void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final {};
365 
370  inline void releaseInternalLatches() noexcept final {};
371 
380  void updateOnPointerSwizzling(bf_idx idx) noexcept final {};
381 
382  private:
386  random_number_generator _randomNumberGenerator;
387 
391  random_distribution _randomDistribution;
392  };
393 
436  template<class random_number_generator, class random_distribution, bool seed_explicitly, class ... seed_generators>
438  public:
445  PageEvictionerSelector(bufferPool),
446  _randomDistribution(1, _maxBufferpoolIndex) {};
447 
455  inline bf_idx select() noexcept final {
456 
460  static thread_local bool _randomNumberGeneratorInitialized;
461 
465  static thread_local random_number_generator _randomNumberGenerator;
466 
467  if constexpr (seed_explicitly) {
468  if (!_randomNumberGeneratorInitialized) {
469  _randomNumberGenerator = random_number_generator(seed_generators::getSeed() ...);
470  _randomNumberGeneratorInitialized = true;
471  }
472  }
473 
474  return static_cast<bf_idx>(_randomDistribution(_randomNumberGenerator));
475  };
476 
484  inline void updateOnPageHit(bf_idx idx) noexcept final {};
485 
493  inline void updateOnPageUnfix(bf_idx idx) noexcept final {};
494 
504  inline void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final {};
505 
514  inline void updateOnPageFixed(bf_idx idx) noexcept final {};
515 
524  inline void updateOnPageDirty(bf_idx idx) noexcept final {};
525 
534  inline void updateOnPageBlocked(bf_idx idx) noexcept final {};
535 
544  inline void updateOnPageSwizzled(bf_idx idx) noexcept final {};
545 
554  inline void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final {};
555 
564  void updateOnPointerSwizzling(bf_idx idx) noexcept final {};
565 
570  inline void releaseInternalLatches() noexcept final {};
571 
572  private:
576  std::uniform_int_distribution<bf_idx> _randomDistribution;
577  };
578 
596  template<class random_number_generator, class ... seed_generators>
598  public:
604  explicit PageEvictionerSelectorRANDOMCLHEP(const BufferPool* bufferPool) :
605  PageEvictionerSelector(bufferPool),
606  _randomNumberGenerator(seed_generators::getSeed() ...) {};
607 
615  inline bf_idx select() noexcept final {
616  return static_cast<uint32_t>(((uint32_t(_randomNumberGenerator)) % (_maxBufferpoolIndex - 1) + 1));
617  };
618 
626  inline void updateOnPageHit(bf_idx idx) noexcept final {};
627 
635  inline void updateOnPageUnfix(bf_idx idx) noexcept final {};
636 
646  inline void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final {};
647 
656  inline void updateOnPageFixed(bf_idx idx) noexcept final {};
657 
666  inline void updateOnPageDirty(bf_idx idx) noexcept final {};
667 
676  inline void updateOnPageBlocked(bf_idx idx) noexcept final {};
677 
686  inline void updateOnPageSwizzled(bf_idx idx) noexcept final {};
687 
696  inline void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final {};
697 
706  void updateOnPointerSwizzling(bf_idx idx) noexcept final {};
707 
712  inline void releaseInternalLatches() noexcept final {};
713 
714  private:
718  random_number_generator _randomNumberGenerator;
719  };
720 
739  template<class random_number_generator, bool seed_explicitly, class ... seed_generators>
741  public:
748  PageEvictionerSelector(bufferPool) {};
749 
757  inline bf_idx select() noexcept final {
758 
762  static thread_local bool _randomNumberGeneratorInitialized;
763 
767  static thread_local random_number_generator _randomNumberGenerator;
768 
769  if constexpr (seed_explicitly) {
770  if (!_randomNumberGeneratorInitialized) {
771  _randomNumberGenerator = random_number_generator(seed_generators::getSeed() ...);
772  _randomNumberGeneratorInitialized = true;
773  }
774  }
775 
776  return static_cast<uint32_t>(((uint32_t(_randomNumberGenerator)) % (_maxBufferpoolIndex - 1) + 1));
777  };
778 
786  inline void updateOnPageHit(bf_idx idx) noexcept final {};
787 
795  inline void updateOnPageUnfix(bf_idx idx) noexcept final {};
796 
806  inline void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final {};
807 
816  inline void updateOnPageFixed(bf_idx idx) noexcept final {};
817 
826  inline void updateOnPageDirty(bf_idx idx) noexcept final {};
827 
836  inline void updateOnPageBlocked(bf_idx idx) noexcept final {};
837 
846  inline void updateOnPageSwizzled(bf_idx idx) noexcept final {};
847 
856  inline void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final {};
857 
866  void updateOnPointerSwizzling(bf_idx idx) noexcept final {};
867 
872  inline void releaseInternalLatches() noexcept final {};
873  };
874 
882  public:
888  explicit PageEvictionerSelectorRANDOMCRand(const BufferPool* bufferPool) :
889  PageEvictionerSelector(bufferPool) {
890  std::srand(std::time(nullptr));
891  };
892 
900  inline bf_idx select() noexcept final {
901  return 1 + std::rand() / ((RAND_MAX + 1u) / _maxBufferpoolIndex);
902  };
903 
911  inline void updateOnPageHit(bf_idx idx) noexcept final {};
912 
920  inline void updateOnPageUnfix(bf_idx idx) noexcept final {};
921 
931  inline void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final {};
932 
941  inline void updateOnPageFixed(bf_idx idx) noexcept final {};
942 
951  inline void updateOnPageDirty(bf_idx idx) noexcept final {};
952 
961  inline void updateOnPageBlocked(bf_idx idx) noexcept final {};
962 
971  inline void updateOnPageSwizzled(bf_idx idx) noexcept final {};
972 
981  inline void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final {};
982 
991  void updateOnPointerSwizzling(bf_idx idx) noexcept final {};
992 
997  inline void releaseInternalLatches() noexcept final {};
998  };
999 
1007  public:
1013  explicit PageEvictionerSelectorRANDOMXORWow(const BufferPool* bufferPool) :
1014  PageEvictionerSelector(bufferPool) {};
1015 
1022  inline bf_idx select() noexcept final {
1023 
1030  static thread_local bool _seedInitialized;
1031 
1035  static thread_local uint32_t _x;
1036 
1040  static thread_local uint32_t _y;
1041 
1045  static thread_local uint32_t _z;
1046 
1050  static thread_local uint32_t _w;
1051 
1055  static thread_local uint32_t _v;
1056 
1060  static thread_local uint32_t _d;
1061 
1062  if (!_seedInitialized) {
1063  _x = std::random_device{}();
1064  _y = std::random_device{}();
1065  _z = std::random_device{}();
1066  _w = std::random_device{}();
1067  _v = std::random_device{}();
1068  _d = std::random_device{}();
1069  _seedInitialized = true;
1070  }
1071  uint32_t t = _x ^(_x >> 2);
1072  _x = _y;
1073  _y = _z;
1074  _z = _w;
1075  _w = _v;
1076  _v = (_v ^ (_v << 4)) ^ (t ^ (t << 1));
1077 
1078  return (((_d += 362437) + _v) % (_maxBufferpoolIndex - 1) + 1);
1079  };
1080 
1088  inline void updateOnPageHit(bf_idx idx) noexcept final {};
1089 
1097  inline void updateOnPageUnfix(bf_idx idx) noexcept final {};
1098 
1108  inline void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final {};
1109 
1118  inline void updateOnPageFixed(bf_idx idx) noexcept final {};
1119 
1128  inline void updateOnPageDirty(bf_idx idx) noexcept final {};
1129 
1138  inline void updateOnPageBlocked(bf_idx idx) noexcept final {};
1139 
1148  inline void updateOnPageSwizzled(bf_idx idx) noexcept final {};
1149 
1158  inline void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final {};
1159 
1168  void updateOnPointerSwizzling(bf_idx idx) noexcept final {};
1169 
1174  inline void releaseInternalLatches() noexcept final {};
1175  };
1176 
1184  public:
1191  PageEvictionerSelector(bufferPool) {};
1192 
1199  inline bf_idx select() noexcept final {
1200 
1207  static thread_local bool _seedInitialized;
1208 
1212  static thread_local uint64_t _seed0;
1213 
1217  static thread_local uint64_t _seed1;
1218 
1219  if (!_seedInitialized) {
1220  _seed0 = std::random_device{}();
1221  _seed1 = std::random_device{}();
1222  _seedInitialized = true;
1223  }
1224  uint64_t x = _seed0;
1225  uint64_t const y = _seed1;
1226  _seed0 = y;
1227  x ^= x << 23;
1228  _seed1 = x ^ y ^ (x >> 17) ^ (y >> 26);
1229  return ((_seed1 + y) % (_maxBufferpoolIndex - 1) + 1);
1230  };
1231 
1239  inline void updateOnPageHit(bf_idx idx) noexcept final {};
1240 
1248  inline void updateOnPageUnfix(bf_idx idx) noexcept final {};
1249 
1259  inline void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final {};
1260 
1269  inline void updateOnPageFixed(bf_idx idx) noexcept final {};
1270 
1279  inline void updateOnPageDirty(bf_idx idx) noexcept final {};
1280 
1289  inline void updateOnPageBlocked(bf_idx idx) noexcept final {};
1290 
1299  inline void updateOnPageSwizzled(bf_idx idx) noexcept final {};
1300 
1309  inline void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final {};
1310 
1319  void updateOnPointerSwizzling(bf_idx idx) noexcept final {};
1320 
1325  inline void releaseInternalLatches() noexcept final {};
1326  };
1327 } // zero::buffer_pool
1328 
1329 #endif // __PAGE_EVICTIONER_SELECTOR_RANDOM_HPP
void updateOnPageFixed(bf_idx idx) noexcept final
Updates the eviction statistics of fixed (i.e. used) pages during eviction.
Definition: page_evictioner_selector_random.hpp:941
void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final
Updates the eviction statistics on explicit unbuffer.
Definition: page_evictioner_selector_random.hpp:1158
void updateOnPageDirty(bf_idx idx) noexcept final
Updates the eviction statistics of dirty pages during eviction.
Definition: page_evictioner_selector_random.hpp:1279
Global RANDOM buffer frame selector that wraps an CLHEP PRNG.
Definition: page_evictioner_selector_random.hpp:597
RANDOM buffer frame selector
Definition: page_evictioner_selector_random.hpp:1006
void updateOnPointerSwizzling(bf_idx idx) noexcept final
Updates the eviction statistics of pages when its pointer got swizzled in its parent page...
Definition: page_evictioner_selector_random.hpp:380
void updateOnPageDirty(bf_idx idx) noexcept final
Updates the eviction statistics of dirty pages during eviction.
Definition: page_evictioner_selector_random.hpp:1128
random_number_generator _randomNumberGenerator
Definition: page_evictioner_selector_random.hpp:386
void updateOnPageUnfix(bf_idx idx) noexcept final
Updates the eviction statistics on page unfix.
Definition: page_evictioner_selector_random.hpp:1248
PageEvictionerSelectorRANDOMXORWow(const BufferPool *bufferPool)
Constructs a RANDOM buffer frame selector.
Definition: page_evictioner_selector_random.hpp:1013
void updateOnPageFixed(bf_idx idx) noexcept final
Updates the eviction statistics of fixed (i.e. used) pages during eviction.
Definition: page_evictioner_selector_random.hpp:656
void updateOnPageFixed(bf_idx idx) noexcept final
Updates the eviction statistics of fixed (i.e. used) pages during eviction.
Definition: page_evictioner_selector_random.hpp:324
Definition: buffer_pool.hpp:34
RANDOM buffer frame selector
Definition: page_evictioner_selector_random.hpp:1183
void updateOnPageHit(bf_idx idx) noexcept final
Updates the eviction statistics on page hit.
Definition: page_evictioner_selector_random.hpp:911
void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final
Updates the eviction statistics on explicit unbuffer.
Definition: page_evictioner_selector_random.hpp:856
RANDOM buffer frame selector that wraps an CLHEP PRNG
Definition: page_evictioner_selector_random.hpp:740
void updateOnPageHit(bf_idx idx) noexcept final
Updates the eviction statistics on page hit.
Definition: page_evictioner_selector_random.hpp:786
void updateOnPointerSwizzling(bf_idx idx) noexcept final
Updates the eviction statistics of pages when its pointer got swizzled in its parent page...
Definition: page_evictioner_selector_random.hpp:1168
void releaseInternalLatches() noexcept final
Releases the internal latches of this buffer frame selector.
Definition: page_evictioner_selector_random.hpp:712
void updateOnPageHit(bf_idx idx) noexcept final
Updates the eviction statistics on page hit.
Definition: page_evictioner_selector_random.hpp:294
void updateOnPointerSwizzling(bf_idx idx) noexcept final
Updates the eviction statistics of pages when its pointer got swizzled in its parent page...
Definition: page_evictioner_selector_random.hpp:991
void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final
Updates the eviction statistics on explicit unbuffer.
Definition: page_evictioner_selector_random.hpp:981
void updateOnPageSwizzled(bf_idx idx) noexcept final
Updates the eviction statistics of pages containing swizzled pointers during eviction.
Definition: page_evictioner_selector_random.hpp:971
void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final
Updates the eviction statistics on page miss.
Definition: page_evictioner_selector_random.hpp:931
static uint64_t getSeed() noexcept
Returns two random numbers from the std::random_device concatenated together as seed.
Definition: page_evictioner_selector_random.hpp:186
void updateOnPageHit(bf_idx idx) noexcept final
Updates the eviction statistics on page hit.
Definition: page_evictioner_selector_random.hpp:1088
void updateOnPageUnfix(bf_idx idx) noexcept final
Updates the eviction statistics on page unfix.
Definition: page_evictioner_selector_random.hpp:795
bf_idx select() noexcept final
Selects a page to be evicted from the buffer pool.
Definition: page_evictioner_selector_random.hpp:900
void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final
Updates the eviction statistics on page miss.
Definition: page_evictioner_selector_random.hpp:1108
RANDOM buffer frame selector that wraps an external PRNG
Definition: page_evictioner_selector_random.hpp:437
PageEvictionerSelectorRANDOMCRand(const BufferPool *bufferPool)
Constructs a RANDOM buffer frame selector.
Definition: page_evictioner_selector_random.hpp:888
void updateOnPageSwizzled(bf_idx idx) noexcept final
Updates the eviction statistics of pages containing swizzled pointers during eviction.
Definition: page_evictioner_selector_random.hpp:686
void updateOnPageHit(bf_idx idx) noexcept final
Updates the eviction statistics on page hit.
Definition: page_evictioner_selector_random.hpp:1239
void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final
Updates the eviction statistics on explicit unbuffer.
Definition: page_evictioner_selector_random.hpp:1309
void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final
Updates the eviction statistics on explicit unbuffer.
Definition: page_evictioner_selector_random.hpp:696
void updateOnPageDirty(bf_idx idx) noexcept final
Updates the eviction statistics of dirty pages during eviction.
Definition: page_evictioner_selector_random.hpp:826
PageEvictionerSelectorRANDOMCLHEP(const BufferPool *bufferPool)
Constructs a RANDOM buffer frame selector based on the set PRNG from CLHEP.
Definition: page_evictioner_selector_random.hpp:604
Seed generator using a non-deterministic source for PRNGs.
Definition: page_evictioner_selector_random.hpp:131
uint32_t bf_idx
Definition: basics.h:56
static uint32_t getSeed() noexcept
Returns the lower 32 bits of the current wall-clock time as seed.
Definition: page_evictioner_selector_random.hpp:70
void updateOnPageSwizzled(bf_idx idx) noexcept final
Updates the eviction statistics of pages containing swizzled pointers during eviction.
Definition: page_evictioner_selector_random.hpp:354
void updateOnPointerSwizzling(bf_idx idx) noexcept final
Updates the eviction statistics of pages when its pointer got swizzled in its parent page...
Definition: page_evictioner_selector_random.hpp:866
void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final
Updates the eviction statistics on page miss.
Definition: page_evictioner_selector_random.hpp:504
PageEvictionerSelectorRANDOMExternalThreadLocal(const BufferPool *bufferPool)
Constructs a RANDOM buffer frame selector based on the set PRNG.
Definition: page_evictioner_selector_random.hpp:444
void updateOnPageDirty(bf_idx idx) noexcept final
Updates the eviction statistics of dirty pages during eviction.
Definition: page_evictioner_selector_random.hpp:524
bf_idx select() noexcept final
Selects a page to be evicted from the buffer pool.
Definition: page_evictioner_selector_random.hpp:283
void updateOnPageHit(bf_idx idx) noexcept final
Updates the eviction statistics on page hit.
Definition: page_evictioner_selector_random.hpp:484
RANDOM buffer frame selector
Definition: page_evictioner_selector_random.hpp:881
void updateOnPageUnfix(bf_idx idx) noexcept final
Updates the eviction statistics on page unfix.
Definition: page_evictioner_selector_random.hpp:1097
void updateOnPageFixed(bf_idx idx) noexcept final
Updates the eviction statistics of fixed (i.e. used) pages during eviction.
Definition: page_evictioner_selector_random.hpp:514
void updateOnPageBlocked(bf_idx idx) noexcept final
Updates the eviction statistics of pages that cannot be evicted at all.
Definition: page_evictioner_selector_random.hpp:1138
uint32_t PageID
Definition: basics.h:45
void updateOnPointerSwizzling(bf_idx idx) noexcept final
Updates the eviction statistics of pages when its pointer got swizzled in its parent page...
Definition: page_evictioner_selector_random.hpp:706
random_number_generator _randomNumberGenerator
Definition: page_evictioner_selector_random.hpp:718
void updateOnPageBlocked(bf_idx idx) noexcept final
Updates the eviction statistics of pages that cannot be evicted at all.
Definition: page_evictioner_selector_random.hpp:836
static uint32_t getSeed() noexcept
Returns the a random number from the std::random_device as seed.
Definition: page_evictioner_selector_random.hpp:164
void updateOnPageSwizzled(bf_idx idx) noexcept final
Updates the eviction statistics of pages containing swizzled pointers during eviction.
Definition: page_evictioner_selector_random.hpp:1148
void releaseInternalLatches() noexcept final
Releases the internal latches of this buffer frame selector.
Definition: page_evictioner_selector_random.hpp:1174
Seed generator for PRNGs.
Definition: page_evictioner_selector_random.hpp:18
void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final
Updates the eviction statistics on page miss.
Definition: page_evictioner_selector_random.hpp:1259
void updateOnPageBlocked(bf_idx idx) noexcept final
Updates the eviction statistics of pages that cannot be evicted at all.
Definition: page_evictioner_selector_random.hpp:1289
Seed generator using the wall-clock time for PRNGs.
Definition: page_evictioner_selector_random.hpp:37
void updateOnPageBlocked(bf_idx idx) noexcept final
Updates the eviction statistics of pages that cannot be evicted at all.
Definition: page_evictioner_selector_random.hpp:534
void updateOnPageDirty(bf_idx idx) noexcept final
Updates the eviction statistics of dirty pages during eviction.
Definition: page_evictioner_selector_random.hpp:334
void updateOnPageBlocked(bf_idx idx) noexcept final
Updates the eviction statistics of pages that cannot be evicted at all.
Definition: page_evictioner_selector_random.hpp:344
void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final
Updates the eviction statistics on page miss.
Definition: page_evictioner_selector_random.hpp:806
void updateOnPageUnfix(bf_idx idx) noexcept final
Updates the eviction statistics on page unfix.
Definition: page_evictioner_selector_random.hpp:635
random_distribution _randomDistribution
The uniform distribution and range for the pseudo-random number generator (post-processor) ...
Definition: page_evictioner_selector_random.hpp:391
void updateOnPageUnfix(bf_idx idx) noexcept final
Updates the eviction statistics on page unfix.
Definition: page_evictioner_selector_random.hpp:920
void updateOnPageFixed(bf_idx idx) noexcept final
Updates the eviction statistics of fixed (i.e. used) pages during eviction.
Definition: page_evictioner_selector_random.hpp:816
PageEvictionerSelectorRANDOMXORShift128Plus(const BufferPool *bufferPool)
Constructs a RANDOM buffer frame selector.
Definition: page_evictioner_selector_random.hpp:1190
void releaseInternalLatches() noexcept final
Releases the internal latches of this buffer frame selector.
Definition: page_evictioner_selector_random.hpp:872
void updateOnPointerSwizzling(bf_idx idx) noexcept final
Updates the eviction statistics of pages when its pointer got swizzled in its parent page...
Definition: page_evictioner_selector_random.hpp:564
void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final
Updates the eviction statistics on page miss.
Definition: page_evictioner_selector_random.hpp:646
void updateOnPageUnfix(bf_idx idx) noexcept final
Updates the eviction statistics on page unfix.
Definition: page_evictioner_selector_random.hpp:303
void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final
Updates the eviction statistics on explicit unbuffer.
Definition: page_evictioner_selector_random.hpp:554
PageEvictionerSelectorRANDOMExternal(const BufferPool *bufferPool)
Constructs a RANDOM buffer frame selector based on the set PRNG.
Definition: page_evictioner_selector_random.hpp:271
void releaseInternalLatches() noexcept final
Releases the internal latches of this buffer frame selector.
Definition: page_evictioner_selector_random.hpp:370
A buffer manager that exploits the tree structure of indexes.
Definition: buffer_pool.hpp:40
void releaseInternalLatches() noexcept final
Releases the internal latches of this buffer frame selector.
Definition: page_evictioner_selector_random.hpp:570
void updateOnPageDirty(bf_idx idx) noexcept final
Updates the eviction statistics of dirty pages during eviction.
Definition: page_evictioner_selector_random.hpp:666
void updateOnPageDirty(bf_idx idx) noexcept final
Updates the eviction statistics of dirty pages during eviction.
Definition: page_evictioner_selector_random.hpp:951
void updateOnPageFixed(bf_idx idx) noexcept final
Updates the eviction statistics of fixed (i.e. used) pages during eviction.
Definition: page_evictioner_selector_random.hpp:1118
void updateOnPointerSwizzling(bf_idx idx) noexcept final
Updates the eviction statistics of pages when its pointer got swizzled in its parent page...
Definition: page_evictioner_selector_random.hpp:1319
void releaseInternalLatches() noexcept final
Releases the internal latches of this buffer frame selector.
Definition: page_evictioner_selector_random.hpp:997
bf_idx select() noexcept final
Selects a page to be evicted from the buffer pool.
Definition: page_evictioner_selector_random.hpp:615
void releaseInternalLatches() noexcept final
Releases the internal latches of this buffer frame selector.
Definition: page_evictioner_selector_random.hpp:1325
void updateOnPageExplicitlyUnbuffered(bf_idx idx) noexcept final
Updates the eviction statistics on explicit unbuffer.
Definition: page_evictioner_selector_random.hpp:364
std::uniform_int_distribution< bf_idx > _randomDistribution
The uniform distribution and range for the pseudo-random number generator (post-processor) ...
Definition: page_evictioner_selector_random.hpp:576
void updateOnPageBlocked(bf_idx idx) noexcept final
Updates the eviction statistics of pages that cannot be evicted at all.
Definition: page_evictioner_selector_random.hpp:961
Global RANDOM buffer frame selector that wraps an external PRNG.
Definition: page_evictioner_selector_random.hpp:264
void updateOnPageFixed(bf_idx idx) noexcept final
Updates the eviction statistics of fixed (i.e. used) pages during eviction.
Definition: page_evictioner_selector_random.hpp:1269
SeedGenerator()
Defined to prevent instantiation of seed generators.
Definition: page_evictioner_selector_random.hpp:23
void updateOnPageSwizzled(bf_idx idx) noexcept final
Updates the eviction statistics of pages containing swizzled pointers during eviction.
Definition: page_evictioner_selector_random.hpp:1299
void updateOnPageBlocked(bf_idx idx) noexcept final
Updates the eviction statistics of pages that cannot be evicted at all.
Definition: page_evictioner_selector_random.hpp:676
void updateOnPageSwizzled(bf_idx idx) noexcept final
Updates the eviction statistics of pages containing swizzled pointers during eviction.
Definition: page_evictioner_selector_random.hpp:544
void updateOnPageUnfix(bf_idx idx) noexcept final
Updates the eviction statistics on page unfix.
Definition: page_evictioner_selector_random.hpp:493
static seed_type getSeed() noexcept
Defined to prevent call of this in generic class.
Definition: page_evictioner_selector_random.hpp:147
void updateOnPageSwizzled(bf_idx idx) noexcept final
Updates the eviction statistics of pages containing swizzled pointers during eviction.
Definition: page_evictioner_selector_random.hpp:846
static uint64_t getSeed() noexcept
Returns the current wall-clock time as seed.
Definition: page_evictioner_selector_random.hpp:89
void updateOnPageHit(bf_idx idx) noexcept final
Updates the eviction statistics on page hit.
Definition: page_evictioner_selector_random.hpp:626
Buffer frame selector for the Select-and-Filter page evictioner.
Definition: page_evictioner_selector.hpp:25
void updateOnPageMiss(bf_idx idx, PageID pid) noexcept final
Updates the eviction statistics on page miss.
Definition: page_evictioner_selector_random.hpp:314
PageEvictionerSelectorRANDOMCLHEPThreadLocal(const BufferPool *bufferPool)
Constructs a RANDOM buffer frame selector based on the set PRNG from CLHEP.
Definition: page_evictioner_selector_random.hpp:747
static seed_type getSeed() noexcept
Defined to prevent call of this in generic class.
Definition: page_evictioner_selector_random.hpp:53