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