store_api/
mito_engine_options.rs1pub use common_wal::options::WAL_OPTIONS_KEY;
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 TWCS_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 const SST_FORMAT_KEY: &str = "sst_format";
60pub fn is_mito_engine_option_key(key: &str) -> bool {
64 [
65 "ttl",
66 COMPACTION_TYPE,
67 TWCS_TRIGGER_FILE_NUM,
68 TWCS_MAX_OUTPUT_FILE_SIZE,
69 TWCS_TIME_WINDOW,
70 TWCS_REMOTE_COMPACTION,
71 TWCS_FALLBACK_TO_LOCAL,
72 "storage",
73 "index.inverted_index.ignore_column_ids",
74 "index.inverted_index.segment_row_count",
75 WAL_OPTIONS_KEY,
76 MEMTABLE_TYPE,
77 MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD,
78 MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD,
79 MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES,
80 MEMTABLE_PARTITION_TREE_PRIMARY_KEY_ENCODING,
81 APPEND_MODE_KEY,
82 MERGE_MODE_KEY,
83 SST_FORMAT_KEY,
84 ]
85 .contains(&key)
86}
87
88#[cfg(test)]
89mod tests {
90 use super::*;
91
92 #[test]
93 fn test_is_mito_engine_option_key() {
94 assert!(is_mito_engine_option_key("ttl"));
95 assert!(is_mito_engine_option_key("compaction.type"));
96 assert!(is_mito_engine_option_key(
97 "compaction.twcs.trigger_file_num"
98 ));
99 assert!(is_mito_engine_option_key("compaction.twcs.time_window"));
100 assert!(is_mito_engine_option_key("storage"));
101 assert!(is_mito_engine_option_key(
102 "index.inverted_index.ignore_column_ids"
103 ));
104 assert!(is_mito_engine_option_key(
105 "index.inverted_index.segment_row_count"
106 ));
107 assert!(is_mito_engine_option_key("wal_options"));
108 assert!(is_mito_engine_option_key("memtable.type"));
109 assert!(is_mito_engine_option_key(
110 "memtable.partition_tree.index_max_keys_per_shard"
111 ));
112 assert!(is_mito_engine_option_key(
113 "memtable.partition_tree.data_freeze_threshold"
114 ));
115 assert!(is_mito_engine_option_key(
116 "memtable.partition_tree.fork_dictionary_bytes"
117 ));
118 assert!(is_mito_engine_option_key("append_mode"));
119 assert!(!is_mito_engine_option_key("foo"));
120 }
121}