Skip to content

Commit 2096d90

Browse files
committed
gaph, store: Rename PruningStrategy::Copy to Rebuild
1 parent bed5887 commit 2096d90

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

graph/src/components/store/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ pub enum PrunePhase {
12081208
impl PrunePhase {
12091209
pub fn strategy(&self) -> PruningStrategy {
12101210
match self {
1211-
PrunePhase::CopyFinal | PrunePhase::CopyNonfinal => PruningStrategy::Copy,
1211+
PrunePhase::CopyFinal | PrunePhase::CopyNonfinal => PruningStrategy::Rebuild,
12121212
PrunePhase::Delete => PruningStrategy::Delete,
12131213
}
12141214
}
@@ -1247,9 +1247,9 @@ pub trait PruneReporter: Send + 'static {
12471247
/// Select how pruning should be done
12481248
#[derive(Clone, Copy, Debug, Display, PartialEq)]
12491249
pub enum PruningStrategy {
1250-
/// Copy the data we want to keep to new tables and swap them out for
1251-
/// the existing tables
1252-
Copy,
1250+
/// Rebuild by copying the data we want to keep to new tables and swap
1251+
/// them out for the existing tables
1252+
Rebuild,
12531253
/// Delete unneeded data from the existing tables
12541254
Delete,
12551255
}
@@ -1357,7 +1357,7 @@ impl PruneRequest {
13571357
// will remove.
13581358
let removal_ratio = self.history_pct(stats) * (1.0 - stats.ratio);
13591359
if removal_ratio >= self.copy_threshold {
1360-
Some(PruningStrategy::Copy)
1360+
Some(PruningStrategy::Rebuild)
13611361
} else if removal_ratio >= self.delete_threshold {
13621362
Some(PruningStrategy::Delete)
13631363
} else {

store/postgres/src/deployment_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ impl PruneReporter for OngoingPruneReporter {
19691969

19701970
fn prune_batch(&mut self, _table: &str, rows: usize, phase: PrunePhase, _finished: bool) {
19711971
match phase.strategy() {
1972-
PruningStrategy::Copy => self.rows_copied += rows,
1972+
PruningStrategy::Rebuild => self.rows_copied += rows,
19731973
PruningStrategy::Delete => self.rows_deleted += rows,
19741974
}
19751975
}

store/postgres/src/relational/prune.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ impl Layout {
414414
for (table, strat) in &prunable_tables {
415415
reporter.start_table(table.name.as_str());
416416
match strat {
417-
PruningStrategy::Copy => {
417+
PruningStrategy::Rebuild => {
418418
if recreate_dst_nsp {
419419
catalog::recreate_schema(conn, dst_nsp.as_str())?;
420420
recreate_dst_nsp = false;

store/postgres/tests/graft.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ fn prune() {
569569
);
570570
}
571571

572-
for strategy in [PruningStrategy::Copy, PruningStrategy::Delete] {
572+
for strategy in [PruningStrategy::Rebuild, PruningStrategy::Delete] {
573573
run_test(move |store, src| async move {
574574
store
575575
.set_history_blocks(&src, -3, 10)
@@ -612,7 +612,7 @@ fn prune() {
612612
let mut req = PruneRequest::new(&src, 3, 1, 0, 6)?;
613613
// Change the thresholds so that we select the desired strategy
614614
match strategy {
615-
PruningStrategy::Copy => {
615+
PruningStrategy::Rebuild => {
616616
req.copy_threshold = 0.0;
617617
req.delete_threshold = 0.0;
618618
}

0 commit comments

Comments
 (0)