store_api/
mito_engine_options.rs1pub use common_wal::options::WAL_OPTIONS_KEY;
20pub const APPEND_MODE_KEY: &str = "append_mode";
22pub const WRITE_BUFFER_SIZE_KEY: &str = "write_buffer_size";
24pub const MERGE_MODE_KEY: &str = "merge_mode";
26pub const TTL_KEY: &str = "ttl";
28pub const AUTO_FLUSH_INTERVAL_KEY: &str = "auto_flush_interval";
30pub const SNAPSHOT_READ: &str = "snapshot_read";
32pub const COMPACTION_TYPE: &str = "compaction.type";
34pub const COMPACTION_OVERRIDE: &str = "compaction.override";
36pub const COMPACTION_TYPE_TWCS: &str = "twcs";
38pub const TWCS_TRIGGER_FILE_NUM: &str = "compaction.twcs.trigger_file_num";
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 TWCS_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_BULK_MERGE_THRESHOLD: &str = "memtable.bulk.merge_threshold";
52pub const MEMTABLE_BULK_ENCODE_ROW_THRESHOLD: &str = "memtable.bulk.encode_row_threshold";
54pub const MEMTABLE_BULK_ENCODE_BYTES_THRESHOLD: &str = "memtable.bulk.encode_bytes_threshold";
56pub const MEMTABLE_BULK_MAX_MERGE_GROUPS: &str = "memtable.bulk.max_merge_groups";
58pub const MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD: &str =
60 "memtable.partition_tree.index_max_keys_per_shard";
61pub const MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD: &str =
63 "memtable.partition_tree.data_freeze_threshold";
64pub const MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES: &str =
66 "memtable.partition_tree.fork_dictionary_bytes";
67pub const SKIP_WAL_KEY: &str = "skip_wal";
69pub const SST_FORMAT_KEY: &str = "sst_format";
71pub const MAX_ROW_GROUP_ROW_COUNT: &str = "max_row_group_row_count";
73pub const MAX_ROW_GROUP_ROW_COUNT_LIMIT: usize = 10 * 1024 * 1024;
75pub fn is_mito_engine_option_key(key: &str) -> bool {
79 [
80 "ttl",
81 WRITE_BUFFER_SIZE_KEY,
82 AUTO_FLUSH_INTERVAL_KEY,
83 COMPACTION_TYPE,
84 COMPACTION_OVERRIDE,
85 TWCS_TRIGGER_FILE_NUM,
86 TWCS_MAX_OUTPUT_FILE_SIZE,
87 TWCS_TIME_WINDOW,
88 TWCS_REMOTE_COMPACTION,
89 TWCS_FALLBACK_TO_LOCAL,
90 "storage",
91 "index.inverted_index.ignore_column_ids",
92 "index.inverted_index.segment_row_count",
93 WAL_OPTIONS_KEY,
94 MEMTABLE_TYPE,
95 MEMTABLE_BULK_MERGE_THRESHOLD,
96 MEMTABLE_BULK_ENCODE_ROW_THRESHOLD,
97 MEMTABLE_BULK_ENCODE_BYTES_THRESHOLD,
98 MEMTABLE_BULK_MAX_MERGE_GROUPS,
99 MEMTABLE_PARTITION_TREE_INDEX_MAX_KEYS_PER_SHARD,
100 MEMTABLE_PARTITION_TREE_DATA_FREEZE_THRESHOLD,
101 MEMTABLE_PARTITION_TREE_FORK_DICTIONARY_BYTES,
102 APPEND_MODE_KEY,
104 MERGE_MODE_KEY,
105 SST_FORMAT_KEY,
106 MAX_ROW_GROUP_ROW_COUNT,
107 ]
108 .contains(&key)
109}
110
111#[cfg(test)]
112mod tests {
113 use super::*;
114
115 #[test]
116 fn test_is_mito_engine_option_key() {
117 assert!(is_mito_engine_option_key("ttl"));
118 assert!(is_mito_engine_option_key("write_buffer_size"));
119 assert!(is_mito_engine_option_key("auto_flush_interval"));
120 assert!(is_mito_engine_option_key("compaction.type"));
121 assert!(is_mito_engine_option_key("compaction.override"));
122 assert!(is_mito_engine_option_key(
123 "compaction.twcs.trigger_file_num"
124 ));
125 assert!(is_mito_engine_option_key("compaction.twcs.time_window"));
126 assert!(is_mito_engine_option_key("storage"));
127 assert!(is_mito_engine_option_key(
128 "index.inverted_index.ignore_column_ids"
129 ));
130 assert!(is_mito_engine_option_key(
131 "index.inverted_index.segment_row_count"
132 ));
133 assert!(is_mito_engine_option_key("wal_options"));
134 assert!(is_mito_engine_option_key("memtable.type"));
135 assert!(is_mito_engine_option_key("memtable.bulk.merge_threshold"));
136 assert!(is_mito_engine_option_key(
137 "memtable.bulk.encode_row_threshold"
138 ));
139 assert!(is_mito_engine_option_key(
140 "memtable.bulk.encode_bytes_threshold"
141 ));
142 assert!(is_mito_engine_option_key("memtable.bulk.max_merge_groups"));
143 assert!(is_mito_engine_option_key(
144 "memtable.partition_tree.index_max_keys_per_shard"
145 ));
146 assert!(is_mito_engine_option_key(
147 "memtable.partition_tree.data_freeze_threshold"
148 ));
149 assert!(is_mito_engine_option_key(
150 "memtable.partition_tree.fork_dictionary_bytes"
151 ));
152 assert!(is_mito_engine_option_key("append_mode"));
153 assert!(is_mito_engine_option_key("max_row_group_row_count"));
154 assert!(!is_mito_engine_option_key("foo"));
155 }
156}