libfoedus-core
FOEDUS Core Library
|
Storage Manager, which implements a couple of key/value stores. More...
Storage Manager, which implements a couple of key/value stores.
This package contains core classes that store key/value pairs. This layer has no idea about what is stored, thus no notion of columns either.
So far we provide four types of storages; Array Storage, Hashtable Storage, Sequential Storage, and Masstree Storage. Choose the type of storage based on the data to store and access patterns.
Namespaces | |
array | |
Array Storage, a dense and regular array. | |
hash | |
Hashtable Storage, a concurrent hashtable. | |
masstree | |
Masstree Storage, 64-bit B-tries with internal B-trees. | |
sequential | |
Sequential Storage, an append/scan only data structure. | |
Classes | |
class | Composer |
Represents a logic to compose a new version of data pages for one storage. More... | |
struct | CreateLogType |
Base type for CREATE STORAGE operation. More... | |
struct | DropLogType |
Log type of DROP STORAGE operation. More... | |
struct | DualPagePointer |
Represents a pointer to another page (usually a child page). More... | |
struct | Metadata |
Metadata of one storage. More... | |
struct | MetadataSerializer |
struct | Page |
Just a marker to denote that the memory region represents a data page. More... | |
struct | PageHeader |
Just a marker to denote that a memory region represents a data page. More... | |
struct | PageVersion |
Just a synonym of XctId to be used as a page lock mechanism. More... | |
struct | PageVersionStatus |
class | Partitioner |
Partitioning and sorting logic for one storage. More... | |
struct | PartitionerMetadata |
Tiny metadata of partitioner for every storage used while log gleaning. More... | |
struct | Record |
Represents one record in our key-value store. More... | |
class | Storage |
Represents one key-value store. More... | |
struct | StorageControlBlock |
A base layout of shared data for all storage types. More... | |
class | StorageManager |
Storage Manager class that provides API to create/open/close/drop key-value stores. More... | |
struct | StorageManagerControlBlock |
Shared data in StorageManagerPimpl. More... | |
class | StorageManagerPimpl |
Pimpl object of StorageManager. More... | |
struct | StorageOptions |
Set of options for storage manager. More... | |
struct | VolatilePageInitArguments |
Set of arguments, both inputs and outputs, given to each volatile page initializer. More... | |
struct | VolatilePagePointer |
Represents a pointer to a volatile page with modification count for preventing ABA. More... | |
Typedefs | |
typedef void(* | VolatilePageInit) (const VolatilePageInitArguments &args) |
A function pointer to initialize a volatile page. More... | |
typedef uint32_t | StorageId |
Unique ID for storage. More... | |
typedef assorted::FixedString< 60 > | StorageName |
Represents a unique name of a storage. More... | |
typedef thread::ThreadGroupId | PartitionId |
As partition=NUMA node, this is just a synonym of foedus::thread::ThreadGroupId. More... | |
typedef uint64_t | SnapshotPagePointer |
Page ID of a snapshot page. More... | |
typedef uint64_t | SnapshotLocalPageId |
Represents a local page ID in each one snapshot file in some NUMA node. More... | |
typedef uint32_t | Checksum |
Checksum of a snapshot page. More... | |
Enumerations | |
enum | PageType { kUnknownPageType = 0, kArrayPageType = 1, kMasstreeIntermediatePageType = 2, kMasstreeBorderPageType = 3, kSequentialPageType = 4, kSequentialRootPageType = 5, kHashIntermediatePageType = 6, kHashDataPageType = 7, kHashComposedBinsPageType = 8, kDummyLastPageType } |
The following 1-byte value is stored in the common page header. More... | |
enum | StorageType { kInvalidStorage = 0, kArrayStorage, kHashStorage, kMasstreeStorage, kSequentialStorage } |
Type of the storage, such as hash. More... | |
enum | StorageStatus { kNotExists = 0, kExists, kMarkedForDeath } |
Status of a storage. More... | |
Variables | |
const uint16_t | kRecordOverhead = sizeof(xct::RwLockableXctId) |
Byte size of system-managed region per each record. More... | |
const uint16_t | kPageSize = 1 << 12 |
A constant defining the page size (in bytes) of both snapshot pages and volatile pages. More... | |
const uint8_t | kVolatilePointerFlagSwappable = 0x02 |
const char * | kChildTagName = "storage" |
const StorageName | kEmptyString |
typedef assorted::FixedString<60> foedus::storage::StorageName |
Represents a unique name of a storage.
Upto 60 characters so far.
Definition at line 58 of file storage_id.hpp.
|
inline |
|
inline |
Definition at line 402 of file page.hpp.
References ASSERT_ND, and kPageSize.
Referenced by assert_valid_volatile_page(), foedus::storage::masstree::MasstreeStoragePimpl::find_border_physical(), foedus::storage::masstree::MasstreeStoragePimpl::get_first_root(), and foedus::memory::GlobalVolatilePageResolver::resolve_offset_newpage().
|
inline |
Definition at line 102 of file storage_id.hpp.
References ASSERT_ND.
Referenced by to_snapshot_page_pointer().
|
inline |
Definition at line 407 of file page.hpp.
References assert_aligned_page(), ASSERT_ND, foedus::storage::Page::get_header(), foedus::storage::VolatilePagePointer::get_offset(), foedus::storage::PageHeader::get_page_type(), kArrayPageType, kDummyLastPageType, foedus::storage::PageHeader::page_id_, and foedus::storage::VolatilePagePointer::word.
Referenced by foedus::thread::ThreadPimpl::follow_page_pointer(), foedus::thread::ThreadPimpl::follow_page_pointers_for_read_batch(), foedus::thread::ThreadPimpl::follow_page_pointers_for_write_batch(), foedus::memory::LocalPageResolver::resolve_offset(), and foedus::memory::GlobalVolatilePageResolver::resolve_offset().
|
inline |
Definition at line 428 of file page.hpp.
References assert_within_valid_volatile_page_impl().
Referenced by foedus::xct::Xct::add_to_read_set(), foedus::xct::Xct::add_to_write_set(), foedus::xct::Xct::on_record_read(), foedus::xct::Xct::on_record_read_take_locks_if_needed(), and foedus::xct::to_universal_lock_id().
void foedus::storage::assert_within_valid_volatile_page_impl | ( | const memory::GlobalVolatilePageResolver & | resolver, |
const void * | address | ||
) |
Ah, oh, finally realized why I occasionally hit assertions here. When we have multiple VA mappings (eg emulated fork mode), it is possible that base + offset becomes a different address even if pointing to the same physical page. Unfortunately we can't do this check.. but only page-ID check.
Ah, oh, finally realized why I occasionally hit assertions here. When we have multiple VA mappings (eg emulated fork mode), it is possible that base + offset becomes a different address even if pointing to the same physical page. Unfortunately we can't do this check.. but only page-ID check.
Definition at line 85 of file page.cpp.
References ASSERT_ND, foedus::memory::GlobalVolatilePageResolver::begin_, construct_volatile_page_pointer(), foedus::memory::GlobalVolatilePageResolver::end_, foedus::storage::Page::get_header(), foedus::memory::GlobalVolatilePageResolver::numa_node_count_, foedus::storage::PageHeader::page_id_, foedus::memory::GlobalVolatilePageResolver::resolve_offset(), foedus::storage::PageHeader::snapshot_, and to_page().
Referenced by assert_within_valid_volatile_page().
|
inline |
Definition at line 235 of file storage_id.hpp.
References foedus::storage::VolatilePagePointer::set().
Referenced by foedus::storage::sequential::SequentialComposer::drop_volatiles().
|
inline |
Definition at line 230 of file storage_id.hpp.
References foedus::storage::VolatilePagePointer::word.
Referenced by assert_within_valid_volatile_page_impl(), foedus::storage::hash::HashStoragePimpl::follow_page_bin_head(), foedus::storage::array::ArrayStoragePimpl::lookup_for_read_batch(), foedus::storage::array::ArrayStoragePimpl::lookup_for_write_batch(), foedus::xct::Xct::on_record_read(), foedus::storage::hash::resolve_data_impl(), foedus::storage::hash::resolve_intermediate_impl(), foedus::memory::GlobalVolatilePageResolver::resolve_offset(), and foedus::xct::to_universal_lock_id().
void foedus::storage::describe_snapshot_pointer | ( | std::ostream * | o, |
SnapshotPagePointer | pointer | ||
) |
Definition at line 27 of file storage_id.cpp.
References extract_local_page_id_from_snapshot_pointer(), extract_numa_node_from_snapshot_pointer(), and extract_snapshot_id_from_snapshot_pointer().
Referenced by operator<<().
void foedus::storage::describe_volatile_pointer | ( | std::ostream * | o, |
VolatilePagePointer | pointer | ||
) |
Definition at line 44 of file storage_id.cpp.
References foedus::storage::VolatilePagePointer::get_numa_node(), foedus::storage::VolatilePagePointer::get_offset(), and foedus::storage::VolatilePagePointer::is_null().
Referenced by foedus::storage::masstree::describe_masstree_page_common(), and operator<<().
|
inline |
Definition at line 91 of file storage_id.hpp.
Referenced by describe_snapshot_pointer(), foedus::cache::HashFunc::get_hash(), foedus::storage::array::ArrayStoragePimpl::lookup_for_read_batch(), foedus::cache::SnapshotFileSet::read_page(), and foedus::cache::SnapshotFileSet::read_pages().
|
inline |
Definition at line 95 of file storage_id.hpp.
Referenced by foedus::storage::sequential::SequentialComposer::compose(), foedus::storage::sequential::SequentialComposer::construct_root(), describe_snapshot_pointer(), foedus::storage::array::ArrayPartitioner::design_partition(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::array::ArrayComposer::drop_volatiles(), foedus::storage::hash::HashComposer::drop_volatiles(), foedus::cache::HashFunc::get_hash(), foedus::cache::SnapshotFileSet::get_or_open_file(), foedus::storage::PageHeader::init_snapshot(), and foedus::memory::EngineMemory::load_one_volatile_page().
|
inline |
Definition at line 98 of file storage_id.hpp.
Referenced by foedus::storage::masstree::MasstreeIntermediatePage::append_pointer_snapshot(), foedus::storage::sequential::SequentialComposer::compose(), foedus::storage::array::ArrayComposer::construct_root(), foedus::storage::sequential::SequentialComposer::construct_root(), describe_snapshot_pointer(), foedus::storage::masstree::from_this_snapshot(), foedus::cache::HashFunc::get_hash(), foedus::cache::SnapshotFileSet::get_or_open_file(), foedus::storage::hash::ComposedBinsMergedStream::open_path(), and foedus::storage::hash::ComposedBinsMergedStream::process_a_bin().
StorageControlBlock * foedus::storage::get_storage_control_block | ( | Engine * | engine, |
StorageId | id | ||
) |
Definition at line 26 of file storage.cpp.
References foedus::storage::StorageManager::get_storage(), and foedus::Engine::get_storage_manager().
StorageControlBlock * foedus::storage::get_storage_control_block | ( | Engine * | engine, |
const StorageName & | name | ||
) |
Definition at line 29 of file storage.cpp.
References foedus::storage::StorageManager::get_storage(), and foedus::Engine::get_storage_manager().
ErrorStack foedus::storage::load_from_xml_array | ( | tinyxml2::XMLElement * | element, |
Metadata * | data | ||
) |
Definition at line 85 of file metadata.cpp.
References foedus::storage::array::ArrayMetadataSerializer::load().
Referenced by foedus::storage::MetadataSerializer::load_all_storages_from_xml().
ErrorStack foedus::storage::load_from_xml_hash | ( | tinyxml2::XMLElement * | element, |
Metadata * | data | ||
) |
Definition at line 89 of file metadata.cpp.
References foedus::storage::hash::HashMetadataSerializer::load().
Referenced by foedus::storage::MetadataSerializer::load_all_storages_from_xml().
ErrorStack foedus::storage::load_from_xml_masstree | ( | tinyxml2::XMLElement * | element, |
Metadata * | data | ||
) |
Definition at line 93 of file metadata.cpp.
References foedus::storage::masstree::MasstreeMetadataSerializer::load().
Referenced by foedus::storage::MetadataSerializer::load_all_storages_from_xml().
ErrorStack foedus::storage::load_from_xml_sequential | ( | tinyxml2::XMLElement * | element, |
Metadata * | data | ||
) |
Definition at line 98 of file metadata.cpp.
References foedus::storage::sequential::SequentialMetadataSerializer::load().
Referenced by foedus::storage::MetadataSerializer::load_all_storages_from_xml().
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const PageVersionStatus & | v | ||
) |
Definition at line 33 of file page.cpp.
References foedus::storage::PageVersionStatus::get_version_counter(), foedus::storage::PageVersionStatus::is_moved(), and foedus::storage::PageVersionStatus::is_retired().
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const Composer & | v | ||
) |
Definition at line 39 of file composer.cpp.
References foedus::storage::Composer::get_storage_id(), foedus::storage::Composer::get_storage_type(), and to_storage_type_name().
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const VolatilePagePointer & | v | ||
) |
Definition at line 40 of file storage_id.cpp.
References describe_volatile_pointer().
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const PageVersion & | v | ||
) |
Definition at line 42 of file page.cpp.
References foedus::storage::PageVersion::is_locked(), foedus::storage::PageVersion::is_moved(), foedus::storage::PageVersion::is_retired(), and foedus::storage::PageVersion::status_.
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const Composer::DropResult & | v | ||
) |
Definition at line 46 of file composer.cpp.
References foedus::storage::Composer::DropResult::dropped_all_, and foedus::storage::Composer::DropResult::max_observed_.
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const PageHeader & | v | ||
) |
Definition at line 52 of file page.cpp.
References foedus::storage::PageHeader::checksum_, describe_snapshot_pointer(), describe_volatile_pointer(), foedus::storage::PageHeader::hotness_, foedus::storage::PageHeader::key_count_, foedus::storage::PageHeader::masstree_in_layer_level_, foedus::storage::PageHeader::masstree_layer_, foedus::storage::PageHeader::page_id_, foedus::storage::PageHeader::page_type_, foedus::storage::PageHeader::page_version_, foedus::storage::PageHeader::snapshot_, foedus::storage::PageHeader::stat_last_updater_node_, foedus::storage::PageHeader::storage_id_, foedus::assorted::ProbCounter::value_, and foedus::storage::VolatilePagePointer::word.
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const DualPagePointer & | v | ||
) |
Definition at line 56 of file storage_id.cpp.
References describe_snapshot_pointer(), describe_volatile_pointer(), foedus::storage::DualPagePointer::snapshot_pointer_, and foedus::storage::DualPagePointer::volatile_pointer_.
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const DropLogType & | v | ||
) |
Definition at line 56 of file storage_log_types.cpp.
References foedus::log::BaseLogType::header_, and foedus::log::LogHeader::storage_id_.
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const CreateLogType & | v | ||
) |
Definition at line 75 of file storage_log_types.cpp.
References kArrayStorage, kHashStorage, kMasstreeStorage, kSequentialStorage, foedus::storage::CreateLogType::metadata_, and foedus::storage::Metadata::type_.
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const Partitioner & | v | ||
) |
Definition at line 140 of file partitioner.cpp.
References foedus::Attachable< CONTROL_BLOCK >::control_block_, and to_storage_type_name().
std::ostream& foedus::storage::operator<< | ( | std::ostream & | o, |
const PartitionerMetadata & | v | ||
) |
Definition at line 148 of file partitioner.cpp.
References foedus::storage::PartitionerMetadata::data_offset_, foedus::storage::PartitionerMetadata::data_size_, and foedus::storage::PartitionerMetadata::valid_.
ErrorStack foedus::storage::save_to_xml_array | ( | tinyxml2::XMLElement * | parent, |
Metadata * | data | ||
) |
Definition at line 106 of file metadata.cpp.
References foedus::externalize::Externalizable::add_child_element().
Referenced by foedus::storage::MetadataSerializer::save_all_storages_to_xml().
ErrorStack foedus::storage::save_to_xml_hash | ( | tinyxml2::XMLElement * | parent, |
Metadata * | data | ||
) |
Definition at line 110 of file metadata.cpp.
References foedus::externalize::Externalizable::add_child_element().
Referenced by foedus::storage::MetadataSerializer::save_all_storages_to_xml().
ErrorStack foedus::storage::save_to_xml_masstree | ( | tinyxml2::XMLElement * | parent, |
Metadata * | data | ||
) |
Definition at line 114 of file metadata.cpp.
References foedus::externalize::Externalizable::add_child_element().
Referenced by foedus::storage::MetadataSerializer::save_all_storages_to_xml().
ErrorStack foedus::storage::save_to_xml_sequential | ( | tinyxml2::XMLElement * | parent, |
Metadata * | data | ||
) |
Definition at line 119 of file metadata.cpp.
References foedus::externalize::Externalizable::add_child_element().
Referenced by foedus::storage::MetadataSerializer::save_all_storages_to_xml().
|
inline |
Definition at line 106 of file storage_id.hpp.
References assert_valid_snapshot_local_page_id().
Referenced by foedus::snapshot::SnapshotWriter::open().
const char* foedus::storage::kChildTagName = "storage" |
Definition at line 104 of file metadata.cpp.
const StorageName foedus::storage::kEmptyString |
Definition at line 59 of file storage_manager.cpp.
Referenced by foedus::storage::StorageManager::get_name().
const uint8_t foedus::storage::kVolatilePointerFlagSwappable = 0x02 |
Definition at line 176 of file storage_id.hpp.