libfoedus-core
FOEDUS Core Library
|
Hash bucket in cache table. More...
Hash bucket in cache table.
Every essential information in the hashtable is repsented in this 8-byte. Thus, all simple reads/writes are guaranteed to be complete and consistent (at least regular). This is one of the main tricks to make snapshot cache wait-free.
Higher 32 bit is PageIdTag to efficiently check (with false positives) the bucket points to the page or not. Lower 32 bit is ContentId, or the offset in the page pool.
We always read-write these information as complete 64bit to allow regular-reads and atomic-writes. We never do atomic operations in this module thanks to the loose requirement in the snapshot cache.
But, just be careful on regular-reads and implicitly-atomic-writes. Compiler might do something surprising if we don't explicitly prohibit it. For this purpose, we use a macro equivalent to linux's ACCESS_ONCE. For more details, see: http://lwn.net/Articles/508991/
Definition at line 140 of file cache_hashtable.hpp.
#include <cache_hashtable.hpp>
Public Member Functions | |
void | reset (ContentId id=0, PageIdTag tag=0) |
ContentId | get_content_id () const |
void | set_content_id (ContentId id) |
bool | is_content_set () const |
PageIdTag | get_tag () const |
void | set_tag (PageIdTag tag) |
same note as set_content_id() More... | |
Public Attributes | |
uint64_t | data_ |
|
inline |
Definition at line 147 of file cache_hashtable.hpp.
References data_.
Referenced by foedus::cache::CacheHashtable::evict_overflow_loop(), foedus::cache::CacheHashtable::find(), foedus::cache::CacheHashtable::find_batch(), and is_content_set().
|
inline |
Definition at line 155 of file cache_hashtable.hpp.
Referenced by foedus::cache::CacheHashtable::find(), and foedus::cache::CacheHashtable::find_batch().
|
inline |
Definition at line 153 of file cache_hashtable.hpp.
References get_content_id().
Definition at line 143 of file cache_hashtable.hpp.
Referenced by foedus::cache::CacheHashtable::CacheHashtable(), and foedus::cache::CacheHashtable::install().
|
inline |
Definition at line 152 of file cache_hashtable.hpp.
|
inline |
uint64_t foedus::cache::CacheBucket::data_ |
Definition at line 141 of file cache_hashtable.hpp.
Referenced by foedus::cache::CacheHashtable::evict_main_loop(), foedus::cache::CacheHashtable::evict_overflow_loop(), and get_content_id().