libfoedus-core
FOEDUS Core Library
|
Pimpl object of HashStorage. More...
Pimpl object of HashStorage.
A private pimpl object for HashStorage. Do not include this header from a client program unless you know what you are doing.
Definition at line 93 of file hash_storage_pimpl.hpp.
#include <hash_storage_pimpl.hpp>
Public Member Functions | |
HashStoragePimpl () | |
HashStoragePimpl (HashStorage *storage) | |
void | release_pages_recursive_root (memory::PageReleaseBatch *batch, HashIntermediatePage *page, VolatilePagePointer volatile_page_id) |
Used only from uninitialize() More... | |
void | release_pages_recursive_intermediate (memory::PageReleaseBatch *batch, HashIntermediatePage *page, VolatilePagePointer volatile_page_id) |
void | release_pages_recursive_data (memory::PageReleaseBatch *batch, HashDataPage *page, VolatilePagePointer volatile_page_id) |
xct::TrackMovedRecordResult | track_moved_record (xct::RwLockableXctId *old_address, xct::WriteXctAccess *write_set) |
xct::TrackMovedRecordResult | track_moved_record_search (HashDataPage *page, const void *key, uint16_t key_length, const HashCombo &combo) |
ErrorStack | verify_single_thread (Engine *engine) |
These are defined in hash_storage_verify.cpp. More... | |
ErrorStack | verify_single_thread (thread::Thread *context) |
ErrorStack | verify_single_thread_intermediate (Engine *engine, HashIntermediatePage *page) |
ErrorStack | verify_single_thread_data (Engine *engine, HashDataPage *head) |
ErrorStack | hcc_reset_all_temperature_stat () |
For stupid reasons (I'm lazy!) these are defined in _debug.cpp. More... | |
ErrorStack | hcc_reset_all_temperature_stat_intermediate (VolatilePagePointer intermediate_page_id) |
ErrorStack | hcc_reset_all_temperature_stat_data (VolatilePagePointer head_page_id) |
ErrorStack | debugout_single_thread (Engine *engine, bool volatile_only, bool intermediate_only, uint32_t max_pages) |
These are defined in hash_storage_debug.cpp. More... | |
ErrorStack | debugout_single_thread_intermediate (Engine *engine, cache::SnapshotFileSet *fileset, HashIntermediatePage *parent, bool follow_volatile, bool intermediate_only, uint32_t *remaining_pages) |
ErrorStack | debugout_single_thread_data (Engine *engine, cache::SnapshotFileSet *fileset, HashDataPage *head, bool follow_volatile, uint32_t *remaining_pages) |
ErrorStack | create (const HashMetadata &metadata) |
ErrorStack | load (const StorageControlBlock &snapshot_block) |
ErrorStack | drop () |
bool | exists () const |
StorageId | get_id () const |
const StorageName & | get_name () const |
const HashMetadata & | get_meta () const |
uint8_t | get_levels () const |
HashBin | get_bin_count () const |
uint8_t | get_bin_bits () const |
uint8_t | get_bin_shifts () const |
ErrorCode | get_record (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, void *payload, uint16_t *payload_capacity, bool read_only) |
template<typename PAYLOAD > | |
ErrorCode | get_record_primitive (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, PAYLOAD *payload, uint16_t payload_offset, bool read_only) |
ErrorCode | get_record_part (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, void *payload, uint16_t payload_offset, uint16_t payload_count, bool read_only) |
ErrorCode | register_record_write_log (thread::Thread *context, const RecordLocation &location, log::RecordLogType *log_entry) |
Used in the following methods. More... | |
ErrorCode | insert_record (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, const void *payload, uint16_t payload_count, uint16_t physical_payload_hint) |
ErrorCode | delete_record (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo) |
ErrorCode | upsert_record (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, const void *payload, uint16_t payload_count, uint16_t physical_payload_hint) |
ErrorCode | overwrite_record (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, const void *payload, uint16_t payload_offset, uint16_t payload_count) |
template<typename PAYLOAD > | |
ErrorCode | overwrite_record_primitive (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, PAYLOAD payload, uint16_t payload_offset) |
template<typename PAYLOAD > | |
ErrorCode | increment_record (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, PAYLOAD *value, uint16_t payload_offset) |
ErrorCode | get_root_page (thread::Thread *context, bool for_write, HashIntermediatePage **root) |
Retrieves the root page of this storage. More... | |
ErrorCode | follow_page (thread::Thread *context, bool for_write, HashIntermediatePage *parent, uint16_t index_in_parent, Page **page) |
for non-root More... | |
ErrorCode | follow_page_bin_head (thread::Thread *context, bool for_write, HashIntermediatePage *parent, uint16_t index_in_parent, Page **page) |
subroutine to follow a pointer to head of bin from a volatile parent More... | |
ErrorCode | locate_bin (thread::Thread *context, bool for_write, const HashCombo &combo, HashDataPage **bin_head) |
Find a pointer to the bin that contains records for the hash. More... | |
ErrorCode | locate_record (thread::Thread *context, bool for_write, bool physical_only, bool create_if_notfound, uint16_t create_payload_length, const void *key, uint16_t key_length, const HashCombo &combo, HashDataPage *bin_head, RecordLocation *result) |
Usually follows locate_bin to locate the exact physical record for the key, or create a new one if not exists (only when for_write). More... | |
ErrorCode | locate_record_physical_only (thread::Thread *context, bool for_write, bool create_if_notfound, uint16_t create_payload_length, const void *key, uint16_t key_length, const HashCombo &combo, HashDataPage *bin_head, RecordLocation *result) |
locate_record()'s physical_only version. More... | |
ErrorCode | locate_record_logical (thread::Thread *context, bool for_write, bool create_if_notfound, uint16_t create_payload_length, const void *key, uint16_t key_length, const HashCombo &combo, HashDataPage *bin_head, RecordLocation *result) |
locate_record()'s logical+physical version. More... | |
ErrorCode | locate_record_in_snapshot (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, HashDataPage *bin_head, RecordLocation *result) |
Simpler version of locate_record for when we are in snapshot world. More... | |
ErrorCode | locate_record_reserve_physical (thread::Thread *context, const void *key, uint16_t key_length, const HashCombo &combo, uint16_t payload_length, HashDataPage **page_in_out, uint16_t examined_records, DataPageSlotIndex *new_location) |
Subroutine of locate_record() to create/migrate a physical record of the given key in the page or its next pages. More... | |
![]() | |
Attachable () | |
Attachable (Engine *engine) | |
Attachable (Engine *engine, HashStorageControlBlock *control_block) | |
Attachable (HashStorageControlBlock *control_block) | |
Attachable (const Attachable &other) | |
virtual | ~Attachable () |
Attachable & | operator= (const Attachable &other) |
virtual void | attach (HashStorageControlBlock *control_block) |
Attaches to the given shared memory. More... | |
bool | is_attached () const |
Returns whether the object has been already attached to some shared memory. More... | |
HashStorageControlBlock * | get_control_block () const |
Engine * | get_engine () const |
void | set_engine (Engine *engine) |
Additional Inherited Members | |
![]() | |
Engine * | engine_ |
Most attachable object stores an engine pointer (local engine), so we define it here. More... | |
HashStorageControlBlock * | control_block_ |
The shared data on shared memory that has been initialized in some SOC or master engine. More... | |
|
inline |
Definition at line 95 of file hash_storage_pimpl.hpp.
|
inlineexplicit |
Definition at line 96 of file hash_storage_pimpl.hpp.
ErrorStack foedus::storage::hash::HashStoragePimpl::create | ( | const HashMetadata & | metadata | ) |
Definition at line 76 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::storage::hash::HashIntermediatePage::assert_range(), foedus::storage::hash::bins_to_level(), foedus::Attachable< HashStorageControlBlock >::control_block_, foedus::Attachable< HashStorageControlBlock >::engine_, ERROR_STACK, ERROR_STACK_MSG, exists(), foedus::storage::hash::fanout_power(), get_bin_bits(), foedus::storage::hash::HashMetadata::get_bin_count(), get_bin_count(), get_id(), get_levels(), foedus::Engine::get_memory_manager(), get_name(), foedus::memory::EngineMemory::get_node_memory(), foedus::Engine::get_options(), foedus::memory::PagePool::get_resolver(), foedus::memory::NumaNodeMemoryRef::get_volatile_pool(), foedus::memory::PagePool::grab_one(), foedus::storage::hash::HashIntermediatePage::initialize_volatile_page(), foedus::kErrorCodeStrAlreadyExists, foedus::kErrorCodeStrHashBinsTooMany, foedus::storage::kExists, foedus::kRetOk, foedus::storage::StorageOptions::partitioner_data_memory_mb_, foedus::memory::LocalPageResolver::resolve_offset_newpage(), foedus::EngineOptions::storage_, and WRAP_ERROR_CODE.
Referenced by foedus::storage::hash::HashStorage::create().
ErrorStack foedus::storage::hash::HashStoragePimpl::debugout_single_thread | ( | Engine * | engine, |
bool | volatile_only, | ||
bool | intermediate_only, | ||
uint32_t | max_pages | ||
) |
These are defined in hash_storage_debug.cpp.
Definition at line 53 of file hash_storage_debug.cpp.
References foedus::storage::hash::TmpSnashotPage::as_intermediate(), CHECK_ERROR, foedus::Attachable< HashStorageControlBlock >::control_block_, debugout_single_thread_intermediate(), foedus::Attachable< HashStorageControlBlock >::engine_, foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::Engine::get_memory_manager(), foedus::storage::hash::TmpSnashotPage::init(), foedus::DefaultInitializable::initialize(), foedus::storage::VolatilePagePointer::is_null(), foedus::kRetOk, foedus::UninitializeGuard::kWarnIfUninitializeError, foedus::memory::GlobalVolatilePageResolver::resolve_offset(), foedus::storage::DualPagePointer::snapshot_pointer_, foedus::DefaultInitializable::uninitialize(), and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by foedus::storage::hash::HashStorage::debugout_single_thread().
ErrorStack foedus::storage::hash::HashStoragePimpl::debugout_single_thread_data | ( | Engine * | engine, |
cache::SnapshotFileSet * | fileset, | ||
HashDataPage * | head, | ||
bool | follow_volatile, | ||
uint32_t * | remaining_pages | ||
) |
Definition at line 181 of file hash_storage_debug.cpp.
References foedus::storage::hash::TmpSnashotPage::as_data(), CHECK_ERROR, foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::Engine::get_memory_manager(), foedus::storage::hash::TmpSnashotPage::init(), foedus::storage::VolatilePagePointer::is_null(), foedus::kRetOk, foedus::storage::DualPagePointer::snapshot_pointer_, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by debugout_single_thread_intermediate().
ErrorStack foedus::storage::hash::HashStoragePimpl::debugout_single_thread_intermediate | ( | Engine * | engine, |
cache::SnapshotFileSet * | fileset, | ||
HashIntermediatePage * | parent, | ||
bool | follow_volatile, | ||
bool | intermediate_only, | ||
uint32_t * | remaining_pages | ||
) |
Definition at line 116 of file hash_storage_debug.cpp.
References foedus::storage::hash::TmpSnashotPage::as_data(), foedus::storage::hash::TmpSnashotPage::as_intermediate(), CHECK_ERROR, debugout_single_thread_data(), foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::Engine::get_memory_manager(), foedus::storage::hash::HashIntermediatePage::get_pointer(), foedus::storage::hash::TmpSnashotPage::init(), foedus::storage::VolatilePagePointer::is_null(), foedus::kRetOk, foedus::storage::DualPagePointer::snapshot_pointer_, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by debugout_single_thread().
ErrorCode foedus::storage::hash::HashStoragePimpl::delete_record | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo | ||
) |
Definition at line 356 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::storage::hash::HashCommonLogType::calculate_log_length(), CHECK_ERROR_CODE, get_bin_bits(), get_id(), foedus::thread::Thread::get_thread_log_buffer(), foedus::storage::hash::HashCombo::hash_, foedus::xct::XctId::is_deleted(), foedus::storage::hash::RecordLocation::is_found(), foedus::kErrorCodeStrKeyNotFound, locate_bin(), locate_record_logical(), foedus::storage::hash::RecordLocation::observed_, foedus::storage::hash::HashDeleteLogType::populate(), register_record_write_log(), and foedus::log::ThreadLogBuffer::reserve_new_log().
Referenced by foedus::storage::hash::HashStorage::delete_record().
ErrorStack foedus::storage::hash::HashStoragePimpl::drop | ( | ) |
Definition at line 59 of file hash_storage_pimpl.cpp.
References foedus::Attachable< HashStorageControlBlock >::control_block_, foedus::Attachable< HashStorageControlBlock >::engine_, foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::Engine::get_memory_manager(), get_name(), foedus::kRetOk, foedus::storage::hash::HashIntermediatePage::release_pages_recursive_parallel(), and foedus::memory::GlobalVolatilePageResolver::resolve_offset().
Referenced by foedus::storage::hash::HashStorage::drop().
|
inline |
Definition at line 160 of file hash_storage_pimpl.hpp.
References foedus::Attachable< HashStorageControlBlock >::control_block_.
Referenced by create().
ErrorCode foedus::storage::hash::HashStoragePimpl::follow_page | ( | thread::Thread * | context, |
bool | for_write, | ||
HashIntermediatePage * | parent, | ||
uint16_t | index_in_parent, | ||
Page ** | page | ||
) |
for non-root
Definition at line 625 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::storage::hash::HashBinRange::begin_, CHECK_ERROR_CODE, foedus::thread::Thread::find_or_read_a_snapshot_page(), follow_page_bin_head(), foedus::thread::Thread::follow_page_pointer(), foedus::storage::hash::HashIntermediatePage::get_bin_range(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::storage::PageHeader::get_page_type(), foedus::storage::hash::HashIntermediatePage::get_pointer(), foedus::storage::hash::hash_intermediate_volatile_page_init(), foedus::storage::hash::HashIntermediatePage::header(), foedus::kErrorCodeOk, foedus::storage::kHashDataPageType, foedus::storage::hash::kHashIntermediatePageFanout, foedus::storage::kHashIntermediatePageType, foedus::storage::PageHeader::snapshot_, and foedus::storage::DualPagePointer::snapshot_pointer_.
Referenced by locate_bin().
ErrorCode foedus::storage::hash::HashStoragePimpl::follow_page_bin_head | ( | thread::Thread * | context, |
bool | for_write, | ||
HashIntermediatePage * | parent, | ||
uint16_t | index_in_parent, | ||
Page ** | page | ||
) |
subroutine to follow a pointer to head of bin from a volatile parent
Definition at line 679 of file hash_storage_pimpl.cpp.
References ASSERT_ND, CHECK_ERROR_CODE, foedus::storage::VolatilePagePointer::clear(), foedus::storage::construct_volatile_page_pointer(), foedus::thread::Thread::find_or_read_a_snapshot_page(), foedus::thread::Thread::follow_page_pointer(), foedus::storage::hash::HashDataPage::get_bin(), foedus::thread::Thread::get_current_xct(), foedus::xct::Xct::get_isolation_level(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::thread::Thread::get_local_volatile_page_resolver(), foedus::thread::Thread::get_numa_node(), foedus::storage::VolatilePagePointer::get_numa_node(), foedus::storage::VolatilePagePointer::get_offset(), foedus::storage::PageHeader::get_page_type(), foedus::storage::hash::HashIntermediatePage::get_pointer_address(), foedus::thread::Thread::get_thread_memory(), foedus::memory::NumaCoreMemory::grab_free_volatile_page_pointer(), foedus::storage::hash::hash_data_volatile_page_init(), foedus::storage::hash::HashIntermediatePage::header(), foedus::storage::hash::HashDataPage::header(), foedus::storage::VolatilePagePointer::is_null(), foedus::kErrorCodeMemoryNoFreePages, foedus::kErrorCodeOk, foedus::storage::kHashIntermediatePageType, foedus::storage::kPageSize, foedus::xct::kSerializable, foedus::xct::kSnapshot, foedus::storage::hash::HashDataPage::next_page(), foedus::storage::hash::HashDataPage::next_page_address(), foedus::storage::PageHeader::page_id_, foedus::memory::NumaCoreMemory::release_free_volatile_page(), foedus::thread::Thread::resolve(), foedus::thread::Thread::resolve_cast(), foedus::memory::LocalPageResolver::resolve_offset_newpage(), foedus::storage::PageHeader::snapshot_, foedus::storage::DualPagePointer::snapshot_pointer_, UNLIKELY, foedus::storage::DualPagePointer::volatile_pointer_, and foedus::storage::VolatilePagePointer::word.
Referenced by follow_page().
|
inline |
Definition at line 166 of file hash_storage_pimpl.hpp.
References foedus::storage::hash::HashMetadata::bin_bits_, and get_meta().
Referenced by create(), delete_record(), increment_record(), insert_record(), load(), overwrite_record(), and upsert_record().
|
inline |
Definition at line 165 of file hash_storage_pimpl.hpp.
References foedus::storage::hash::HashMetadata::get_bin_count(), and get_meta().
Referenced by create().
|
inline |
Definition at line 167 of file hash_storage_pimpl.hpp.
References foedus::storage::hash::HashMetadata::get_bin_shifts(), and get_meta().
|
inline |
Definition at line 161 of file hash_storage_pimpl.hpp.
References foedus::Attachable< HashStorageControlBlock >::control_block_.
Referenced by create(), delete_record(), increment_record(), insert_record(), overwrite_record(), register_record_write_log(), and upsert_record().
|
inline |
Definition at line 164 of file hash_storage_pimpl.hpp.
References foedus::Attachable< HashStorageControlBlock >::control_block_.
Referenced by create().
|
inline |
Definition at line 163 of file hash_storage_pimpl.hpp.
References foedus::Attachable< HashStorageControlBlock >::control_block_.
Referenced by get_bin_bits(), get_bin_count(), and get_bin_shifts().
|
inline |
Definition at line 162 of file hash_storage_pimpl.hpp.
References foedus::Attachable< HashStorageControlBlock >::control_block_.
Referenced by create(), drop(), and load().
ErrorCode foedus::storage::hash::HashStoragePimpl::get_record | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
void * | payload, | ||
uint16_t * | payload_capacity, | ||
bool | read_only | ||
) |
Definition at line 166 of file hash_storage_pimpl.cpp.
References CHECK_ERROR_CODE, foedus::storage::hash::RecordLocation::cur_payload_length_, foedus::storage::hash::RecordLocation::get_aligned_key_length(), foedus::storage::hash::RecordLocation::is_found(), foedus::kErrorCodeOk, foedus::kErrorCodeStrKeyNotFound, foedus::kErrorCodeStrTooSmallPayloadBuffer, locate_bin(), locate_record_logical(), and foedus::storage::hash::RecordLocation::record_.
Referenced by foedus::storage::hash::HashStorage::get_record().
ErrorCode foedus::storage::hash::HashStoragePimpl::get_record_part | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
void * | payload, | ||
uint16_t | payload_offset, | ||
uint16_t | payload_count, | ||
bool | read_only | ||
) |
Definition at line 210 of file hash_storage_pimpl.cpp.
References CHECK_ERROR_CODE, foedus::storage::hash::RecordLocation::cur_payload_length_, foedus::storage::hash::RecordLocation::get_aligned_key_length(), foedus::storage::hash::RecordLocation::is_found(), foedus::kErrorCodeOk, foedus::kErrorCodeStrKeyNotFound, foedus::kErrorCodeStrTooShortPayload, locate_bin(), locate_record_logical(), and foedus::storage::hash::RecordLocation::record_.
Referenced by foedus::storage::hash::HashStorage::get_record_part(), and get_record_primitive().
|
inline |
Definition at line 181 of file hash_storage_pimpl.hpp.
References get_record_part().
Referenced by foedus::storage::hash::HashStorage::get_record_primitive().
ErrorCode foedus::storage::hash::HashStoragePimpl::get_root_page | ( | thread::Thread * | context, |
bool | for_write, | ||
HashIntermediatePage ** | root | ||
) |
Retrieves the root page of this storage.
Definition at line 607 of file hash_storage_pimpl.cpp.
References ASSERT_ND, CHECK_ERROR_CODE, foedus::Attachable< HashStorageControlBlock >::control_block_, foedus::thread::Thread::follow_page_pointer(), foedus::kErrorCodeOk, and foedus::storage::kHashIntermediatePageType.
Referenced by locate_bin().
ErrorStack foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat | ( | ) |
For stupid reasons (I'm lazy!) these are defined in _debug.cpp.
Definition at line 213 of file hash_storage_debug.cpp.
References CHECK_ERROR, foedus::Attachable< HashStorageControlBlock >::control_block_, foedus::Attachable< HashStorageControlBlock >::engine_, hcc_reset_all_temperature_stat_intermediate(), foedus::storage::VolatilePagePointer::is_null(), foedus::kRetOk, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by foedus::storage::hash::HashStorage::hcc_reset_all_temperature_stat().
ErrorStack foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_data | ( | VolatilePagePointer | head_page_id | ) |
Definition at line 253 of file hash_storage_debug.cpp.
References foedus::Attachable< HashStorageControlBlock >::engine_, foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::Engine::get_memory_manager(), foedus::storage::hash::HashDataPage::header(), foedus::storage::PageHeader::hotness_, foedus::storage::VolatilePagePointer::is_null(), foedus::kRetOk, and foedus::assorted::ProbCounter::reset().
Referenced by hcc_reset_all_temperature_stat_intermediate().
ErrorStack foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_intermediate | ( | VolatilePagePointer | intermediate_page_id | ) |
Definition at line 231 of file hash_storage_debug.cpp.
References ASSERT_ND, CHECK_ERROR, foedus::Attachable< HashStorageControlBlock >::engine_, foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::Engine::get_memory_manager(), foedus::storage::hash::HashIntermediatePage::get_pointer(), hcc_reset_all_temperature_stat_data(), foedus::storage::VolatilePagePointer::is_null(), foedus::storage::hash::kHashIntermediatePageFanout, foedus::kRetOk, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by hcc_reset_all_temperature_stat().
ErrorCode foedus::storage::hash::HashStoragePimpl::increment_record | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
PAYLOAD * | value, | ||
uint16_t | payload_offset | ||
) |
Definition at line 554 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::storage::hash::HashCommonLogType::calculate_log_length(), CHECK_ERROR_CODE, foedus::storage::hash::RecordLocation::cur_payload_length_, foedus::storage::hash::RecordLocation::get_aligned_key_length(), get_bin_bits(), get_id(), foedus::thread::Thread::get_thread_log_buffer(), foedus::storage::hash::HashCombo::hash_, foedus::xct::XctId::is_deleted(), foedus::storage::hash::RecordLocation::is_found(), foedus::kErrorCodeStrKeyNotFound, foedus::kErrorCodeStrTooShortPayload, locate_bin(), locate_record_logical(), foedus::storage::hash::RecordLocation::observed_, foedus::storage::hash::HashOverwriteLogType::populate(), foedus::storage::hash::RecordLocation::record_, register_record_write_log(), and foedus::log::ThreadLogBuffer::reserve_new_log().
Referenced by foedus::storage::hash::HashStorage::increment_record().
ErrorCode foedus::storage::hash::HashStoragePimpl::insert_record | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
const void * | payload, | ||
uint16_t | payload_count, | ||
uint16_t | physical_payload_hint | ||
) |
Definition at line 277 of file hash_storage_pimpl.cpp.
References foedus::storage::hash::adjust_payload_hint(), ASSERT_ND, foedus::storage::hash::HashDataPage::bloom_filter(), foedus::storage::hash::HashCommonLogType::calculate_log_length(), CHECK_ERROR_CODE, foedus::storage::hash::DataPageBloomFilter::contains(), foedus::storage::hash::HashCombo::fingerprint_, get_bin_bits(), get_id(), foedus::storage::hash::RecordLocation::get_max_payload(), foedus::thread::Thread::get_thread_log_buffer(), foedus::storage::hash::HashCombo::hash_, foedus::storage::hash::HashDataPage::header(), foedus::storage::hash::RecordLocation::index_, foedus::xct::XctId::is_deleted(), foedus::storage::hash::RecordLocation::is_found(), foedus::kErrorCodeStrKeyAlreadyExists, locate_bin(), locate_record_logical(), foedus::storage::hash::RecordLocation::observed_, foedus::storage::hash::RecordLocation::page_, foedus::storage::hash::HashInsertLogType::populate(), foedus::storage::hash::RecordLocation::record_, register_record_write_log(), foedus::log::ThreadLogBuffer::reserve_new_log(), foedus::thread::Thread::run_nested_sysxct(), and foedus::storage::PageHeader::snapshot_.
Referenced by foedus::storage::hash::HashStorage::insert_record().
ErrorStack foedus::storage::hash::HashStoragePimpl::load | ( | const StorageControlBlock & | snapshot_block | ) |
Definition at line 135 of file hash_storage_pimpl.cpp.
References foedus::storage::hash::bins_to_level(), CHECK_ERROR, foedus::Attachable< HashStorageControlBlock >::control_block_, foedus::Attachable< HashStorageControlBlock >::engine_, get_bin_bits(), foedus::Engine::get_memory_manager(), get_name(), foedus::DefaultInitializable::initialize(), foedus::storage::kExists, foedus::kRetOk, foedus::UninitializeGuard::kWarnIfUninitializeError, foedus::memory::EngineMemory::load_one_volatile_page(), foedus::storage::StorageControlBlock::meta_, foedus::storage::Metadata::root_snapshot_page_id_, and foedus::DefaultInitializable::uninitialize().
Referenced by foedus::storage::hash::HashStorage::load().
ErrorCode foedus::storage::hash::HashStoragePimpl::locate_bin | ( | thread::Thread * | context, |
bool | for_write, | ||
const HashCombo & | combo, | ||
HashDataPage ** | bin_head | ||
) |
Find a pointer to the bin that contains records for the hash.
[in] | context | Thread context |
[in] | for_write | Whether we are reading these pages to modify |
[in] | combo | Hash values. |
[out] | bin_head | Pointer to the first data page of the bin. Might be null. |
If the search is for-write search, we always create a volatile page, even recursively, thus *bin_head!= null.
If the search is a for-read search and also the corresponding data page or its ascendants do not exist yet, *bin_head returns null. In that case, you can just return "not found" as a result. locate_bin() internally adds a pointer set to protect the result, too.
Definition at line 842 of file hash_storage_pimpl.cpp.
References foedus::xct::Xct::add_to_pointer_set(), ASSERT_ND, foedus::storage::hash::HashCombo::bin_, CHECK_ERROR_CODE, foedus::storage::VolatilePagePointer::clear(), follow_page(), foedus::storage::hash::HashDataPage::get_bin(), foedus::thread::Thread::get_current_xct(), foedus::xct::Xct::get_isolation_level(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::storage::hash::HashIntermediatePage::get_pointer(), get_root_page(), foedus::storage::hash::HashIntermediatePage::header(), foedus::kErrorCodeOk, foedus::xct::kSerializable, foedus::storage::hash::IntermediateRoute::route, foedus::storage::hash::HashCombo::route_, foedus::storage::PageHeader::snapshot_, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by delete_record(), get_record(), get_record_part(), increment_record(), insert_record(), overwrite_record(), and upsert_record().
ErrorCode foedus::storage::hash::HashStoragePimpl::locate_record | ( | thread::Thread * | context, |
bool | for_write, | ||
bool | physical_only, | ||
bool | create_if_notfound, | ||
uint16_t | create_payload_length, | ||
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
HashDataPage * | bin_head, | ||
RecordLocation * | result | ||
) |
Usually follows locate_bin to locate the exact physical record for the key, or create a new one if not exists (only when for_write).
[in] | context | Thread context |
[in] | for_write | Whether we are seeking the record to modify |
[in] | physical_only | If true, we skip observing XID and registering readset in a finalized fashion, see RecordLocation. |
[in] | create_if_notfound | Whether we will create a new physical record if not exists |
[in] | create_payload_length | If this method creates a physical record, it makes sure the record can accomodate at least this size of payload. |
[in] | key | The searching key. |
[in] | key_length | Byte length of the searching key. |
[in] | combo | Hash values. Also the result of this method. |
[in] | bin_head | Pointer to the first data page of the bin. |
[out] | result | Information on the found slot. |
If the exact record is not found, this method protects the result by adding page version set if physical_only is false. If create_if_notfound is true (an insert case), this method creates a new physical record for the key with a deleted-state as a system transaction.
Definition at line 936 of file hash_storage_pimpl.cpp.
References foedus::xct::Xct::add_to_page_version_set(), ASSERT_ND, foedus::storage::hash::HashCombo::bin_, CHECK_ERROR_CODE, foedus::storage::hash::RecordLocation::clear(), foedus::storage::hash::HashDataPage::compare_slot_key(), foedus::storage::hash::HashCombo::fingerprint_, foedus::storage::hash::HashDataPage::get_bin(), foedus::thread::Thread::get_current_xct(), foedus::thread::Thread::get_numa_node(), foedus::storage::hash::HashDataPage::get_record_count(), foedus::storage::PageVersionStatus::has_next_page(), foedus::storage::hash::HashCombo::hash_, foedus::storage::hash::HashDataPage::header(), foedus::xct::XctId::is_moved(), foedus::storage::VolatilePagePointer::is_null(), foedus::kErrorCodeOk, foedus::storage::hash::kSlotNotFound, locate_record_in_snapshot(), locate_record_reserve_physical(), foedus::assorted::memory_fence_acquire(), foedus::storage::hash::HashDataPage::next_page_address(), foedus::storage::hash::RecordLocation::observed_, foedus::storage::PageHeader::page_version_, foedus::storage::hash::RecordLocation::populate_logical(), foedus::storage::hash::RecordLocation::populate_physical(), foedus::thread::Thread::resolve_cast(), foedus::storage::hash::HashDataPage::search_key_physical(), foedus::storage::PageHeader::snapshot_, foedus::storage::PageHeader::stat_last_updater_node_, foedus::storage::PageVersion::status_, UNLIKELY, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by locate_record_logical(), and locate_record_physical_only().
ErrorCode foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
HashDataPage * | bin_head, | ||
RecordLocation * | result | ||
) |
Simpler version of locate_record for when we are in snapshot world.
Definition at line 889 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::storage::hash::HashCombo::bin_, CHECK_ERROR_CODE, foedus::storage::hash::RecordLocation::clear(), foedus::storage::hash::HashDataPage::compare_slot_key(), foedus::thread::Thread::find_or_read_a_snapshot_page(), foedus::storage::hash::HashCombo::fingerprint_, foedus::storage::hash::HashDataPage::get_bin(), foedus::storage::Page::get_header(), foedus::storage::hash::HashDataPage::get_record_count(), foedus::storage::hash::HashCombo::hash_, foedus::storage::hash::HashDataPage::header(), foedus::xct::XctId::is_moved(), foedus::storage::VolatilePagePointer::is_null(), foedus::kErrorCodeOk, foedus::storage::hash::kSlotNotFound, foedus::storage::hash::HashDataPage::next_page_address(), foedus::storage::hash::RecordLocation::observed_, foedus::storage::hash::RecordLocation::populate_physical(), foedus::storage::hash::HashDataPage::search_key_physical(), foedus::storage::PageHeader::snapshot_, foedus::storage::DualPagePointer::snapshot_pointer_, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by locate_record().
|
inline |
locate_record()'s logical+physical version.
Invoke this rather than locate_record directly
Definition at line 400 of file hash_storage_pimpl.hpp.
References locate_record().
Referenced by delete_record(), get_record(), get_record_part(), increment_record(), insert_record(), overwrite_record(), and upsert_record().
|
inline |
locate_record()'s physical_only version.
Invoke this rather than locate_record directly
Definition at line 377 of file hash_storage_pimpl.hpp.
References locate_record().
ErrorCode foedus::storage::hash::HashStoragePimpl::locate_record_reserve_physical | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
uint16_t | payload_length, | ||
HashDataPage ** | page_in_out, | ||
uint16_t | examined_records, | ||
DataPageSlotIndex * | new_location | ||
) |
Subroutine of locate_record() to create/migrate a physical record of the given key in the page or its next pages.
This method has the following possible outcomes:
In either case, new_location returns the index of the record, thus it's never a kSlotNotFound.
This method is physical-only. It doesn't add any read-set or take logical record locks. Thus, even seemingly right after calling this method, you might find the new_location points to a moved record. It might happen. The caller is responsible to do a logical lock/readset etc and retries if necessary. But, this method does guarantee that the new_location points to a record of the given key that was at least at some point valid.
Definition at line 1074 of file hash_storage_pimpl.cpp.
References ASSERT_ND, CHECK_ERROR_CODE, foedus::kErrorCodeOk, foedus::storage::hash::ReserveRecords::out_page_, foedus::storage::hash::ReserveRecords::out_slot_, and foedus::thread::Thread::run_nested_sysxct().
Referenced by locate_record().
ErrorCode foedus::storage::hash::HashStoragePimpl::overwrite_record | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
const void * | payload, | ||
uint16_t | payload_offset, | ||
uint16_t | payload_count | ||
) |
Definition at line 502 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::storage::hash::HashCommonLogType::calculate_log_length(), CHECK_ERROR_CODE, foedus::storage::hash::RecordLocation::cur_payload_length_, get_bin_bits(), get_id(), foedus::thread::Thread::get_thread_log_buffer(), foedus::storage::hash::HashCombo::hash_, foedus::xct::XctId::is_deleted(), foedus::storage::hash::RecordLocation::is_found(), foedus::kErrorCodeStrKeyNotFound, foedus::kErrorCodeStrTooShortPayload, locate_bin(), locate_record_logical(), foedus::storage::hash::RecordLocation::observed_, foedus::storage::hash::HashOverwriteLogType::populate(), register_record_write_log(), and foedus::log::ThreadLogBuffer::reserve_new_log().
Referenced by foedus::storage::hash::HashStorage::overwrite_record(), and overwrite_record_primitive().
|
inline |
Definition at line 259 of file hash_storage_pimpl.hpp.
References overwrite_record().
Referenced by foedus::storage::hash::HashStorage::overwrite_record_primitive().
ErrorCode foedus::storage::hash::HashStoragePimpl::register_record_write_log | ( | thread::Thread * | context, |
const RecordLocation & | location, | ||
log::RecordLogType * | log_entry | ||
) |
Used in the following methods.
Definition at line 260 of file hash_storage_pimpl.cpp.
References foedus::xct::Xct::add_related_write_set(), foedus::xct::Xct::add_to_write_set(), ASSERT_ND, foedus::thread::Thread::get_current_xct(), get_id(), foedus::storage::hash::HashDataPage::get_slot_address(), foedus::storage::hash::RecordLocation::index_, foedus::storage::hash::RecordLocation::is_found(), foedus::storage::hash::RecordLocation::page_, foedus::storage::hash::RecordLocation::readset_, and foedus::storage::hash::RecordLocation::record_.
Referenced by delete_record(), increment_record(), insert_record(), overwrite_record(), and upsert_record().
void foedus::storage::hash::HashStoragePimpl::release_pages_recursive_data | ( | memory::PageReleaseBatch * | batch, |
HashDataPage * | page, | ||
VolatilePagePointer | volatile_page_id | ||
) |
void foedus::storage::hash::HashStoragePimpl::release_pages_recursive_intermediate | ( | memory::PageReleaseBatch * | batch, |
HashIntermediatePage * | page, | ||
VolatilePagePointer | volatile_page_id | ||
) |
void foedus::storage::hash::HashStoragePimpl::release_pages_recursive_root | ( | memory::PageReleaseBatch * | batch, |
HashIntermediatePage * | page, | ||
VolatilePagePointer | volatile_page_id | ||
) |
Used only from uninitialize()
xct::TrackMovedRecordResult foedus::storage::hash::HashStoragePimpl::track_moved_record | ( | xct::RwLockableXctId * | old_address, |
xct::WriteXctAccess * | write_set | ||
) |
Definition at line 1099 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::storage::hash::HashCommonLogType::assert_record_and_log_keys(), foedus::Attachable< HashStorageControlBlock >::control_block_, foedus::xct::RwLockableXctId::is_moved(), foedus::storage::kHashDataPageType, foedus::xct::WriteXctAccess::log_entry_, foedus::xct::WriteXctAccess::payload_address_, foedus::xct::RecordXctAccess::storage_id_, foedus::storage::to_page(), and track_moved_record_search().
Referenced by foedus::storage::hash::HashStorage::track_moved_record().
xct::TrackMovedRecordResult foedus::storage::hash::HashStoragePimpl::track_moved_record_search | ( | HashDataPage * | page, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo | ||
) |
Definition at line 1135 of file hash_storage_pimpl.cpp.
References ASSERT_ND, foedus::Attachable< HashStorageControlBlock >::engine_, foedus::storage::hash::HashCombo::fingerprint_, foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::Engine::get_memory_manager(), foedus::storage::hash::HashDataPage::get_record_count(), foedus::storage::hash::HashDataPage::get_slot_address(), foedus::storage::hash::HashCombo::hash_, foedus::storage::hash::HashDataPage::header(), foedus::storage::VolatilePagePointer::is_null(), foedus::storage::hash::kSlotNotFound, foedus::assorted::memory_fence_acquire(), foedus::assorted::memory_fence_consume(), foedus::storage::hash::HashDataPage::next_page_address(), foedus::storage::hash::HashDataPage::Slot::offset_, foedus::storage::hash::HashDataPage::record_from_offset(), foedus::memory::GlobalVolatilePageResolver::resolve_offset(), foedus::storage::hash::HashDataPage::search_key_physical(), foedus::storage::PageHeader::snapshot_, foedus::storage::DualPagePointer::snapshot_pointer_, foedus::storage::hash::HashDataPage::Slot::tid_, UNLIKELY, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by track_moved_record().
ErrorCode foedus::storage::hash::HashStoragePimpl::upsert_record | ( | thread::Thread * | context, |
const void * | key, | ||
uint16_t | key_length, | ||
const HashCombo & | combo, | ||
const void * | payload, | ||
uint16_t | payload_count, | ||
uint16_t | physical_payload_hint | ||
) |
Definition at line 390 of file hash_storage_pimpl.cpp.
References foedus::storage::hash::adjust_payload_hint(), ASSERT_ND, foedus::storage::hash::HashDataPage::bloom_filter(), foedus::storage::hash::HashCommonLogType::calculate_log_length(), CHECK_ERROR_CODE, foedus::storage::hash::DataPageBloomFilter::contains(), foedus::storage::hash::RecordLocation::cur_payload_length_, foedus::storage::hash::HashCombo::fingerprint_, get_bin_bits(), get_id(), foedus::storage::hash::RecordLocation::get_max_payload(), foedus::thread::Thread::get_thread_log_buffer(), foedus::storage::hash::HashCombo::hash_, foedus::storage::hash::HashDataPage::header(), foedus::storage::hash::RecordLocation::index_, foedus::xct::XctId::is_deleted(), foedus::storage::hash::RecordLocation::is_found(), locate_bin(), locate_record_logical(), foedus::storage::hash::RecordLocation::observed_, foedus::storage::hash::RecordLocation::page_, foedus::storage::hash::HashInsertLogType::populate(), foedus::storage::hash::HashUpdateLogType::populate(), foedus::storage::hash::HashOverwriteLogType::populate(), foedus::storage::hash::RecordLocation::record_, register_record_write_log(), foedus::log::ThreadLogBuffer::reserve_new_log(), foedus::thread::Thread::run_nested_sysxct(), and foedus::storage::PageHeader::snapshot_.
Referenced by foedus::storage::hash::HashStorage::upsert_record().
ErrorStack foedus::storage::hash::HashStoragePimpl::verify_single_thread | ( | Engine * | engine | ) |
These are defined in hash_storage_verify.cpp.
Definition at line 42 of file hash_storage_verify.cpp.
References CHECK_AND_ASSERT, CHECK_ERROR, foedus::Attachable< HashStorageControlBlock >::control_block_, foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::Engine::get_memory_manager(), foedus::storage::VolatilePagePointer::is_null(), foedus::kRetOk, foedus::memory::GlobalVolatilePageResolver::resolve_offset(), and verify_single_thread_intermediate().
Referenced by foedus::storage::hash::HashStorage::verify_single_thread(), and verify_single_thread().
ErrorStack foedus::storage::hash::HashStoragePimpl::verify_single_thread | ( | thread::Thread * | context | ) |
Definition at line 39 of file hash_storage_verify.cpp.
References foedus::thread::Thread::get_engine(), and verify_single_thread().
ErrorStack foedus::storage::hash::HashStoragePimpl::verify_single_thread_data | ( | Engine * | engine, |
HashDataPage * | head | ||
) |
Definition at line 87 of file hash_storage_verify.cpp.
References CHECK_AND_ASSERT, foedus::storage::hash::HashDataPage::get_bin(), foedus::xct::XctId::get_epoch(), foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::Engine::get_memory_manager(), foedus::xct::XctId::is_being_written(), foedus::xct::RwLockableXctId::is_keylocked(), foedus::storage::VolatilePagePointer::is_null(), foedus::Epoch::is_valid(), foedus::storage::kHashDataPageType, foedus::kRetOk, foedus::storage::hash::HashDataPage::Slot::tid_, and foedus::xct::RwLockableXctId::xct_id_.
Referenced by verify_single_thread_intermediate().
ErrorStack foedus::storage::hash::HashStoragePimpl::verify_single_thread_intermediate | ( | Engine * | engine, |
HashIntermediatePage * | page | ||
) |
Definition at line 55 of file hash_storage_verify.cpp.
References foedus::storage::hash::HashBinRange::begin_, CHECK_AND_ASSERT, CHECK_ERROR, foedus::storage::hash::HashBinRange::end_, foedus::storage::hash::HashDataPage::get_bin(), foedus::storage::hash::HashIntermediatePage::get_bin_range(), foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::Engine::get_memory_manager(), foedus::storage::PageHeader::get_page_type(), foedus::storage::hash::HashIntermediatePage::get_pointer(), foedus::storage::hash::HashIntermediatePage::header(), foedus::storage::PageVersion::is_locked(), foedus::storage::PageVersion::is_moved(), foedus::storage::VolatilePagePointer::is_null(), foedus::storage::PageVersion::is_retired(), foedus::storage::hash::kHashIntermediatePageFanout, foedus::storage::kHashIntermediatePageType, foedus::storage::hash::kHashMaxBins, foedus::kRetOk, foedus::storage::PageHeader::page_version_, verify_single_thread_data(), and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by verify_single_thread().