Database geometry for size management. More...
#include <mdbx.h++>
Classes | |
struct | size |
Tagged type for output to std::ostream. More... | |
Public Types | |
enum | : int64_t { default_value = -1, minimal_value = 0, maximal_value = INTPTR_MAX, kB = 1000, MB = kB * 1000, GB = MB * 1000, TB = GB * 1000, PB = TB * 1000, EB = PB * 1000, KiB = 1024, MiB = KiB << 10, GiB = MiB << 10, TiB = GiB << 10, PiB = TiB << 10, EiB = PiB << 10 } |
Public Member Functions | |
geometry & | make_fixed (intptr_t size) noexcept |
geometry & | make_dynamic (intptr_t lower=minimal_value, intptr_t upper=maximal_value) noexcept |
MDBX_CXX11_CONSTEXPR | geometry () noexcept |
MDBX_CXX11_CONSTEXPR | geometry (const geometry &) noexcept=default |
MDBX_CXX11_CONSTEXPR | geometry (intptr_t size_lower, intptr_t size_now=default_value, intptr_t size_upper=maximal_value, intptr_t growth_step=default_value, intptr_t shrink_threshold=default_value, intptr_t pagesize=default_value) noexcept |
Public Attributes | |
intptr_t | size_lower {minimal_value} |
The lower bound of database size in bytes. More... | |
intptr_t | size_now {default_value} |
The size in bytes to setup the database size for now. More... | |
intptr_t | size_upper {maximal_value} |
The upper bound of database size in bytes. More... | |
intptr_t | growth_step {default_value} |
The growth step in bytes, must be greater than zero to allow the database to grow. More... | |
intptr_t | shrink_threshold {default_value} |
The shrink threshold in bytes, must be greater than zero to allow the database to shrink. More... | |
intptr_t | pagesize {default_value} |
The database page size for new database creation or default_value otherwise. More... | |
Database geometry for size management.
anonymous enum : int64_t |
|
inlinenoexcept |
|
defaultnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
intptr_t mdbx::env::geometry::growth_step {default_value} |
The growth step in bytes, must be greater than zero to allow the database to grow.
intptr_t mdbx::env::geometry::pagesize {default_value} |
The database page size for new database creation or default_value otherwise.
Must be power of 2 in the range between MDBX_MIN_PAGESIZE and MDBX_MAX_PAGESIZE.
intptr_t mdbx::env::geometry::shrink_threshold {default_value} |
The shrink threshold in bytes, must be greater than zero to allow the database to shrink.
intptr_t mdbx::env::geometry::size_lower {minimal_value} |
The lower bound of database size in bytes.
intptr_t mdbx::env::geometry::size_now {default_value} |
The size in bytes to setup the database size for now.
It is recommended always pass default_value in this argument except some special cases.
intptr_t mdbx::env::geometry::size_upper {maximal_value} |
The upper bound of database size in bytes.
It is recommended to avoid change upper bound while database is used by other processes or threaded (i.e. just pass default_value in this argument except absolutely necessary). Otherwise you must be ready for MDBX_UNABLE_EXTEND_MAPSIZE error(s), unexpected pauses during remapping and/or system errors like "address busy", and so on. In other words, there is no way to handle a growth of the upper bound robustly because there may be a lack of appropriate system resources (which are extremely volatile in a multi-process multi-threaded environment).