@@ -53,10 +53,8 @@ use log::info;
5353use log:: warn;
5454use opendal:: Operator ;
5555
56- use crate :: DEFAULT_AVG_DEPTH_THRESHOLD ;
5756use crate :: DEFAULT_RECLUSTER_DEPTH ;
5857use crate :: FUSE_OPT_KEY_RECLUSTER_DEPTH ;
59- use crate :: FUSE_OPT_KEY_ROW_AVG_DEPTH_THRESHOLD ;
6058use crate :: FuseTable ;
6159use crate :: MAX_RECLUSTER_DEPTH ;
6260use crate :: MIN_RECLUSTER_DEPTH ;
@@ -172,7 +170,11 @@ impl ReclusterMutator {
172170 let cluster_key_id = table. cluster_key_id ( ) . unwrap ( ) ;
173171 let block_thresholds = table. get_block_thresholds ( ) ;
174172
175- let depth_threshold = Self :: recluster_depth_threshold ( table, snapshot. summary . block_count ) ;
173+ let depth_threshold = if snapshot. summary . block_count <= SMALL_TABLE_RECLUSTER_BLOCK_COUNT {
174+ MIN_RECLUSTER_DEPTH as f64
175+ } else {
176+ table. get_option ( FUSE_OPT_KEY_RECLUSTER_DEPTH , DEFAULT_RECLUSTER_DEPTH ) as f64
177+ } ;
176178
177179 let settings = ctx. get_settings ( ) ;
178180 let memory_threshold = Self :: recluster_memory_threshold ( ctx. as_ref ( ) ) ?;
@@ -477,28 +479,6 @@ impl ReclusterMutator {
477479 Ok ( ( selected_blocks_idx. len ( ) as u64 , parts) )
478480 }
479481
480- fn recluster_depth_threshold ( table : & FuseTable , block_count : u64 ) -> f64 {
481- let options = table. table_info . options ( ) ;
482- if options. contains_key ( FUSE_OPT_KEY_RECLUSTER_DEPTH ) {
483- return table. get_option ( FUSE_OPT_KEY_RECLUSTER_DEPTH , DEFAULT_RECLUSTER_DEPTH ) as f64 ;
484- }
485-
486- if options. contains_key ( FUSE_OPT_KEY_ROW_AVG_DEPTH_THRESHOLD ) {
487- let avg_depth_threshold = table. get_option (
488- FUSE_OPT_KEY_ROW_AVG_DEPTH_THRESHOLD ,
489- DEFAULT_AVG_DEPTH_THRESHOLD ,
490- ) ;
491- return ( block_count as f64 * avg_depth_threshold)
492- . clamp ( MIN_RECLUSTER_DEPTH as f64 , MAX_RECLUSTER_DEPTH as f64 ) ;
493- }
494-
495- if block_count <= SMALL_TABLE_RECLUSTER_BLOCK_COUNT {
496- MIN_RECLUSTER_DEPTH as f64
497- } else {
498- DEFAULT_RECLUSTER_DEPTH as f64
499- }
500- }
501-
502482 fn recluster_memory_threshold ( ctx : & dyn TableContext ) -> Result < usize > {
503483 let settings = ctx. get_settings ( ) ;
504484 let recluster_block_size = settings. get_recluster_block_size ( ) ? as usize ;
0 commit comments