@@ -194,16 +194,16 @@ tidesdb_finalize();
194194```c
195195tidesdb_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
405405tidesdb_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
429429if (tidesdb_create_column_family(db, " my_cf" , &cf_config) != 0 )
@@ -2031,9 +2031,9 @@ tidesdb_config_t config = tidesdb_default_config();
20312031config.db_path = " ./mydb" ;
20322032config.unified_memtable = 1 ;
20332033config.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
20382038tidesdb_t *db = NULL ;
20392039if (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
21422142tidesdb_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
21532153tidesdb_objstore_config_t os_cfg = tidesdb_objstore_default_config();
0 commit comments