libfoedus-core
FOEDUS Core Library
|
Set of options for storage manager. More...
Set of options for storage manager.
This is a POD struct. Default destructor/copy-constructor/assignment operator work fine.
Definition at line 29 of file storage_options.hpp.
#include <storage_options.hpp>
Public Types | |
enum | Constants { kDefaultMaxStorages = 1 << 9, kDefaultPartitionerDataMemoryMb = 1, kDefaultHotThreshold = 256 } |
Public Member Functions | |
StorageOptions () | |
Constructs option values with default values. More... | |
ErrorStack | load (tinyxml2::XMLElement *element) override |
Reads the content of this object from the given XML element. More... | |
ErrorStack | save (tinyxml2::XMLElement *element) const override |
Writes the content of this object to the given XML element. More... | |
const char * | get_tag_name () const override |
Returns an XML tag name for this object as a root element. More... | |
void | assign (const foedus::externalize::Externalizable *other) override |
Polymorphic assign operator. More... | |
![]() | |
ErrorStack | load_from_string (const std::string &xml) |
Load the content of this object from the given XML string. More... | |
void | save_to_stream (std::ostream *ptr) const |
Invokes save() and directs the resulting XML text to the given stream. More... | |
ErrorStack | load_from_file (const fs::Path &path) |
Load the content of this object from the specified XML file. More... | |
ErrorStack | save_to_file (const fs::Path &path) const |
Atomically and durably writes out this object to the specified XML file. More... | |
Public Attributes | |
uint32_t | max_storages_ |
Maximum number of storages in this database. More... | |
uint32_t | partitioner_data_memory_mb_ |
Size in MB of a shared memory buffer allocated for all partitioners during log gleaning. More... | |
uint64_t | hot_threshold_ |
Page hotness >= this value will be considered hot (hybrid CC only). More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const StorageOptions &v) |
Additional Inherited Members | |
![]() | |
static ErrorStack | insert_comment (tinyxml2::XMLElement *element, const std::string &comment) |
static ErrorStack | append_comment (tinyxml2::XMLElement *parent, const std::string &comment) |
static ErrorStack | create_element (tinyxml2::XMLElement *parent, const std::string &name, tinyxml2::XMLElement **out) |
template<typename T > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, T value) |
Only declaration in header. More... | |
template<uint MAXLEN, typename CHAR > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const assorted::FixedString< MAXLEN, CHAR > &value) |
template<typename T > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const std::vector< T > &value) |
vector version More... | |
template<typename ENUM > | |
static ErrorStack | add_enum_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, ENUM value) |
enum version More... | |
static ErrorStack | add_child_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const Externalizable &child) |
child Externalizable version More... | |
template<typename T > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, T *out, bool optional=false, T value=0) |
Only declaration in header. More... | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, std::string *out, bool optional=false, const char *value="") |
string type is bit special. More... | |
template<uint MAXLEN, typename CHAR > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, assorted::FixedString< MAXLEN, CHAR > *out, bool optional=false, const assorted::FixedString< MAXLEN, CHAR > &value=assorted::FixedString< MAXLEN, CHAR >()) |
template<typename ENUM > | |
static ErrorStack | get_enum_element (tinyxml2::XMLElement *parent, const std::string &tag, ENUM *out, bool optional=false, ENUM default_value=static_cast< ENUM >(0)) |
enum version More... | |
template<typename T > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, std::vector< T > *out, bool optional=false) |
vector version. More... | |
static ErrorStack | get_child_element (tinyxml2::XMLElement *parent, const std::string &tag, Externalizable *child, bool optional=false) |
child Externalizable version More... | |
Enumerator | |
---|---|
kDefaultMaxStorages | |
kDefaultPartitionerDataMemoryMb | |
kDefaultHotThreshold |
Definition at line 30 of file storage_options.hpp.
foedus::storage::StorageOptions::StorageOptions | ( | ) |
Constructs option values with default values.
Definition at line 21 of file storage_options.cpp.
References hot_threshold_, kDefaultHotThreshold, kDefaultMaxStorages, kDefaultPartitionerDataMemoryMb, max_storages_, and partitioner_data_memory_mb_.
|
inlineoverridevirtual |
Polymorphic assign operator.
This should invoke operator= of the derived class.
[in] | other | assigned value. It must be dynamic-castable to the assignee class. |
Implements foedus::externalize::Externalizable.
Definition at line 58 of file storage_options.hpp.
|
inlineoverridevirtual |
Returns an XML tag name for this object as a root element.
We might want to give a different name for same externalizable objects, so this is used only when it is the root element of xml.
Implements foedus::externalize::Externalizable.
Definition at line 58 of file storage_options.hpp.
|
overridevirtual |
Reads the content of this object from the given XML element.
[in] | element | the XML element that represents this object |
Expect errors due to missing-elements, out-of-range values, etc.
Implements foedus::externalize::Externalizable.
Definition at line 26 of file storage_options.cpp.
References EXTERNALIZE_LOAD_ELEMENT, hot_threshold_, foedus::kRetOk, max_storages_, and partitioner_data_memory_mb_.
|
overridevirtual |
Writes the content of this object to the given XML element.
[in] | element | the XML element that represents this object |
Expect only out-of-memory error. We receive the XML element this object will represent, so this method does not determine the XML element name of itself. The parent object determines children's tag names because one parent object might have multiple child objects of the same type with different XML element name.
Implements foedus::externalize::Externalizable.
Definition at line 32 of file storage_options.cpp.
References CHECK_ERROR, EXTERNALIZE_SAVE_ELEMENT, hot_threshold_, foedus::externalize::Externalizable::insert_comment(), foedus::kRetOk, max_storages_, and partitioner_data_memory_mb_.
|
friend |
Definition at line 58 of file storage_options.hpp.
uint64_t foedus::storage::StorageOptions::hot_threshold_ |
Page hotness >= this value will be considered hot (hybrid CC only).
Definition at line 56 of file storage_options.hpp.
Referenced by foedus::thread::ThreadPimpl::handle_tasks(), foedus::xct::Xct::initialize(), load(), save(), and StorageOptions().
uint32_t foedus::storage::StorageOptions::max_storages_ |
Maximum number of storages in this database.
Definition at line 43 of file storage_options.hpp.
Referenced by foedus::soc::SharedMemoryRepo::calculate_global_memory_size(), foedus::soc::SharedMemoryRepo::calculate_node_memory_size(), foedus::storage::StorageManagerPimpl::get_max_storages(), foedus::snapshot::SnapshotManagerPimpl::initialize_once(), load(), save(), StorageOptions(), and foedus::snapshot::SnapshotManagerPimpl::uninitialize_once().
uint32_t foedus::storage::StorageOptions::partitioner_data_memory_mb_ |
Size in MB of a shared memory buffer allocated for all partitioners during log gleaning.
Increase this value when you have a large number of storages that have large partitioning information (eg. long keys). So far, this must be less than 4GB.
Definition at line 51 of file storage_options.hpp.
Referenced by foedus::soc::SharedMemoryRepo::calculate_global_memory_size(), foedus::storage::hash::HashStoragePimpl::create(), foedus::snapshot::SnapshotManagerPimpl::initialize_once(), load(), foedus::storage::PartitionerMetadata::locate_data(), save(), and StorageOptions().