Skip to content

Commit cdca925

Browse files
authored
Merge pull request #454 from tidesdb/clean-up-docs
clean up reference comments to align
2 parents 72caf78 + 023d785 commit cdca925

7 files changed

Lines changed: 130 additions & 130 deletions

File tree

src/content/docs/reference/c.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,16 @@ tidesdb_finalize();
194194
```c
195195
tidesdb_config_t config = {
196196
.db_path = "./mydb",
197-
.num_flush_threads = 2, /* Flush thread pool size (default: 2) */
198-
.num_compaction_threads = 2, /* Compaction thread pool size (default: 2) */
199-
.log_level = TDB_LOG_INFO, /* Log level: TDB_LOG_DEBUG, TDB_LOG_INFO, TDB_LOG_WARN, TDB_LOG_ERROR, TDB_LOG_FATAL, TDB_LOG_NONE */
200-
.block_cache_size = 64 * 1024 * 1024, /* 64MB global block cache (default: 64MB) */
201-
.max_open_sstables = 256, /* Max cached SSTable structures (default: 256) */
202-
.max_memory_usage = 0, /* Global memory limit in bytes (default: 0 = auto, 50% of system RAM; minimum: 5% of system RAM) */
203-
.log_to_file = 0, /* Write logs to file instead of stderr (default: 0) */
204-
.log_truncation_at = 24 * (1024*1024), /* Log file truncation size (default: 24MB), 0 = no truncation */
205-
.unified_memtable = 0, /* Enable unified memtable mode (default: 0 = per-CF memtables) */
206-
.unified_memtable_write_buffer_size = 0, /* Unified memtable write buffer size (default: 0 = use TDB_DEFAULT_WRITE_BUFFER_SIZE, 64MB) */
197+
.num_flush_threads = 2, /* Flush thread pool size (default: 2) */
198+
.num_compaction_threads = 2, /* Compaction thread pool size (default: 2) */
199+
.log_level = TDB_LOG_INFO, /* Log level: TDB_LOG_DEBUG, TDB_LOG_INFO, TDB_LOG_WARN, TDB_LOG_ERROR, TDB_LOG_FATAL, TDB_LOG_NONE */
200+
.block_cache_size = 64 * 1024 * 1024, /* 64MB global block cache (default: 64MB) */
201+
.max_open_sstables = 256, /* Max cached SSTable structures (default: 256) */
202+
.max_memory_usage = 0, /* Global memory limit in bytes (default: 0 = auto, 50% of system RAM; minimum: 5% of system RAM) */
203+
.log_to_file = 0, /* Write logs to file instead of stderr (default: 0) */
204+
.log_truncation_at = 24 * (1024*1024), /* Log file truncation size (default: 24MB), 0 = no truncation */
205+
.unified_memtable = 0, /* Enable unified memtable mode (default: 0 = per-CF memtables) */
206+
.unified_memtable_write_buffer_size = 0, /* Unified memtable write buffer size (default: 0 = use TDB_DEFAULT_WRITE_BUFFER_SIZE, 64MB) */
207207
.unified_memtable_skip_list_max_level = 0, /* Skip list max level for unified memtable (default: 0 = 12) */
208208
.unified_memtable_skip_list_probability = 0, /* Skip list probability for unified memtable (default: 0 = 0.25) */
209209
.unified_memtable_sync_mode = 0, /* Sync mode for unified WAL (default: 0 = TDB_SYNC_NONE) */
@@ -403,27 +403,27 @@ if (tidesdb_create_column_family(db, "my_cf", &cf_config) != 0)
403403
**Custom configuration example**
404404
```c
405405
tidesdb_column_family_config_t cf_config = {
406-
.write_buffer_size = 128 * 1024 * 1024, /* 128MB memtable flush threshold */
407-
.level_size_ratio = 10, /* Level size multiplier (default: 10) */
408-
.min_levels = 5, /* Minimum LSM levels (default: 5) */
409-
.dividing_level_offset = 2, /* Compaction dividing level offset (default: 2) */
410-
.skip_list_max_level = 12, /* Skip list max level */
411-
.skip_list_probability = 0.25f, /* Skip list probability */
412-
.compression_algorithm = TDB_COMPRESS_LZ4, /* TDB_COMPRESS_LZ4, TDB_COMPRESS_LZ4_FAST, TDB_COMPRESS_ZSTD, TDB_COMPRESS_SNAPPY, or TDB_COMPRESS_NONE */
413-
.enable_bloom_filter = 1, /* Enable bloom filters */
414-
.bloom_fpr = 0.01, /* 1% false positive rate */
415-
.enable_block_indexes = 1, /* Enable compact block indexes */
416-
.index_sample_ratio = 1, /* Sample every block for index (default: 1) */
417-
.block_index_prefix_len = 16, /* Block index prefix length (default: 16) */
418-
.sync_mode = TDB_SYNC_FULL, /* TDB_SYNC_NONE, TDB_SYNC_INTERVAL, or TDB_SYNC_FULL */
419-
.sync_interval_us = 1000000, /* Sync interval in microseconds (1 second, only for TDB_SYNC_INTERVAL) */
420-
.comparator_name = {0}, /* Empty = use default "memcmp" */
421-
.klog_value_threshold = 512, /* Values >= 512 bytes go to vlog (default: 512) */
422-
.min_disk_space = 100 * 1024 * 1024, /* Minimum disk space required (default: 100MB) */
406+
.write_buffer_size = 128 * 1024 * 1024, /* 128MB memtable flush threshold */
407+
.level_size_ratio = 10, /* Level size multiplier (default: 10) */
408+
.min_levels = 5, /* Minimum LSM levels (default: 5) */
409+
.dividing_level_offset = 2, /* Compaction dividing level offset (default: 2) */
410+
.skip_list_max_level = 12, /* Skip list max level */
411+
.skip_list_probability = 0.25f, /* Skip list probability */
412+
.compression_algorithm = TDB_COMPRESS_LZ4, /* TDB_COMPRESS_LZ4, TDB_COMPRESS_LZ4_FAST, TDB_COMPRESS_ZSTD, TDB_COMPRESS_SNAPPY, or TDB_COMPRESS_NONE */
413+
.enable_bloom_filter = 1, /* Enable bloom filters */
414+
.bloom_fpr = 0.01, /* 1% false positive rate */
415+
.enable_block_indexes = 1, /* Enable compact block indexes */
416+
.index_sample_ratio = 1, /* Sample every block for index (default: 1) */
417+
.block_index_prefix_len = 16, /* Block index prefix length (default: 16) */
418+
.sync_mode = TDB_SYNC_FULL, /* TDB_SYNC_NONE, TDB_SYNC_INTERVAL, or TDB_SYNC_FULL */
419+
.sync_interval_us = 1000000, /* Sync interval in microseconds (1 second, only for TDB_SYNC_INTERVAL) */
420+
.comparator_name = {0}, /* Empty = use default "memcmp" */
421+
.klog_value_threshold = 512, /* Values >= 512 bytes go to vlog (default: 512) */
422+
.min_disk_space = 100 * 1024 * 1024, /* Minimum disk space required (default: 100MB) */
423423
.default_isolation_level = TDB_ISOLATION_READ_COMMITTED, /* Default transaction isolation */
424-
.l1_file_count_trigger = 4, /* L1 file count trigger for compaction (default: 4) */
425-
.l0_queue_stall_threshold = 20, /* L0 queue stall threshold (default: 20) */
426-
.use_btree = 0 /* Use B+tree format for klog (default: 0 = block-based) */
424+
.l1_file_count_trigger = 4, /* L1 file count trigger for compaction (default: 4) */
425+
.l0_queue_stall_threshold = 20, /* L0 queue stall threshold (default: 20) */
426+
.use_btree = 0 /* Use B+tree format for klog (default: 0 = block-based) */
427427
};
428428

429429
if (tidesdb_create_column_family(db, "my_cf", &cf_config) != 0)
@@ -2031,9 +2031,9 @@ tidesdb_config_t config = tidesdb_default_config();
20312031
config.db_path = "./mydb";
20322032
config.unified_memtable = 1;
20332033
config.unified_memtable_write_buffer_size = 128 * 1024 * 1024; /* 128MB unified write buffer */
2034-
config.unified_memtable_skip_list_max_level = 16; /* Higher max level for larger datasets */
2035-
config.unified_memtable_skip_list_probability = 0.25f; /* Default probability */
2036-
config.unified_memtable_sync_mode = TDB_SYNC_FULL; /* Fsync on every WAL write */
2034+
config.unified_memtable_skip_list_max_level = 16; /* Higher max level for larger datasets */
2035+
config.unified_memtable_skip_list_probability = 0.25f; /* Default probability */
2036+
config.unified_memtable_sync_mode = TDB_SYNC_FULL; /* Fsync on every WAL write */
20372037

20382038
tidesdb_t *db = NULL;
20392039
if (tidesdb_open(&config, &db) != 0)
@@ -2140,14 +2140,14 @@ Build with `-DTIDESDB_WITH_S3=ON` to enable the S3 connector. This requires libc
21402140
#include <tidesdb/tidesdb.h>
21412141

21422142
tidesdb_objstore_t *s3 = tidesdb_objstore_s3_create(
2143-
"s3.amazonaws.com", /* endpoint */
2144-
"my-tidesdb-bucket", /* bucket */
2145-
"production/db1/", /* key prefix (or NULL) */
2146-
"AKIAIOSFODNN7EXAMPLE", /* access key */
2143+
"s3.amazonaws.com", /* endpoint */
2144+
"my-tidesdb-bucket", /* bucket */
2145+
"production/db1/", /* key prefix (or NULL) */
2146+
"AKIAIOSFODNN7EXAMPLE", /* access key */
21472147
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", /* secret key */
2148-
"us-east-1", /* region */
2149-
1, /* use_ssl (HTTPS) */
2150-
0 /* use_path_style (0 for AWS, 1 for MinIO) */
2148+
"us-east-1", /* region */
2149+
1, /* use_ssl (HTTPS) */
2150+
0 /* use_path_style (0 for AWS, 1 for MinIO) */
21512151
);
21522152

21532153
tidesdb_objstore_config_t os_cfg = tidesdb_objstore_default_config();

src/content/docs/reference/cplusplus.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ cmake --build build
4747
int main() {
4848
tidesdb::Config config;
4949
config.dbPath = "./mydb";
50-
config.numFlushThreads = 2; // Flush thread pool size (default: 2)
51-
config.numCompactionThreads = 2; // Compaction thread pool size (default: 2)
52-
config.logLevel = tidesdb::LogLevel::Info; // Log level (default: Info)
53-
config.blockCacheSize = 64 * 1024 * 1024; // 64MB global block cache (default: 64MB)
54-
config.maxOpenSSTables = 256; // Max cached SSTable structures (default: 256)
55-
config.maxMemoryUsage = 0; // Global memory limit in bytes (default: 0 = auto, 50% of system RAM)
56-
config.logToFile = false; // Write logs to file instead of stderr (default: false)
57-
config.logTruncationAt = 24 * 1024 * 1024; // Log file truncation size (default: 24MB), 0 = no truncation
58-
config.unifiedMemtable = false; // Enable unified memtable mode (default: false = per-CF memtables)
59-
config.unifiedMemtableWriteBufferSize = 0; // Unified memtable write buffer size (0 = auto)
60-
config.unifiedMemtableSkipListMaxLevel = 0; // Skip list max level for unified memtable (0 = default 12)
61-
config.unifiedMemtableSkipListProbability = 0; // Skip list probability (0 = default 0.25)
62-
config.unifiedMemtableSyncMode = tidesdb::SyncMode::None; // Sync mode for unified WAL
63-
config.unifiedMemtableSyncIntervalUs = 0; // Sync interval for unified WAL in microseconds
64-
config.objectStore = nullptr; // Pluggable object store connector (nullptr = local only)
65-
config.objectStoreConfig = std::nullopt; // Object store behavior config (nullopt = defaults)
50+
config.numFlushThreads = 2; // Flush thread pool size (default: 2)
51+
config.numCompactionThreads = 2; // Compaction thread pool size (default: 2)
52+
config.logLevel = tidesdb::LogLevel::Info; // Log level (default: Info)
53+
config.blockCacheSize = 64 * 1024 * 1024; // 64MB global block cache (default: 64MB)
54+
config.maxOpenSSTables = 256; // Max cached SSTable structures (default: 256)
55+
config.maxMemoryUsage = 0; // Global memory limit in bytes (default: 0 = auto, 50% of system RAM)
56+
config.logToFile = false; // Write logs to file instead of stderr (default: false)
57+
config.logTruncationAt = 24 * 1024 * 1024; // Log file truncation size (default: 24MB), 0 = no truncation
58+
config.unifiedMemtable = false; // Enable unified memtable mode (default: false = per-CF memtables)
59+
config.unifiedMemtableWriteBufferSize = 0; // Unified memtable write buffer size (0 = auto)
60+
config.unifiedMemtableSkipListMaxLevel = 0; // Skip list max level for unified memtable (0 = default 12)
61+
config.unifiedMemtableSkipListProbability = 0; // Skip list probability (0 = default 0.25)
62+
config.unifiedMemtableSyncMode = tidesdb::SyncMode::None; // Sync mode for unified WAL
63+
config.unifiedMemtableSyncIntervalUs = 0; // Sync interval for unified WAL in microseconds
64+
config.objectStore = nullptr; // Pluggable object store connector (nullptr = local only)
65+
config.objectStoreConfig = std::nullopt; // Object store behavior config (nullopt = defaults)
6666

6767
try {
6868
tidesdb::TidesDB db(config);
@@ -1032,14 +1032,14 @@ Build with `-DTIDESDB_WITH_S3=ON` to enable the S3 connector. This requires libc
10321032
#include <tidesdb/tidesdb.hpp>
10331033
10341034
tidesdb_objstore_t* s3 = tidesdb_objstore_s3_create(
1035-
"s3.amazonaws.com", // endpoint
1036-
"my-tidesdb-bucket", // bucket
1037-
"production/db1/", // key prefix (or nullptr)
1038-
"AKIAIOSFODNN7EXAMPLE", // access key
1035+
"s3.amazonaws.com", // endpoint
1036+
"my-tidesdb-bucket", // bucket
1037+
"production/db1/", // key prefix (or nullptr)
1038+
"AKIAIOSFODNN7EXAMPLE", // access key
10391039
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", // secret key
1040-
"us-east-1", // region
1041-
1, // use_ssl (HTTPS)
1042-
0 // use_path_style (0 for AWS, 1 for MinIO)
1040+
"us-east-1", // region
1041+
1, // use_ssl (HTTPS)
1042+
0 // use_path_style (0 for AWS, 1 for MinIO)
10431043
);
10441044
10451045
auto osCfg = tidesdb::ObjectStoreConfig::defaultConfig();
@@ -1597,9 +1597,9 @@ TidesDB uses separate thread pools for flush and compaction operations. Understa
15971597
```cpp
15981598
tidesdb::Config config;
15991599
config.dbPath = "./mydb";
1600-
config.numFlushThreads = 2; // Flush thread pool size (default: 2)
1601-
config.numCompactionThreads = 2; // Compaction thread pool size (default: 2)
1602-
config.blockCacheSize = 64 * 1024 * 1024; // 64MB global block cache (default: 64MB)
1600+
config.numFlushThreads = 2; // Flush thread pool size (default: 2)
1601+
config.numCompactionThreads = 2; // Compaction thread pool size (default: 2)
1602+
config.blockCacheSize = 64 * 1024 * 1024; // 64MB global block cache (default: 64MB)
16031603
config.maxOpenSSTables = 256; // LRU cache for SSTable objects (default: 256, each has 2 FDs)
16041604

16051605
tidesdb::TidesDB db(config);

src/content/docs/reference/go.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ func main() {
9797
LogLevel: tidesdb.LogInfo,
9898
BlockCacheSize: 64 * 1024 * 1024,
9999
MaxOpenSSTables: 256,
100-
MaxMemoryUsage: 0, // Global memory limit in bytes (0 = auto, 80% of system RAM)
101-
LogToFile: false, // Write logs to file instead of stderr
102-
LogTruncationAt: 24 * 1024 * 1024, // Log file truncation size (24MB default)
100+
MaxMemoryUsage: 0, // Global memory limit in bytes (0 = auto, 80% of system RAM)
101+
LogToFile: false, // Write logs to file instead of stderr
102+
LogTruncationAt: 24 * 1024 * 1024, // Log file truncation size (24MB default)
103103
ObjectStore: nil, // Object store connector (nil = local only)
104104
ObjectStoreConfig: nil, // Object store behavior config (nil = defaults)
105105
}
@@ -208,13 +208,13 @@ cfConfig.EnableBlockIndexes = true
208208
cfConfig.SyncMode = tidesdb.SyncInterval
209209
cfConfig.SyncIntervalUs = 128000
210210
cfConfig.DefaultIsolationLevel = tidesdb.IsolationReadCommitted
211-
cfConfig.DividingLevelOffset = 2 // Compaction dividing level offset
212-
cfConfig.KlogValueThreshold = 512 // Values > 512 bytes go to vlog
213-
cfConfig.BlockIndexPrefixLen = 16 // Block index prefix length
214-
cfConfig.MinDiskSpace = 100 * 1024 * 1024 // Minimum disk space required (100MB)
215-
cfConfig.L1FileCountTrigger = 4 // L1 file count trigger for compaction
216-
cfConfig.L0QueueStallThreshold = 20 // L0 queue stall threshold
217-
cfConfig.UseBtree = 0 // Use B+tree format for klog (0 = block-based)
211+
cfConfig.DividingLevelOffset = 2 // Compaction dividing level offset
212+
cfConfig.KlogValueThreshold = 512 // Values > 512 bytes go to vlog
213+
cfConfig.BlockIndexPrefixLen = 16 // Block index prefix length
214+
cfConfig.MinDiskSpace = 100 * 1024 * 1024 // Minimum disk space required (100MB)
215+
cfConfig.L1FileCountTrigger = 4 // L1 file count trigger for compaction
216+
cfConfig.L0QueueStallThreshold = 20 // L0 queue stall threshold
217+
cfConfig.UseBtree = 0 // Use B+tree format for klog (0 = block-based)
218218
cfConfig.ObjectLazyCompaction = 0 // Less aggressive compaction in object store mode
219219
cfConfig.ObjectPrefetchCompaction = 1 // Download all inputs before merge
220220

0 commit comments

Comments
 (0)