@@ -59,6 +59,9 @@ pub struct StorageConfig {
5959 default = "StorageConfig::default_copyinto_trigger_flush_size"
6060 ) ]
6161 pub copyinto_trigger_flush_size : u64 ,
62+
63+ #[ serde( default = "StorageConfig::default_max_datablock_size" ) ]
64+ pub max_datablock_size : u64 ,
6265}
6366
6467impl StorageConfig {
@@ -115,6 +118,10 @@ impl StorageConfig {
115118 128 * 1024 * 1024 // 128M
116119 }
117120
121+ fn default_max_datablock_size ( ) -> u64 {
122+ 100 * 1024
123+ }
124+
118125 pub fn introspect ( & mut self ) {
119126 // Unit of storage.compact_trigger_cold_duration is seconds
120127 self . compact_trigger_cold_duration =
@@ -160,6 +167,11 @@ impl OverrideByEnv for StorageConfig {
160167 & mut self . copyinto_trigger_flush_size ,
161168 "CNOSDB_COPYINTO_TRIGGER_FLUSH_SIZE" ,
162169 ) ;
170+ entry_override ( & mut self . reserve_space , "CNOSDB_STORAGE_RESERVE_SPACE" ) ;
171+ entry_override (
172+ & mut self . max_datablock_size ,
173+ "CNOSDB_STORAGE_MAX_DATABLOCK_SIZE" ,
174+ ) ;
163175 }
164176}
165177
@@ -179,6 +191,7 @@ impl Default for StorageConfig {
179191 strict_write : Self :: default_strict_write ( ) ,
180192 reserve_space : Self :: default_reserve_space ( ) ,
181193 copyinto_trigger_flush_size : Self :: default_copyinto_trigger_flush_size ( ) ,
194+ max_datablock_size : Self :: default_max_datablock_size ( ) ,
182195 }
183196 }
184197}
0 commit comments