Lbug C++ API
Loading...
Searching...
No Matches
lbug::main::SystemConfig Struct Reference

Stores runtime configuration for creating or opening a Database. More...

#include <database.h>

Public Member Functions

 SystemConfig (uint64_t bufferPoolSize=-1u, uint64_t maxNumThreads=0, bool enableCompression=true, bool readOnly=false, uint64_t maxDBSize=-1u, bool autoCheckpoint=true, uint64_t checkpointThreshold=16777216, bool forceCheckpointOnClose=true, bool throwOnWalReplayFailure=true, bool enableChecksums=true)
 Creates a SystemConfig object.

Public Attributes

uint64_t bufferPoolSize
uint64_t maxNumThreads
bool enableCompression
bool readOnly
uint64_t maxDBSize
bool autoCheckpoint
uint64_t checkpointThreshold
bool forceCheckpointOnClose
bool throwOnWalReplayFailure
bool enableChecksums

Detailed Description

Stores runtime configuration for creating or opening a Database.

Constructor & Destructor Documentation

◆ SystemConfig()

lbug::main::SystemConfig::SystemConfig ( uint64_t bufferPoolSize = -1u,
uint64_t maxNumThreads = 0,
bool enableCompression = true,
bool readOnly = false,
uint64_t maxDBSize = -1u,
bool autoCheckpoint = true,
uint64_t checkpointThreshold = 16777216,
bool forceCheckpointOnClose = true,
bool throwOnWalReplayFailure = true,
bool enableChecksums = true )
explicit

Creates a SystemConfig object.

Parameters
bufferPoolSizeMax size of the buffer pool in bytes. The larger the buffer pool, the more data from the database files is kept in memory, reducing the amount of File I/O
maxNumThreadsThe maximum number of threads to use during query execution
enableCompressionWhether or not to compress data on-disk for supported types
readOnlyIf true, the database is opened read-only. No write transaction is allowed on the Database object. Multiple read-only Database objects can be created with the same database path. If false, the database is opened read-write. Under this mode, there must not be multiple Database objects created with the same database path.
maxDBSizeThe maximum size of the database in bytes. Note that this is introduced temporarily for now to get around with the default 8TB mmap address space limit some environment. This will be removed once we implemente a better solution later. The value is default to 1 << 43 (8TB) under 64-bit environment and 1GB under 32-bit one (see DEFAULT_VM_REGION_MAX_SIZE).
autoCheckpointIf true, the database will automatically checkpoint when the size of the WAL file exceeds the checkpoint threshold.
checkpointThresholdThe threshold of the WAL file size in bytes. When the size of the WAL file exceeds this threshold, the database will checkpoint if autoCheckpoint is true.
forceCheckpointOnCloseIf true, the database will force checkpoint when closing.
throwOnWalReplayFailureIf true, any WAL replaying failure when loading the database will throw an error. Otherwise, Lbug will silently ignore the failure and replay up to where the error occured.
enableChecksumsIf true, the database will use checksums to detect corruption in the WAL file.

Member Data Documentation

◆ autoCheckpoint

bool lbug::main::SystemConfig::autoCheckpoint

◆ bufferPoolSize

uint64_t lbug::main::SystemConfig::bufferPoolSize

◆ checkpointThreshold

uint64_t lbug::main::SystemConfig::checkpointThreshold

◆ enableChecksums

bool lbug::main::SystemConfig::enableChecksums

◆ enableCompression

bool lbug::main::SystemConfig::enableCompression

◆ forceCheckpointOnClose

bool lbug::main::SystemConfig::forceCheckpointOnClose

◆ maxDBSize

uint64_t lbug::main::SystemConfig::maxDBSize

◆ maxNumThreads

uint64_t lbug::main::SystemConfig::maxNumThreads

◆ readOnly

bool lbug::main::SystemConfig::readOnly

◆ throwOnWalReplayFailure

bool lbug::main::SystemConfig::throwOnWalReplayFailure

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