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 AUTO_FLUSH_INTERVAL_KEY: &str = "auto_flush_interval";
28pub const SNAPSHOT_READ: &str = "snapshot_read";
30pub const COMPACTION_TYPE: &str = "compaction.type";
32pub const COMPACTION_OVERRIDE: &str = "compaction.override";
34pub const COMPACTION_TYPE_TWCS: &str = "twcs";
36pub const TWCS_TRIGGER_FILE_NUM: &str = "compaction.twcs.trigger_file_num";
38pub const TWCS_MAX_OUTPUT_FILE_SIZE: &str = "compaction.twcs.max_output_file_size";
40pub const TWCS_TIME_WINDOW: &str = "compaction.twcs.time_window";
42pub const TWCS_REMOTE_COMPACTION: &str = "compaction.twcs.remote_compaction";
44pub const TWCS_FALLBACK_TO_LOCAL: &str = "compaction.twcs.fallback_to_local";
46pub const MEMTABLE_TYPE: &str = "memtable.type";
48pub const MEMTABLE_BULK_MERGE_THRESHOLD: &str = "memtable.bulk.merge_threshold";
50pub const MEMTABLE_BULK_ENCODE_ROW_THRESHOLD: &str = "memtable.bulk.encode_row_threshold";
52pub const MEMTABLE_BULK_ENCODE_BYTES_THRESHOLD: &str = "memtable.bulk.encode_bytes_threshold";
54pub const MEMTABLE_BULK_MAX_MERGE_GROUPS: &str = "memtable.bulk.max_merge_groups";
56pub const MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD: &str =
58 "memtable.partition_tree.index_max_keys_per_shard";
59pub const MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD: &str =
61 "memtable.partition_tree.data_freeze_threshold";
62pub const MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES: &str =
64 "memtable.partition_tree.fork_dictionary_bytes";
65pub const SKIP_WAL_KEY: &str = "skip_wal";
67pub const SST_FORMAT_KEY: &str = "sst_format";
69pub fn is_mito_engine_option_key(key: &str) -> bool {
73 [
74 "ttl",
75 AUTO_FLUSH_INTERVAL_KEY,
76 COMPACTION_TYPE,
77 COMPACTION_OVERRIDE,
78 TWCS_TRIGGER_FILE_NUM,
79 TWCS_MAX_OUTPUT_FILE_SIZE,
80 TWCS_TIME_WINDOW,
81 TWCS_REMOTE_COMPACTION,
82 TWCS_FALLBACK_TO_LOCAL,
83 "storage",
84 "index.inverted_index.ignore_column_ids",
85 "index.inverted_index.segment_row_count",
86 WAL_OPTIONS_KEY,
87 MEMTABLE_TYPE,
88 MEMTABLE_BULK_MERGE_THRESHOLD,
89 MEMTABLE_BULK_ENCODE_ROW_THRESHOLD,
90 MEMTABLE_BULK_ENCODE_BYTES_THRESHOLD,
91 MEMTABLE_BULK_MAX_MERGE_GROUPS,
92 MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD,
93 MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD,
94 MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES,
95 APPEND_MODE_KEY,
97 MERGE_MODE_KEY,
98 SST_FORMAT_KEY,
99 ]
100 .contains(&key)
101}
102
103#[cfg(test)]
104mod tests {
105 use super::*;
106
107 #[test]
108 fn test_is_mito_engine_option_key() {
109 assert!(is_mito_engine_option_key("ttl"));
110 assert!(is_mito_engine_option_key("auto_flush_interval"));
111 assert!(is_mito_engine_option_key("compaction.type"));
112 assert!(is_mito_engine_option_key("compaction.override"));
113 assert!(is_mito_engine_option_key(
114 "compaction.twcs.trigger_file_num"
115 ));
116 assert!(is_mito_engine_option_key("compaction.twcs.time_window"));
117 assert!(is_mito_engine_option_key("storage"));
118 assert!(is_mito_engine_option_key(
119 "index.inverted_index.ignore_column_ids"
120 ));
121 assert!(is_mito_engine_option_key(
122 "index.inverted_index.segment_row_count"
123 ));
124 assert!(is_mito_engine_option_key("wal_options"));
125 assert!(is_mito_engine_option_key("memtable.type"));
126 assert!(is_mito_engine_option_key("memtable.bulk.merge_threshold"));
127 assert!(is_mito_engine_option_key(
128 "memtable.bulk.encode_row_threshold"
129 ));
130 assert!(is_mito_engine_option_key(
131 "memtable.bulk.encode_bytes_threshold"
132 ));
133 assert!(is_mito_engine_option_key("memtable.bulk.max_merge_groups"));
134 assert!(is_mito_engine_option_key(
135 "memtable.partition_tree.index_max_keys_per_shard"
136 ));
137 assert!(is_mito_engine_option_key(
138 "memtable.partition_tree.data_freeze_threshold"
139 ));
140 assert!(is_mito_engine_option_key(
141 "memtable.partition_tree.fork_dictionary_bytes"
142 ));
143 assert!(is_mito_engine_option_key("append_mode"));
144 assert!(!is_mito_engine_option_key("foo"));
145 }
146}