store_api/
mito_engine_options.rs1use common_wal::options::WAL_OPTIONS_KEY;
19
20pub const APPEND_MODE_KEY: &str = "append_mode";
22pub const MERGE_MODE_KEY: &str = "merge_mode";
24pub const TTL_KEY: &str = "ttl";
26pub const SNAPSHOT_READ: &str = "snapshot_read";
28pub const COMPACTION_TYPE: &str = "compaction.type";
30pub const COMPACTION_TYPE_TWCS: &str = "twcs";
32pub const TWCS_TRIGGER_FILE_NUM: &str = "compaction.twcs.trigger_file_num";
34pub const TWCS_MAX_OUTPUT_FILE_SIZE: &str = "compaction.twcs.max_output_file_size";
36pub const TWCS_TIME_WINDOW: &str = "compaction.twcs.time_window";
38pub const REMOTE_COMPACTION: &str = "compaction.twcs.remote_compaction";
40pub const TWCS_FALLBACK_TO_LOCAL: &str = "compaction.twcs.fallback_to_local";
42pub const MEMTABLE_TYPE: &str = "memtable.type";
44pub const MEMTABLE_PARTITION_TREE_PRIMARY_KEY_ENCODING: &str =
46 "memtable.partition_tree.primary_key_encoding";
47pub const MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD: &str =
49 "memtable.partition_tree.index_max_keys_per_shard";
50pub const MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD: &str =
52 "memtable.partition_tree.data_freeze_threshold";
53pub const MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES: &str =
55 "memtable.partition_tree.fork_dictionary_bytes";
56pub const SKIP_WAL_KEY: &str = "skip_wal";
58pub fn is_mito_engine_option_key(key: &str) -> bool {
62 [
63 "ttl",
64 COMPACTION_TYPE,
65 TWCS_TRIGGER_FILE_NUM,
66 TWCS_MAX_OUTPUT_FILE_SIZE,
67 TWCS_TIME_WINDOW,
68 REMOTE_COMPACTION,
69 TWCS_FALLBACK_TO_LOCAL,
70 "storage",
71 "index.inverted_index.ignore_column_ids",
72 "index.inverted_index.segment_row_count",
73 WAL_OPTIONS_KEY,
74 MEMTABLE_TYPE,
75 MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD,
76 MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD,
77 MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES,
78 MEMTABLE_PARTITION_TREE_PRIMARY_KEY_ENCODING,
79 APPEND_MODE_KEY,
80 MERGE_MODE_KEY,
81 ]
82 .contains(&key)
83}
84
85#[cfg(test)]
86mod tests {
87 use super::*;
88
89 #[test]
90 fn test_is_mito_engine_option_key() {
91 assert!(is_mito_engine_option_key("ttl"));
92 assert!(is_mito_engine_option_key("compaction.type"));
93 assert!(is_mito_engine_option_key(
94 "compaction.twcs.trigger_file_num"
95 ));
96 assert!(is_mito_engine_option_key("compaction.twcs.time_window"));
97 assert!(is_mito_engine_option_key("storage"));
98 assert!(is_mito_engine_option_key(
99 "index.inverted_index.ignore_column_ids"
100 ));
101 assert!(is_mito_engine_option_key(
102 "index.inverted_index.segment_row_count"
103 ));
104 assert!(is_mito_engine_option_key("wal_options"));
105 assert!(is_mito_engine_option_key("memtable.type"));
106 assert!(is_mito_engine_option_key(
107 "memtable.partition_tree.index_max_keys_per_shard"
108 ));
109 assert!(is_mito_engine_option_key(
110 "memtable.partition_tree.data_freeze_threshold"
111 ));
112 assert!(is_mito_engine_option_key(
113 "memtable.partition_tree.fork_dictionary_bytes"
114 ));
115 assert!(is_mito_engine_option_key("append_mode"));
116 assert!(!is_mito_engine_option_key("foo"));
117 }
118}