Skip to content

Extend for unified memtable feature (v8.9.0+) #47

@guycipher

Description

@guycipher

New engine configuration and stats.

tidesdb_config_t

/**
 * tidesdb_config_t
 * configuration for the database
 * @param db_path path to the database
 * @param num_flush_threads number of flush threads
 * @param num_compaction_threads number of compaction threads
 * @param log_level minimum log level to display (TDB_LOG_DEBUG, TDB_LOG_INFO, TDB_LOG_WARN,
 * TDB_LOG_ERROR, TDB_LOG_FATAL, TDB_LOG_NONE)
 * @param block_cache_size size of clock cache for hot sstable blocks
 * @param max_open_sstables maximum number of open sstables
 * @param log_to_file flag to determine if debug logging should be written to a file
 * @param log_truncation_at size in bytes at which to truncate the log file, 0 = no truncation
 * @param max_memory_usage maximum memory usage for the database
 * @param unified_memtable flag to determine if unified memtable should be used
 * @param unified_memtable_write_buffer_size write buffer size for unified memtable (0 = auto)
 * @param unified_memtable_skip_list_max_level skip list max level for unified memtable (0 = default
 * 12)
 * @param unified_memtable_skip_list_probability skip list probability (0 = default 0.25)
 * @param unified_memtable_sync_mode sync mode for unified WAL (default TDB_SYNC_NONE)
 * @param unified_memtable_sync_interval_us sync interval for unified WAL (0 = default)
 */
typedef struct tidesdb_config_t
{
    char *db_path;
    int num_flush_threads;
    int num_compaction_threads;
    tidesdb_log_level_t log_level;
    size_t block_cache_size;
    size_t max_open_sstables;
    int log_to_file;
    size_t log_truncation_at;
    size_t max_memory_usage;
    int unified_memtable;
    size_t unified_memtable_write_buffer_size;
    int unified_memtable_skip_list_max_level;
    float unified_memtable_skip_list_probability;
    int unified_memtable_sync_mode;
    uint64_t unified_memtable_sync_interval_us;
} tidesdb_config_t;

tidesdb_db_stats_t

/**
 * tidesdb_db_stats_t
 * database-level statistics
 * @param num_column_families number of column families
 * @param total_memory system total memory
 * @param available_memory system available memory at open
 * @param resolved_memory_limit resolved memory limit
 * @param memory_pressure_level current memory pressure level (0=normal, 1=elevated, 2=high,
 * 3=critical)
 * @param flush_pending_count number of pending flush operations (queued + in-flight)
 * @param total_memtable_bytes total bytes in active memtables across all CFs
 * @param total_immutable_count total immutable memtables across all CFs
 * @param total_sstable_count total sstables across all CFs and levels
 * @param total_data_size_bytes total data size across all CFs
 * @param num_open_sstables number of currently open sstable file handles
 * @param global_seq current global sequence number
 * @param txn_memory_bytes bytes held by in-flight transactions
 * @param compaction_queue_size number of pending compaction tasks
 * @param flush_queue_size number of pending flush tasks in queue
 * @param unified_memtable_enabled whether unified memtable mode is active
 * @param unified_memtable_bytes bytes in unified active memtable
 * @param unified_immutable_count number of unified immutable memtables
 * @param unified_is_flushing whether unified memtable is currently flushing/rotating
 * @param unified_next_cf_index next CF index to be assigned in unified mode
 * @param unified_wal_generation current unified WAL generation counter
 */
typedef struct tidesdb_db_stats_t
{
    int num_column_families;
    uint64_t total_memory;
    uint64_t available_memory;
    size_t resolved_memory_limit;
    int memory_pressure_level;
    int flush_pending_count;
    int64_t total_memtable_bytes;
    int total_immutable_count;
    int total_sstable_count;
    uint64_t total_data_size_bytes;
    int num_open_sstables;
    uint64_t global_seq;
    int64_t txn_memory_bytes;
    size_t compaction_queue_size;
    size_t flush_queue_size;
    int unified_memtable_enabled;
    int64_t unified_memtable_bytes;
    int unified_immutable_count;
    int unified_is_flushing;
    uint32_t unified_next_cf_index;
    uint64_t unified_wal_generation;
} tidesdb_db_stats_t;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions