rename the dumpExport to dumpCreation

This commit is contained in:
Irevoire 2022-10-24 19:08:15 +02:00
parent 581d8b0a94
commit 3e45fdf7c5
No known key found for this signature in database
GPG key ID: 7A6A970C96104F1B
16 changed files with 79 additions and 77 deletions

View file

@ -59,7 +59,7 @@ impl From<KindWithContent> for AutobatchKind {
KindWithContent::IndexSwap { .. } => AutobatchKind::IndexSwap,
KindWithContent::TaskCancelation { .. }
| KindWithContent::TaskDeletion { .. }
| KindWithContent::DumpExport { .. }
| KindWithContent::DumpCreation { .. }
| KindWithContent::Snapshot => {
panic!("The autobatcher should never be called with tasks that don't apply to an index.")
}

View file

@ -409,7 +409,7 @@ impl IndexScheduler {
}
// 4. we batch the dumps.
let to_dump = self.get_kind(rtxn, Kind::DumpExport)? & enqueued;
let to_dump = self.get_kind(rtxn, Kind::DumpCreation)? & enqueued;
if let Some(to_dump) = to_dump.min() {
return Ok(Some(Batch::Dump(
self.get_task(rtxn, to_dump)?.ok_or(Error::CorruptedTaskQueue)?,
@ -540,16 +540,14 @@ impl IndexScheduler {
Batch::Snapshot(_) => todo!(),
Batch::Dump(mut task) => {
let started_at = OffsetDateTime::now_utc();
let (keys, instance_uid, dump_uid) = if let KindWithContent::DumpExport {
keys,
instance_uid,
dump_uid,
} = &task.kind
{
(keys, instance_uid, dump_uid)
} else {
unreachable!();
};
let (keys, instance_uid, dump_uid) =
if let KindWithContent::DumpCreation { keys, instance_uid, dump_uid } =
&task.kind
{
(keys, instance_uid, dump_uid)
} else {
unreachable!();
};
let dump = dump::DumpWriter::new(*instance_uid)?;
// 1. dump the keys

View file

@ -606,8 +606,8 @@ impl IndexScheduler {
KindDump::TasksDeletion { query, tasks } => {
KindWithContent::TaskDeletion { query, tasks }
}
KindDump::DumpExport { dump_uid, keys, instance_uid } => {
KindWithContent::DumpExport { dump_uid, keys, instance_uid }
KindDump::DumpCreation { dump_uid, keys, instance_uid } => {
KindWithContent::DumpCreation { dump_uid, keys, instance_uid }
}
KindDump::Snapshot => KindWithContent::Snapshot,
},

View file

@ -253,8 +253,10 @@ pub fn swap_index_uid_in_task(task: &mut Task, swap: (&str, &str)) {
}
}
}
K::TaskCancelation { .. } | K::TaskDeletion { .. } | K::DumpExport { .. } | K::Snapshot => {
}
K::TaskCancelation { .. }
| K::TaskDeletion { .. }
| K::DumpCreation { .. }
| K::Snapshot => {}
};
for index_uid in index_uids {
if index_uid == swap.0 {