@@ -151,7 +151,8 @@ pub struct QueryContext {
151151 query_settings : Arc < Settings > ,
152152 fragment_id : Arc < AtomicUsize > ,
153153 // Used by synchronized generate aggregating indexes when new data written.
154- inserted_segment_locs : Arc < RwLock < HashSet < Location > > > ,
154+ written_segment_locs : Arc < RwLock < HashSet < Location > > > ,
155+ // Used by hilbert clustering when do recluster.
155156 selected_segment_locs : Arc < RwLock < HashSet < Location > > > ,
156157 // Temp table for materialized CTE, first string is the database_name, second string is the table_name
157158 // All temp tables' catalog is `CATALOG_DEFAULT`, so we don't need to store it.
@@ -179,7 +180,7 @@ impl QueryContext {
179180 shared,
180181 query_settings,
181182 fragment_id : Arc :: new ( AtomicUsize :: new ( 0 ) ) ,
182- inserted_segment_locs : Default :: default ( ) ,
183+ written_segment_locs : Default :: default ( ) ,
183184 block_threshold : Default :: default ( ) ,
184185 m_cte_temp_table : Default :: default ( ) ,
185186 selected_segment_locs : Default :: default ( ) ,
@@ -1206,21 +1207,21 @@ impl TableContext for QueryContext {
12061207 } )
12071208 }
12081209
1209- fn add_inserted_segment_location ( & self , segment_loc : Location ) -> Result < ( ) > {
1210- let mut segment_locations = self . inserted_segment_locs . write ( ) ;
1210+ fn add_written_segment_location ( & self , segment_loc : Location ) -> Result < ( ) > {
1211+ let mut segment_locations = self . written_segment_locs . write ( ) ;
12111212 segment_locations. insert ( segment_loc) ;
12121213 Ok ( ( ) )
12131214 }
12141215
1215- fn clear_inserted_segment_locations ( & self ) -> Result < ( ) > {
1216- let mut segment_locations = self . inserted_segment_locs . write ( ) ;
1216+ fn clear_written_segment_locations ( & self ) -> Result < ( ) > {
1217+ let mut segment_locations = self . written_segment_locs . write ( ) ;
12171218 segment_locations. clear ( ) ;
12181219 Ok ( ( ) )
12191220 }
12201221
1221- fn get_inserted_segment_locations ( & self ) -> Result < Vec < Location > > {
1222+ fn get_written_segment_locations ( & self ) -> Result < Vec < Location > > {
12221223 Ok ( self
1223- . inserted_segment_locs
1224+ . written_segment_locs
12241225 . read ( )
12251226 . iter ( )
12261227 . cloned ( )
0 commit comments