store_api/
mito_engine_options.rsuse common_wal::options::WAL_OPTIONS_KEY;
pub const APPEND_MODE_KEY: &str = "append_mode";
pub const MERGE_MODE_KEY: &str = "merge_mode";
pub const TTL_KEY: &str = "ttl";
pub const COMPACTION_TYPE: &str = "compaction.type";
pub const COMPACTION_TYPE_TWCS: &str = "twcs";
pub const TWCS_MAX_ACTIVE_WINDOW_RUNS: &str = "compaction.twcs.max_active_window_runs";
pub const TWCS_MAX_ACTIVE_WINDOW_FILES: &str = "compaction.twcs.max_active_window_files";
pub const TWCS_MAX_INACTIVE_WINDOW_RUNS: &str = "compaction.twcs.max_inactive_window_runs";
pub const TWCS_MAX_INACTIVE_WINDOW_FILES: &str = "compaction.twcs.max_inactive_window_files";
pub const TWCS_MAX_OUTPUT_FILE_SIZE: &str = "compaction.twcs.max_output_file_size";
pub const TWCS_TIME_WINDOW: &str = "compaction.twcs.time_window";
pub const REMOTE_COMPACTION: &str = "compaction.twcs.remote_compaction";
pub const TWCS_FALLBACK_TO_LOCAL: &str = "compaction.twcs.fallback_to_local";
pub fn is_mito_engine_option_key(key: &str) -> bool {
[
"ttl",
COMPACTION_TYPE,
TWCS_MAX_ACTIVE_WINDOW_RUNS,
TWCS_MAX_ACTIVE_WINDOW_FILES,
TWCS_MAX_INACTIVE_WINDOW_RUNS,
TWCS_MAX_INACTIVE_WINDOW_FILES,
TWCS_MAX_OUTPUT_FILE_SIZE,
TWCS_TIME_WINDOW,
REMOTE_COMPACTION,
TWCS_FALLBACK_TO_LOCAL,
"storage",
"index.inverted_index.ignore_column_ids",
"index.inverted_index.segment_row_count",
WAL_OPTIONS_KEY,
"memtable.type",
"memtable.partition_tree.index_max_keys_per_shard",
"memtable.partition_tree.data_freeze_threshold",
"memtable.partition_tree.fork_dictionary_bytes",
APPEND_MODE_KEY,
MERGE_MODE_KEY,
]
.contains(&key)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_is_mito_engine_option_key() {
assert!(is_mito_engine_option_key("ttl"));
assert!(is_mito_engine_option_key("compaction.type"));
assert!(is_mito_engine_option_key(
"compaction.twcs.max_active_window_runs"
));
assert!(is_mito_engine_option_key(
"compaction.twcs.max_inactive_window_runs"
));
assert!(is_mito_engine_option_key("compaction.twcs.time_window"));
assert!(is_mito_engine_option_key("storage"));
assert!(is_mito_engine_option_key(
"index.inverted_index.ignore_column_ids"
));
assert!(is_mito_engine_option_key(
"index.inverted_index.segment_row_count"
));
assert!(is_mito_engine_option_key("wal_options"));
assert!(is_mito_engine_option_key("memtable.type"));
assert!(is_mito_engine_option_key(
"memtable.partition_tree.index_max_keys_per_shard"
));
assert!(is_mito_engine_option_key(
"memtable.partition_tree.data_freeze_threshold"
));
assert!(is_mito_engine_option_key(
"memtable.partition_tree.fork_dictionary_bytes"
));
assert!(is_mito_engine_option_key("append_mode"));
assert!(!is_mito_engine_option_key("foo"));
}
}