Blink DB Documentation v1.0.0
Blink DB Documentation
Loading...
Searching...
No Matches
constants.hpp File Reference

Constants for the database engine. More...

#include <string>

Go to the source code of this file.

Macros

#define TOMBSTONE   "\xFF\xFF\xFF\xFF"
 TOMOBSTONE constant.

Variables

const std::string INDEX_EXTENSION = ".index"
 Index Extenstion Constant.
const std::string DATA_EXTENSION = ".data"
 Data Extension Constant.
const std::string DATA_DIR = "data/"
 Data Directory Constant.
const size_t MAX_MEMTABLE_SIZE = 32 * 1024 * 1024
 Constants for memory limit in bytes. (Default: 32MB).
const size_t MAX_SSTABLE_COUNT = 100
 Constants for the maximum number of sstables.

Detailed Description

Constants for the database engine.

This file contains various constants used throughout the database engine, including file extensions, directory names, and memory limits.

Author
Sai Kasyap Jannabhatla
Date
March 2025
Version
1.0

Macro Definition Documentation

◆ TOMBSTONE

#define TOMBSTONE   "\xFF\xFF\xFF\xFF"

TOMOBSTONE constant.

This constant is used to represent a deleted key in the database. It is a special value that indicates the key has been marked for deletion. The value is set to 0xFFFFFFFF, which is a common representation for a deleted or invalid value in many systems.

Variable Documentation

◆ DATA_DIR

const std::string DATA_DIR = "data/"

Data Directory Constant.

This constant is used to define the directory where sstable files are stored

◆ DATA_EXTENSION

const std::string DATA_EXTENSION = ".data"

Data Extension Constant.

This constant is used to define the file extension for data files in the database. It is set to ".data", this data file is used to store the actual key-value pairs

◆ INDEX_EXTENSION

const std::string INDEX_EXTENSION = ".index"

Index Extenstion Constant.

This constant is used to define the file extension for index files in the database. It is set to ".index", this index file is used to store sparse indexes of keys

◆ MAX_MEMTABLE_SIZE

const size_t MAX_MEMTABLE_SIZE = 32 * 1024 * 1024

Constants for memory limit in bytes. (Default: 32MB).

If the memtable size exceeds this limit, the memtable will be flushed to disk.

◆ MAX_SSTABLE_COUNT

const size_t MAX_SSTABLE_COUNT = 100

Constants for the maximum number of sstables.

This constant is used as threshold for sstable count after which compaction is triggered. The default value is set to 100, which means that if the number of sstable files exceeds this limit, a compaction process will be initiated to merge and reduce the number of sstable files.