Tkrzw
Public Member Functions | Public Attributes | List of all members
tkrzw::TreeDBM::TuningParameters Struct Reference

Tuning parameters for the database. More...

#include <tkrzw_dbm_tree.h>

Public Member Functions

 TuningParameters ()
 Constructor. More...
 
- Public Member Functions inherited from tkrzw::HashDBM::TuningParameters
 TuningParameters ()
 Constructor. More...
 

Public Attributes

int32_t max_page_size = -1
 The maximum size of a page. More...
 
int32_t max_branches = -1
 The maximum number of branches each inner node can have. More...
 
int32_t max_cached_pages = -1
 The maximum number of cached pages. More...
 
PageUpdateMode page_update_mode = PAGE_UPDATE_DEFAULT
 What to do when each page is updated. More...
 
KeyComparator key_comparator = nullptr
 The comparator of record keys. More...
 
- Public Attributes inherited from tkrzw::HashDBM::TuningParameters
UpdateMode update_mode = UPDATE_DEFAULT
 How to update the database file. More...
 
RecordCRCMode record_crc_mode = RECORD_CRC_DEFAULT
 How to add the CRC data to the record. More...
 
RecordCompressionMode record_comp_mode = RECORD_COMP_DEFAULT
 How to compress the value data of the record. More...
 
int32_t offset_width = -1
 The width to represent the offset of records. More...
 
int32_t align_pow = -1
 The power to align records. More...
 
int64_t num_buckets = -1
 The number of buckets for hashing. More...
 
int32_t restore_mode = RESTORE_DEFAULT
 How to restore the broken database file. More...
 
int32_t fbp_capacity = -1
 The capacity of the free block pool. More...
 
int32_t min_read_size = -1
 The minimum reading size to read a record. More...
 
int32_t cache_buckets = -1
 Whether to cache the hash buckets on memory. More...
 
std::string cipher_key = ""
 The encryption key for cipher compressors. More...
 

Detailed Description

Tuning parameters for the database.

Constructor & Destructor Documentation

◆ TuningParameters()

tkrzw::TreeDBM::TuningParameters::TuningParameters ( )

Constructor.

Member Data Documentation

◆ max_page_size

int32_t tkrzw::TreeDBM::TuningParameters::max_page_size = -1

The maximum size of a page.

If the size of a page exceeds this value, the page is divided into two. -1 means that the default value 4081 is set. -1 means that the default value 8130 is set.

◆ max_branches

int32_t tkrzw::TreeDBM::TuningParameters::max_branches = -1

The maximum number of branches each inner node can have.

The more the number of branches is, the less number of inner nodes occur. If the number is too large, updating performance deteriorates. -1 means that the default value 256 is set.

◆ max_cached_pages

int32_t tkrzw::TreeDBM::TuningParameters::max_cached_pages = -1

The maximum number of cached pages.

The more this value is, the better performance is whereas memory usage is increased. -1 means that the default value 10000 is set. As this parameter is not saved as a metadata of the database, it should be set each time when opening the database.

◆ page_update_mode

PageUpdateMode tkrzw::TreeDBM::TuningParameters::page_update_mode = PAGE_UPDATE_DEFAULT

What to do when each page is updated.

By default, updated cached pages are just kept on memory and the updates of each page are not written in the file until the page is cached out or the database is closed. PAGE_UPDATE_WRITE improves durability by ensuring that each update is written immediately.

◆ key_comparator

KeyComparator tkrzw::TreeDBM::TuningParameters::key_comparator = nullptr

The comparator of record keys.

Records are put in the ascending order of this function. If this is one of built-in comparators, the type is stored in the database. Otherwise, the custom comparator must be specified every time when the database is opened. nullptr means that the default comparator LexicalKeyComparator is set.