18 #ifndef FOEDUS_STORAGE_PAGE_HPP_
19 #define FOEDUS_STORAGE_PAGE_HPP_
76 return status_ == other.status_;
79 return status_ != other.status_;
288 page_id_ = page_id.word;
289 storage_id_ = storage_id;
291 page_type_ = page_type;
295 masstree_in_layer_level_ = 0;
296 stat_last_updater_node_ = page_id.get_numa_node();
298 page_version_.
reset();
306 storage_id_ = storage_id;
308 page_type_ = page_type;
312 masstree_in_layer_level_ = 0;
315 page_version_.
reset();
358 Page& operator=(const
Page& other) CXX11_FUNC_DELETE;
396 uintptr_t int_address =
reinterpret_cast<uintptr_t
>(address);
397 uint64_t aligned_address =
static_cast<uint64_t
>(int_address) /
kPageSize *
kPageSize;
398 return reinterpret_cast<Page*
>(
399 reinterpret_cast<void*
>(
reinterpret_cast<uintptr_t
>(aligned_address)));
424 const void* address);
430 const void* address) {
444 #endif // FOEDUS_STORAGE_PAGE_HPP_
void assert_aligned_page(const void *page)
void increment_version_counter() __attribute__((always_inline))
void reset() __attribute__((always_inline))
used only while page initialization
const char * get_data() const
Definitions of IDs in this package and a few related constant values.
Page * to_page(const void *address)
super-dirty way to obtain Page the address belongs to.
bool has_next_page() const __attribute__((always_inline))
bool is_retired() const __attribute__((always_inline))
uint32_t StorageId
Unique ID for storage.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Represents one thread running on one NUMA core.
Typedefs of ID types used in thread package.
bool operator!=(const PageVersion &other) const __attribute__((always_inline))
bool is_moved() const __attribute__((always_inline))
PageType
The following 1-byte value is stored in the common page header.
Represents a pointer to a volatile page with modification count for preventing ABA.
Just a synonym of XctId to be used as a page lock mechanism.
uint32_t get_version_counter() const __attribute__((always_inline))
uint16_t index_in_parent_
[IN] Some index (meaning depends on page type) of pointer in parent page to the new page...
void reset() __attribute__((always_inline))
used only while page initialization
Implements a probabilistic counter [Morris 1978].
Page * page_
[IN, OUT] The new page to initialize.
void set_has_next_page() __attribute__((always_inline))
bool is_moved() const __attribute__((always_inline))
thread::Thread * context_
[IN] Thread on which the procedure is running
void assert_valid_volatile_page(const Page *page, uint32_t offset)
VolatilePagePointer get_volatile_page_id() const
void set_retired() __attribute__((always_inline))
bool operator==(const PageVersionStatus &other) const __attribute__((always_inline))
Forward declarations of classes in storage package.
memory::PagePoolOffset get_offset() const
Definitions of IDs in this package and a few related constant values.
An exclusive-only (WW) MCS lock data structure.
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
uint64_t SnapshotPagePointer
Page ID of a snapshot page.
void assert_within_valid_volatile_page_impl(const memory::GlobalVolatilePageResolver &resolver, const void *address)
void assert_within_valid_volatile_page(const memory::GlobalVolatilePageResolver &resolver, const void *address)
bool operator!=(const PageVersionStatus &other) const __attribute__((always_inline))
PageType get_page_type() const
const Page * parent_
[IN] Parent of the new page.
void reset() __attribute__((always_inline))
Set of arguments, both inputs and outputs, given to each volatile page initializer.
Just a marker to denote that the memory region represents a data page.
uint32_t get_version_counter() const __attribute__((always_inline))
friend std::ostream & operator<<(std::ostream &o, const PageVersionStatus &v)
void set_moved() __attribute__((always_inline))
uint8_t extract_numa_node_from_snapshot_pointer(SnapshotPagePointer pointer)
Forward declarations of classes in memory package.
void set_moved() __attribute__((always_inline))
so far used only in hash storage, where data page forms a linked list
friend std::ostream & operator<<(std::ostream &o, const PageVersion &v)
bool is_locked() const
This is a "relaxed" check.
#define CXX11_FUNC_DELETE
Used in public headers in place of " = delete" of C++11.
VolatilePagePointer page_id
[IN] New page ID
PageVersionStatus status_
bool operator==(const PageVersion &other) const __attribute__((always_inline))
Atomic fence methods and load/store with fences that work for both C++11/non-C++11 code...
void(* VolatilePageInit)(const VolatilePageInitArguments &args)
A function pointer to initialize a volatile page.
#define STATIC_SIZE_CHECK(desired, actual)
const PageHeader & get_header() const
PageHeader & get_header()
At least the basic header exists in all pages.
bool has_next_page() const __attribute__((always_inline))
void set_retired() __attribute__((always_inline))
bool is_retired() const __attribute__((always_inline))
SnapshotPagePointer get_snapshot_page_id() const
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
bool is_locked() const __attribute__((always_inline))
Forward declarations of classes in thread package.
#define ALWAYS_INLINE
A function suffix to hint that the function should always be inlined.
void set_has_next_page() __attribute__((always_inline))
const uint16_t kPageSize
A constant defining the page size (in bytes) of both snapshot pages and volatile pages.
uint32_t Checksum
Checksum of a snapshot page.
void increment_version_counter() __attribute__((always_inline))
PageVersion() __attribute__((always_inline))