libfoedus-core
FOEDUS Core Library
|
Represents one data page in Sequential Storage. More...
Represents one data page in Sequential Storage.
In Sequential Storage, every data page is a leaf page that forms a singly linked list. So simple.
This is a private implementation-details of Sequential Storage, thus file name ends with _impl. Do not include this header from a client program unless you know what you are doing.
Definition at line 53 of file sequential_page_impl.hpp.
#include <sequential_page_impl.hpp>
Public Member Functions | |
SequentialPage ()=delete | |
SequentialPage (const SequentialPage &other)=delete | |
SequentialPage & | operator= (const SequentialPage &other)=delete |
PageHeader & | header () |
const PageHeader & | header () const |
uint16_t | get_record_count () const |
Returns how many records in this page placed so far. More... | |
uint16_t | get_used_data_bytes () const |
How many data bytes in this page consumed so far. More... | |
void | assert_consistent () const |
uint16_t | get_payload_length (uint16_t record) const |
Returns byte length of payload of the specified record in this page. More... | |
void | set_payload_length (uint16_t record, uint16_t length) |
Sets byte length of payload of the specified record in this page. More... | |
uint16_t | get_record_length (uint16_t record) const |
Returns byte length of the specified record in this page. More... | |
void | get_all_records_nosync (uint16_t *record_count, const char **record_pointers, uint16_t *payload_lengthes) const |
Retrieve positions and lengthes of all records in one batch. More... | |
uint16_t | get_record_offset (uint16_t record) const |
Returns beginning offset of the specified record. More... | |
DualPagePointer & | next_page () |
const DualPagePointer & | next_page () const |
void | initialize_volatile_page (StorageId storage_id, VolatilePagePointer page_id) |
Called only when this page is initialized. More... | |
void | initialize_snapshot_page (StorageId storage_id, SnapshotPagePointer page_id) |
void | append_record_nosync (xct::XctId owner_id, uint16_t payload_length, const void *payload) |
Appends a record to this page. More... | |
bool | can_insert_record (uint16_t payload_length) const |
Returns if this page has enough room to insert a record with the given payload length. More... | |
Epoch | get_first_record_epoch () const |
Returns the epoch of the fist record in this page (undefined behavior if no record). More... | |
xct::RwLockableXctId * | owner_id_from_offset (uint16_t offset) |
const xct::RwLockableXctId * | owner_id_from_offset (uint16_t offset) const |
uint32_t | unused_dummy_func_filler () const |
|
delete |
|
delete |
|
inline |
Appends a record to this page.
This method assumes that there is no concurrent thread modifying this page (that's how we write both volatile and snapshot pages) and that the page has enough space.
Definition at line 155 of file sequential_page_impl.hpp.
References foedus::assorted::align8(), assert_consistent(), ASSERT_ND, get_record_count(), foedus::storage::PageVersionStatus::increment_version_counter(), foedus::storage::sequential::kDataSize, foedus::storage::PageHeader::key_count_, foedus::storage::sequential::kMaxSlots, foedus::storage::kRecordOverhead, foedus::xct::RwLockableXctId::lock_, foedus::assorted::memory_fence_release(), owner_id_from_offset(), foedus::storage::PageHeader::page_version_, foedus::xct::McsRwLock::reset(), set_payload_length(), foedus::storage::PageHeader::snapshot_, foedus::storage::PageVersion::status_, and foedus::xct::RwLockableXctId::xct_id_.
Referenced by foedus::storage::sequential::SequentialStoragePimpl::append_record(), and foedus::storage::sequential::SequentialComposer::compose().
|
inline |
Definition at line 81 of file sequential_page_impl.hpp.
References ASSERT_ND, get_record_count(), get_used_data_bytes(), and foedus::storage::sequential::kDataSize.
Referenced by append_record_nosync(), get_all_records_nosync(), get_payload_length(), get_record_offset(), and set_payload_length().
|
inline |
Returns if this page has enough room to insert a record with the given payload length.
This method does not guarantee if you can really insert it due to concurrent appends. Thus, this method should be followed by append_record, which does real check and insert.
Definition at line 184 of file sequential_page_impl.hpp.
References foedus::assorted::align8(), foedus::storage::sequential::kDataSize, foedus::storage::sequential::kMaxSlots, and foedus::storage::kRecordOverhead.
Referenced by foedus::storage::sequential::SequentialStoragePimpl::append_record(), and foedus::storage::sequential::SequentialComposer::compose().
|
inline |
Retrieve positions and lengthes of all records in one batch.
Definition at line 105 of file sequential_page_impl.hpp.
References foedus::assorted::align8(), assert_consistent(), get_payload_length(), get_record_count(), and foedus::storage::kRecordOverhead.
|
inline |
Returns the epoch of the fist record in this page (undefined behavior if no record).
Definition at line 193 of file sequential_page_impl.hpp.
References ASSERT_ND, foedus::xct::XctId::get_epoch(), get_record_count(), owner_id_from_offset(), and foedus::xct::RwLockableXctId::xct_id_.
Referenced by foedus::storage::sequential::SequentialStoragePimpl::append_record(), and foedus::storage::sequential::SequentialComposer::drop_volatiles().
|
inline |
Returns byte length of payload of the specified record in this page.
Definition at line 86 of file sequential_page_impl.hpp.
References assert_consistent(), ASSERT_ND, get_record_count(), and foedus::storage::sequential::kDataSize.
Referenced by get_all_records_nosync(), get_record_length(), and get_record_offset().
|
inline |
Returns how many records in this page placed so far.
Monotonically increasing. When the page becomes full, we go on to next page.
Definition at line 71 of file sequential_page_impl.hpp.
Referenced by foedus::storage::sequential::SequentialStoragePimpl::append_record(), append_record_nosync(), assert_consistent(), foedus::storage::sequential::SequentialComposer::drop_volatiles(), get_all_records_nosync(), get_first_record_epoch(), get_payload_length(), get_record_offset(), and foedus::storage::sequential::operator<<().
|
inline |
Returns byte length of the specified record in this page.
Definition at line 100 of file sequential_page_impl.hpp.
References get_payload_length(), and foedus::storage::kRecordOverhead.
|
inline |
Returns beginning offset of the specified record.
Definition at line 119 of file sequential_page_impl.hpp.
References foedus::assorted::align8(), assert_consistent(), ASSERT_ND, get_payload_length(), get_record_count(), and foedus::storage::kRecordOverhead.
|
inline |
How many data bytes in this page consumed so far.
Monotonically increasing. When the page becomes full, we go on to next page.
Definition at line 79 of file sequential_page_impl.hpp.
Referenced by assert_consistent().
|
inline |
Definition at line 61 of file sequential_page_impl.hpp.
Referenced by foedus::storage::sequential::SequentialComposer::compose().
|
inline |
Definition at line 62 of file sequential_page_impl.hpp.
|
inline |
Definition at line 141 of file sequential_page_impl.hpp.
References foedus::storage::PageHeader::init_snapshot(), foedus::storage::kSequentialPageType, foedus::storage::DualPagePointer::snapshot_pointer_, foedus::storage::DualPagePointer::volatile_pointer_, and foedus::storage::VolatilePagePointer::word.
Referenced by foedus::storage::sequential::SequentialComposer::compose().
|
inline |
Called only when this page is initialized.
Definition at line 134 of file sequential_page_impl.hpp.
References foedus::storage::PageHeader::init_volatile(), foedus::storage::kSequentialPageType, foedus::storage::DualPagePointer::snapshot_pointer_, foedus::storage::DualPagePointer::volatile_pointer_, and foedus::storage::VolatilePagePointer::word.
Referenced by foedus::storage::sequential::SequentialStoragePimpl::append_record().
|
inline |
Definition at line 130 of file sequential_page_impl.hpp.
Referenced by foedus::storage::sequential::SequentialStoragePimpl::append_record(), foedus::storage::sequential::SequentialComposer::compose(), and foedus::storage::sequential::SequentialComposer::drop_volatiles().
|
inline |
Definition at line 131 of file sequential_page_impl.hpp.
|
delete |
|
inline |
Definition at line 199 of file sequential_page_impl.hpp.
Referenced by append_record_nosync(), and get_first_record_epoch().
|
inline |
Definition at line 202 of file sequential_page_impl.hpp.
|
inline |
Sets byte length of payload of the specified record in this page.
Definition at line 94 of file sequential_page_impl.hpp.
References assert_consistent(), and foedus::storage::sequential::kDataSize.
Referenced by append_record_nosync().
|
inline |
Definition at line 206 of file sequential_page_impl.hpp.