libmdbx  0.11.9.0 (2022-08-02T12:00:30+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
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  : 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

geometrymake_fixed (intptr_t size) noexcept
 
geometrymake_dynamic (intptr_t lower=minimal_value, intptr_t upper=maximal_value) noexcept
 
 geometry () noexcept
 
 geometry (const geometry &) noexcept=default
 
 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...
 

Detailed Description

Database geometry for size management.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : int64_t
Enumerator
default_value 

Means "keep current or use default".

minimal_value 

Means "minimal acceptable".

maximal_value 

Means "maximal acceptable".

kB 

\(10^{3}\) bytes

MB 

\(10^{6}\) bytes

GB 

\(10^{9}\) bytes

TB 

\(10^{12}\) bytes

PB 

\(10^{15}\) bytes

EB 

\(10^{18}\) bytes

KiB 

\(2^{10}\) bytes

MiB 

\(2^{20}\) bytes

GiB 

\(2^{30}\) bytes

TiB 

\(2^{40}\) bytes

PiB 

\(2^{50}\) bytes

EiB 

\(2^{60}\) bytes

Constructor & Destructor Documentation

◆ geometry() [1/3]

mdbx::env::geometry::geometry ( )
inlinenoexcept

◆ geometry() [2/3]

mdbx::env::geometry::geometry ( const geometry )
defaultnoexcept

◆ 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 
)
inlinenoexcept

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: