Skip to content

Struct mdbx::env::geometry

ClassList > mdbx > env > geometry

Database geometry for size management. More...

  • #include <mdbx.h++>

Classes

Type Name
struct size
Tagged type for output to std::ostream.

Public Types

Type Name
enum intptr_t @317147253300220220220205341340146351034075061101

Public Attributes

Type Name
intptr_t growth_step = {default\_value}
The growth step in bytes, must be greater than zero to allow the database to grow.
intptr_t pagesize = {default\_value}
The database page size for new database creation or default_value otherwise.
intptr_t shrink_threshold = {default\_value}
The shrink threshold in bytes, must be greater than zero to allow the database to shrink.
intptr_t size_lower = {default\_value}
The lower bound of database size in bytes.
intptr_t size_now = {default\_value}
The size in bytes to setup the database size for now.
intptr_t size_upper = {default\_value}
The upper bound of database size in bytes.

Public Functions

Type Name
constexpr geometry () noexcept
constexpr geometry (const geometry &) noexcept
constexpr geometry (intptr_t size_lower, intptr_t size_now=default_value, intptr_t size_upper=default_value, intptr_t growth_step=default_value, intptr_t shrink_threshold=default_value, intptr_t pagesize=default_value) noexcept
bool operator!= (const geometry & other) noexcept const
geometry & operator= (const geometry &) noexcept
bool operator== (const geometry & other) noexcept const

Public Static Functions

Type Name
geometry dynamic (intptr_t lower=default_value, intptr_t upper=default_value) noexcept
Creates a dynamic-size geometry with the given bounds.
geometry fixed (intptr_t size) noexcept
Creates a fixed-size geometry, i.e. with disabled growing and shrinking.

Detailed Description

See also: env_managed::create_parameters

See also: env_managed::env_managed(const ::std::string &pathname, const create_parameters &, const operate_parameters &, bool accede)

Public Types Documentation

enum @317147253300220220220205341340146351034075061101

enum mdbx::env::geometry::@317147253300220220220205341340146351034075061101 {
    default_value = -1,
    minimal_value = 0,
    maximal_value = INTPTR_MAX,
    kB = 1000,
    MB = kB * 1000,
    GB = MB * 1000,
    KiB = 1024,
    MiB = KiB << 10,
    GiB = MiB << 10
};

Public Attributes Documentation

variable growth_step

The growth step in bytes, must be greater than zero to allow the database to grow.

intptr_t mdbx::env::geometry::growth_step;

variable pagesize

The database page size for new database creation or default_value otherwise.

intptr_t mdbx::env::geometry::pagesize;

Must be power of 2 in the range between MDBX_MIN_PAGESIZE and MDBX_MAX_PAGESIZE.


variable shrink_threshold

The shrink threshold in bytes, must be greater than zero to allow the database to shrink.

intptr_t mdbx::env::geometry::shrink_threshold;

variable size_lower

The lower bound of database size in bytes.

intptr_t mdbx::env::geometry::size_lower;

variable size_now

The size in bytes to setup the database size for now.

intptr_t mdbx::env::geometry::size_now;

It is recommended always pass default_value in this argument except some special cases.


variable size_upper

The upper bound of database size in bytes.

intptr_t mdbx::env::geometry::size_upper;

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).


Public Functions Documentation

function geometry [1/3]

inline constexpr mdbx::env::geometry::geometry () noexcept

function geometry [2/3]

constexpr mdbx::env::geometry::geometry (
    const geometry &
) noexcept

function geometry [3/3]

inline constexpr mdbx::env::geometry::geometry (
    intptr_t size_lower,
    intptr_t size_now=default_value,
    intptr_t size_upper=default_value,
    intptr_t growth_step=default_value,
    intptr_t shrink_threshold=default_value,
    intptr_t pagesize=default_value
) noexcept

function operator!=

inline bool mdbx::env::geometry::operator!= (
    const geometry & other
) noexcept const

function operator=

geometry & mdbx::env::geometry::operator= (
    const geometry &
) noexcept

function operator==

inline bool mdbx::env::geometry::operator== (
    const geometry & other
) noexcept const

Public Static Functions Documentation

function dynamic

Creates a dynamic-size geometry with the given bounds.

static inline geometry mdbx::env::geometry::dynamic (
    intptr_t lower=default_value,
    intptr_t upper=default_value
) noexcept

function fixed

Creates a fixed-size geometry, i.e. with disabled growing and shrinking.

static inline geometry mdbx::env::geometry::fixed (
    intptr_t size
) noexcept


The documentation for this class was generated from the following file docs/mdbx.h++