libmdbx 0.13.2.20 (2024-12-20T11:46:01+03:00)
One of the fastest compact embeddable key-value ACID storage engine without WAL.
 
Loading...
Searching...
No Matches
mdbx::env::geometry Struct Reference

Database geometry for size management. More...

#include <mdbx.h++>

Classes

struct  size
 Tagged type for output to std::ostream. More...
 

Public Types

enum  : intptr_t {
  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 Member Functions

geometrymake_fixed (intptr_t size) noexcept
 
geometrymake_dynamic (intptr_t lower=minimal_value, intptr_t upper=maximal_value) noexcept
 
constexpr geometry () noexcept
 
constexpr geometry (const geometry &) noexcept=default
 
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.
 
intptr_t size_now {default_value}
 The size in bytes to setup the database size for now.
 
intptr_t size_upper {maximal_value}
 The upper bound of database size in bytes.
 
intptr_t growth_step {default_value}
 The growth step in bytes, must be greater than zero to allow the database to grow.
 
intptr_t shrink_threshold {default_value}
 The shrink threshold in bytes, must be greater than zero to allow the database to shrink.
 
intptr_t pagesize {default_value}
 The database page size for new database creation or default_value otherwise.
 

Detailed Description

Database geometry for size management.

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : intptr_t
Enumerator
default_value 

Means "keep current or use default".

minimal_value 

Means "minimal acceptable".

maximal_value 

Means "maximal acceptable".

kB 

\(10^{3}\) bytes (0x03E8)

MB 

\(10^{6}\) bytes (0x000F_4240)

GB 

\(10^{9}\) bytes (0x3B9A_CA00)

KiB 

\(2^{10}\) bytes (0x0400)

MiB 

\(2^{20}\) bytes (0x0010_0000)

GiB 

\(2^{30}\) bytes (0x4000_0000)

Constructor & Destructor Documentation

◆ geometry() [1/3]

mdbx::env::geometry::geometry ( )
inlineconstexprnoexcept

◆ geometry() [2/3]

mdbx::env::geometry::geometry ( const geometry & )
constexprdefaultnoexcept

◆ geometry() [3/3]

mdbx::env::geometry::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 )
inlineconstexprnoexcept

Member Data Documentation

◆ growth_step

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.

◆ pagesize

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.

◆ shrink_threshold

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.

◆ size_lower

intptr_t mdbx::env::geometry::size_lower {minimal_value}

The lower bound of database size in bytes.

◆ size_now

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.

◆ size_upper

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


The documentation for this struct was generated from the following file: