libfoedus-core
FOEDUS Core Library
|
return value of locate_record(). More...
return value of locate_record().
But, seems like this is now unavoidable. Hence now locate_record() is a logical operation. To allow the caller to choose what to do logically, we receive a paramter physical_only. When false, locate_record might take logical lock and add the XID to readset, hence what locate_record() observed is protected. When true, locate_record never takes lock or adds it to readset. It just physically locates a record that was at least at some point a valid record. In this case, the caller is responsible to do appropriate thing to protect from concurrent modifications.
Definition at line 76 of file hash_record_location.hpp.
#include <hash_record_location.hpp>
Public Member Functions | |
bool | is_found () const |
uint16_t | get_aligned_key_length () const |
uint16_t | get_max_payload () const |
void | clear () |
ErrorCode | populate_logical (xct::Xct *cur_xct, HashDataPage *page, DataPageSlotIndex index, bool intended_for_write) |
Populates the result with XID and possibly readset. More... | |
void | populate_physical (HashDataPage *page, DataPageSlotIndex index) |
Populates fields other than readset_. More... | |
Public Attributes | |
HashDataPage * | page_ |
The data page (might not be bin-head) containing the record. More... | |
DataPageSlotIndex | index_ |
Index of the record in the page. More... | |
uint16_t | cur_payload_length_ |
Logical payload length as-of the observed XID. More... | |
uint16_t | key_length_ |
Key length of the slot, which is immutable. More... | |
uint16_t | physical_record_length_ |
Byte count the record of the slot occupies, which is immutable. More... | |
char * | record_ |
Address of the record. More... | |
xct::XctId | observed_ |
TID as of locate_record() identifying the record. More... | |
xct::ReadXctAccess * | readset_ |
If this method took a read-set on the returned record, points to the corresponding read-set. More... | |
|
inline |
Definition at line 114 of file hash_record_location.hpp.
References CXX11_NULLPTR, foedus::xct::XctId::data_, and foedus::storage::hash::kSlotNotFound.
Referenced by foedus::storage::hash::HashStoragePimpl::locate_record(), and foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot().
|
inline |
Definition at line 109 of file hash_record_location.hpp.
References foedus::assorted::align8().
Referenced by get_max_payload(), foedus::storage::hash::HashStoragePimpl::get_record(), foedus::storage::hash::HashStoragePimpl::get_record_part(), and foedus::storage::hash::HashStoragePimpl::increment_record().
|
inline |
Definition at line 110 of file hash_record_location.hpp.
References get_aligned_key_length().
Referenced by foedus::storage::hash::HashStoragePimpl::insert_record(), and foedus::storage::hash::HashStoragePimpl::upsert_record().
|
inline |
Definition at line 108 of file hash_record_location.hpp.
References foedus::storage::hash::kSlotNotFound.
Referenced by foedus::storage::hash::HashStoragePimpl::delete_record(), foedus::storage::hash::HashStoragePimpl::get_record(), foedus::storage::hash::HashStoragePimpl::get_record_part(), foedus::storage::hash::HashStoragePimpl::increment_record(), foedus::storage::hash::HashStoragePimpl::insert_record(), foedus::storage::hash::HashStoragePimpl::overwrite_record(), foedus::storage::hash::HashStoragePimpl::register_record_write_log(), and foedus::storage::hash::HashStoragePimpl::upsert_record().
ErrorCode foedus::storage::hash::RecordLocation::populate_logical | ( | xct::Xct * | cur_xct, |
HashDataPage * | page, | ||
DataPageSlotIndex | index, | ||
bool | intended_for_write | ||
) |
Populates the result with XID and possibly readset.
This is a logical operation that might take a readset.
Definition at line 27 of file hash_record_location.cpp.
References ASSERT_ND, CHECK_ERROR_CODE, cur_payload_length_, foedus::storage::hash::HashDataPage::get_slot_address(), index_, foedus::xct::XctId::is_being_written(), foedus::xct::XctId::is_moved(), foedus::xct::XctId::is_next_layer(), foedus::xct::XctId::is_valid(), foedus::kErrorCodeOk, key_length_, foedus::storage::hash::HashDataPage::Slot::key_length_, foedus::assorted::memory_fence_consume(), observed_, foedus::storage::hash::HashDataPage::Slot::offset_, foedus::xct::Xct::on_record_read(), page_, foedus::storage::hash::HashDataPage::Slot::payload_length_, physical_record_length_, foedus::storage::hash::HashDataPage::Slot::physical_record_length_, readset_, record_, foedus::storage::hash::HashDataPage::record_from_offset(), foedus::storage::hash::HashDataPage::Slot::tid_, and foedus::xct::RwLockableXctId::xct_id_.
Referenced by foedus::storage::hash::HashStoragePimpl::locate_record().
void foedus::storage::hash::RecordLocation::populate_physical | ( | HashDataPage * | page, |
DataPageSlotIndex | index | ||
) |
Populates fields other than readset_.
This is a physical-only operation that never takes readset/locks.
Definition at line 79 of file hash_record_location.cpp.
References ASSERT_ND, cur_payload_length_, foedus::storage::hash::HashDataPage::get_slot_address(), index_, foedus::xct::XctId::is_being_written(), foedus::xct::XctId::is_next_layer(), foedus::xct::XctId::is_valid(), key_length_, foedus::storage::hash::HashDataPage::Slot::key_length_, observed_, foedus::storage::hash::HashDataPage::Slot::offset_, page_, foedus::storage::hash::HashDataPage::Slot::payload_length_, physical_record_length_, foedus::storage::hash::HashDataPage::Slot::physical_record_length_, readset_, record_, foedus::storage::hash::HashDataPage::record_from_offset(), foedus::xct::XctId::spin_while_being_written(), foedus::storage::hash::HashDataPage::Slot::tid_, and foedus::xct::RwLockableXctId::xct_id_.
Referenced by foedus::storage::hash::HashStoragePimpl::locate_record(), and foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot().
uint16_t foedus::storage::hash::RecordLocation::cur_payload_length_ |
Logical payload length as-of the observed XID.
payload_length_ in hash page slot is mutable, so this must be paired with observed_ in serializable transactions.
Definition at line 86 of file hash_record_location.hpp.
Referenced by foedus::storage::hash::HashStoragePimpl::get_record(), foedus::storage::hash::HashStoragePimpl::get_record_part(), foedus::storage::hash::HashStoragePimpl::increment_record(), foedus::storage::hash::HashStoragePimpl::overwrite_record(), populate_logical(), populate_physical(), and foedus::storage::hash::HashStoragePimpl::upsert_record().
DataPageSlotIndex foedus::storage::hash::RecordLocation::index_ |
Index of the record in the page.
kSlotNotFound if not found.
Definition at line 80 of file hash_record_location.hpp.
Referenced by foedus::storage::hash::HashStoragePimpl::insert_record(), populate_logical(), populate_physical(), foedus::storage::hash::HashStoragePimpl::register_record_write_log(), and foedus::storage::hash::HashStoragePimpl::upsert_record().
uint16_t foedus::storage::hash::RecordLocation::key_length_ |
Key length of the slot, which is immutable.
Definition at line 88 of file hash_record_location.hpp.
Referenced by populate_logical(), and populate_physical().
xct::XctId foedus::storage::hash::RecordLocation::observed_ |
TID as of locate_record() identifying the record.
guaranteed to be not is_moved (then automatically retried), though the current TID might be now moved, in which case pre-commit will catch it. See the class comment.
Definition at line 100 of file hash_record_location.hpp.
Referenced by foedus::storage::hash::HashStoragePimpl::delete_record(), foedus::storage::hash::HashStoragePimpl::increment_record(), foedus::storage::hash::HashStoragePimpl::insert_record(), foedus::storage::hash::HashStoragePimpl::locate_record(), foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot(), foedus::storage::hash::HashStoragePimpl::overwrite_record(), populate_logical(), populate_physical(), and foedus::storage::hash::HashStoragePimpl::upsert_record().
HashDataPage* foedus::storage::hash::RecordLocation::page_ |
The data page (might not be bin-head) containing the record.
Definition at line 78 of file hash_record_location.hpp.
Referenced by foedus::storage::hash::HashStoragePimpl::insert_record(), populate_logical(), populate_physical(), foedus::storage::hash::HashStoragePimpl::register_record_write_log(), and foedus::storage::hash::HashStoragePimpl::upsert_record().
uint16_t foedus::storage::hash::RecordLocation::physical_record_length_ |
Byte count the record of the slot occupies, which is immutable.
Definition at line 90 of file hash_record_location.hpp.
Referenced by populate_logical(), and populate_physical().
xct::ReadXctAccess* foedus::storage::hash::RecordLocation::readset_ |
If this method took a read-set on the returned record, points to the corresponding read-set.
Otherwise nullptr.
Definition at line 106 of file hash_record_location.hpp.
Referenced by populate_logical(), populate_physical(), and foedus::storage::hash::HashStoragePimpl::register_record_write_log().
char* foedus::storage::hash::RecordLocation::record_ |
Address of the record.
null if not found.
Definition at line 93 of file hash_record_location.hpp.
Referenced by foedus::storage::hash::HashStoragePimpl::get_record(), foedus::storage::hash::HashStoragePimpl::get_record_part(), foedus::storage::hash::HashStoragePimpl::increment_record(), foedus::storage::hash::HashStoragePimpl::insert_record(), populate_logical(), populate_physical(), foedus::storage::hash::HashStoragePimpl::register_record_write_log(), and foedus::storage::hash::HashStoragePimpl::upsert_record().