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. | |
Constants for the database engine.
This file contains various constants used throughout the database engine, including file extensions, directory names, and memory limits.
| #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.
| const std::string DATA_DIR = "data/" |
Data Directory Constant.
This constant is used to define the directory where sstable files are stored
| 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
| 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
| 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.
| 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.