Skip to content

Commit a99f13b

Browse files
committed
update
1 parent 07a64c0 commit a99f13b

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

src/query/catalog/src/plan/partition.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ impl ReclusterParts {
392392
}
393393
}
394394

395-
// TODO refine this
396395
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Default)]
397396
pub struct ReclusterInfoSideCar {
398397
pub merged_blocks: Vec<Arc<BlockMeta>>,

src/query/catalog/src/table_context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ pub trait TableContext: Send + Sync {
279279
max_files: Option<usize>,
280280
) -> Result<FilteredCopyFiles>;
281281

282-
fn add_inserted_segment_location(&self, segment_loc: Location) -> Result<()>;
282+
fn add_written_segment_location(&self, segment_loc: Location) -> Result<()>;
283283

284-
fn clear_inserted_segment_locations(&self) -> Result<()>;
284+
fn clear_written_segment_locations(&self) -> Result<()>;
285285

286-
fn get_inserted_segment_locations(&self) -> Result<Vec<Location>>;
286+
fn get_written_segment_locations(&self) -> Result<Vec<Location>>;
287287

288288
fn add_selected_segment_location(&self, _segment_loc: Location) {
289289
unimplemented!()

src/query/service/src/interpreters/hook/compact_hook.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ async fn compact_table(
186186
PipelineCompleteExecutor::from_pipelines(pipelines, executor_settings)?;
187187

188188
// Clears previously generated segment locations to avoid duplicate data in the refresh phase
189-
ctx.clear_inserted_segment_locations()?;
189+
ctx.clear_written_segment_locations()?;
190190
ctx.set_executor(complete_executor.get_inner())?;
191191
complete_executor.execute()?;
192192
drop(complete_executor);

src/query/service/src/interpreters/hook/refresh_hook.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ async fn generate_refresh_index_plan(
209209
catalog: &str,
210210
table_id: MetaId,
211211
) -> Result<Vec<Plan>> {
212-
let segment_locs = ctx.get_inserted_segment_locations()?;
212+
let segment_locs = ctx.get_written_segment_locations()?;
213213
let catalog = ctx.get_catalog(catalog).await?;
214214
let mut plans = vec![];
215215
let indexes = catalog
@@ -272,7 +272,7 @@ async fn generate_refresh_inverted_index_plan(
272272
desc: &RefreshDesc,
273273
table: Arc<dyn Table>,
274274
) -> Result<Vec<Plan>> {
275-
let segment_locs = ctx.get_inserted_segment_locations()?;
275+
let segment_locs = ctx.get_written_segment_locations()?;
276276
let mut plans = vec![];
277277

278278
let table_meta = &table.get_table_info().meta;
@@ -296,7 +296,7 @@ async fn generate_refresh_virtual_column_plan(
296296
ctx: Arc<QueryContext>,
297297
desc: &RefreshDesc,
298298
) -> Result<Option<Plan>> {
299-
let segment_locs = ctx.get_inserted_segment_locations()?;
299+
let segment_locs = ctx.get_written_segment_locations()?;
300300

301301
let table_info = ctx
302302
.get_table(&desc.catalog, &desc.database, &desc.table)

src/query/service/src/interpreters/interpreter_table_recluster.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl ReclusterTableInterpreter {
217217

218218
let complete_executor =
219219
PipelineCompleteExecutor::from_pipelines(pipelines, executor_settings)?;
220-
self.ctx.clear_inserted_segment_locations()?;
220+
self.ctx.clear_written_segment_locations()?;
221221
self.ctx.set_executor(complete_executor.get_inner())?;
222222
complete_executor.execute()?;
223223
// make sure the executor is dropped before the next loop.

src/query/service/src/sessions/query_ctx.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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()

src/query/service/tests/it/sql/exec/get_table_bind_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,15 +845,15 @@ impl TableContext for CtxDelegation {
845845
todo!()
846846
}
847847

848-
fn add_inserted_segment_location(&self, _segment_loc: Location) -> Result<()> {
848+
fn add_written_segment_location(&self, _segment_loc: Location) -> Result<()> {
849849
todo!()
850850
}
851851

852-
fn clear_inserted_segment_locations(&self) -> Result<()> {
852+
fn clear_written_segment_locations(&self) -> Result<()> {
853853
todo!()
854854
}
855855

856-
fn get_inserted_segment_locations(&self) -> Result<Vec<Location>> {
856+
fn get_written_segment_locations(&self) -> Result<Vec<Location>> {
857857
todo!()
858858
}
859859

src/query/service/tests/it/storages/fuse/operations/commit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,15 @@ impl TableContext for CtxDelegation {
730730
HashMap::new()
731731
}
732732

733-
fn add_inserted_segment_location(&self, _segment_loc: Location) -> Result<()> {
733+
fn add_written_segment_location(&self, _segment_loc: Location) -> Result<()> {
734734
todo!()
735735
}
736736

737-
fn clear_inserted_segment_locations(&self) -> Result<()> {
737+
fn clear_written_segment_locations(&self) -> Result<()> {
738738
todo!()
739739
}
740740

741-
fn get_inserted_segment_locations(&self) -> Result<Vec<Location>> {
741+
fn get_written_segment_locations(&self) -> Result<Vec<Location>> {
742742
todo!()
743743
}
744744

src/query/storages/fuse/src/operations/common/processors/sink_commit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ where F: SnapshotGenerator + Send + 'static
442442
metrics_inc_commit_copied_files(files.file_info.len() as u64);
443443
}
444444
for segment_loc in std::mem::take(&mut self.new_segment_locs).into_iter() {
445-
self.ctx.add_inserted_segment_location(segment_loc)?;
445+
self.ctx.add_written_segment_location(segment_loc)?;
446446
}
447447

448448
let target_descriptions = {

0 commit comments

Comments
 (0)