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_MAX_ACTIVE_WINDOW_RUNS: &str = "compaction.twcs.max_active_window_runs";
34pub const TWCS_MAX_ACTIVE_WINDOW_FILES: &str = "compaction.twcs.max_active_window_files";
36pub const TWCS_MAX_INACTIVE_WINDOW_RUNS: &str = "compaction.twcs.max_inactive_window_runs";
38pub const TWCS_MAX_INACTIVE_WINDOW_FILES: &str = "compaction.twcs.max_inactive_window_files";
40pub const TWCS_MAX_OUTPUT_FILE_SIZE: &str = "compaction.twcs.max_output_file_size";
42pub const TWCS_TIME_WINDOW: &str = "compaction.twcs.time_window";
44pub const REMOTE_COMPACTION: &str = "compaction.twcs.remote_compaction";
46pub const TWCS_FALLBACK_TO_LOCAL: &str = "compaction.twcs.fallback_to_local";
48pub const MEMTABLE_TYPE: &str = "memtable.type";
50pub const MEMTABLE_PARTITION_TREE_PRIMARY_KEY_ENCODING: &str =
52 "memtable.partition_tree.primary_key_encoding";
53pub const MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD: &str =
55 "memtable.partition_tree.index_max_keys_per_shard";
56pub const MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD: &str =
58 "memtable.partition_tree.data_freeze_threshold";
59pub const MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES: &str =
61 "memtable.partition_tree.fork_dictionary_bytes";
62pub const SKIP_WAL_KEY: &str = "skip_wal";
64pub fn is_mito_engine_option_key(key: &str) -> bool {
68 [
69 "ttl",
70 COMPACTION_TYPE,
71 TWCS_MAX_ACTIVE_WINDOW_RUNS,
72 TWCS_MAX_ACTIVE_WINDOW_FILES,
73 TWCS_MAX_INACTIVE_WINDOW_RUNS,
74 TWCS_MAX_INACTIVE_WINDOW_FILES,
75 TWCS_MAX_OUTPUT_FILE_SIZE,
76 TWCS_TIME_WINDOW,
77 REMOTE_COMPACTION,
78 TWCS_FALLBACK_TO_LOCAL,
79 "storage",
80 "index.inverted_index.ignore_column_ids",
81 "index.inverted_index.segment_row_count",
82 WAL_OPTIONS_KEY,
83 MEMTABLE_TYPE,
84 MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD,
85 MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD,
86 MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES,
87 MEMTABLE_PARTITION_TREE_PRIMARY_KEY_ENCODING,
88 APPEND_MODE_KEY,
89 MERGE_MODE_KEY,
90 ]
91 .contains(&key)
92}
93
94#[cfg(test)]
95mod tests {
96 use super::*;
97
98 #[test]
99 fn test_is_mito_engine_option_key() {
100 assert!(is_mito_engine_option_key("ttl"));
101 assert!(is_mito_engine_option_key("compaction.type"));
102 assert!(is_mito_engine_option_key(
103 "compaction.twcs.max_active_window_runs"
104 ));
105 assert!(is_mito_engine_option_key(
106 "compaction.twcs.max_inactive_window_runs"
107 ));
108 assert!(is_mito_engine_option_key("compaction.twcs.time_window"));
109 assert!(is_mito_engine_option_key("storage"));
110 assert!(is_mito_engine_option_key(
111 "index.inverted_index.ignore_column_ids"
112 ));
113 assert!(is_mito_engine_option_key(
114 "index.inverted_index.segment_row_count"
115 ));
116 assert!(is_mito_engine_option_key("wal_options"));
117 assert!(is_mito_engine_option_key("memtable.type"));
118 assert!(is_mito_engine_option_key(
119 "memtable.partition_tree.index_max_keys_per_shard"
120 ));
121 assert!(is_mito_engine_option_key(
122 "memtable.partition_tree.data_freeze_threshold"
123 ));
124 assert!(is_mito_engine_option_key(
125 "memtable.partition_tree.fork_dictionary_bytes"
126 ));
127 assert!(is_mito_engine_option_key("append_mode"));
128 assert!(!is_mito_engine_option_key("foo"));
129 }
130}