mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Rename the Snapshot task into SnapshotCreation
This commit is contained in:
parent
c2842ad25f
commit
e65f82bc86
6 changed files with 24 additions and 19 deletions
|
@ -60,7 +60,7 @@ impl From<KindWithContent> for AutobatchKind {
|
|||
KindWithContent::TaskCancelation { .. }
|
||||
| KindWithContent::TaskDeletion { .. }
|
||||
| KindWithContent::DumpCreation { .. }
|
||||
| KindWithContent::Snapshot => {
|
||||
| KindWithContent::SnapshotCreation => {
|
||||
panic!("The autobatcher should never be called with tasks that don't apply to an index.")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ use crate::{Error, IndexScheduler, Query, Result, TaskId};
|
|||
pub(crate) enum Batch {
|
||||
TaskCancelation(Task),
|
||||
TaskDeletion(Task),
|
||||
Snapshot(Vec<Task>),
|
||||
SnapshotCreation(Vec<Task>),
|
||||
Dump(Task),
|
||||
IndexOperation { op: IndexOperation, must_create_index: bool },
|
||||
IndexCreation { index_uid: String, primary_key: Option<String>, task: Task },
|
||||
|
@ -118,7 +118,7 @@ impl Batch {
|
|||
| Batch::Dump(task)
|
||||
| Batch::IndexCreation { task, .. }
|
||||
| Batch::IndexUpdate { task, .. } => vec![task.uid],
|
||||
Batch::Snapshot(tasks) | Batch::IndexDeletion { tasks, .. } => {
|
||||
Batch::SnapshotCreation(tasks) | Batch::IndexDeletion { tasks, .. } => {
|
||||
tasks.iter().map(|task| task.uid).collect()
|
||||
}
|
||||
Batch::IndexOperation { op, .. } => match op {
|
||||
|
@ -406,9 +406,9 @@ impl IndexScheduler {
|
|||
}
|
||||
|
||||
// 3. we batch the snapshot.
|
||||
let to_snapshot = self.get_kind(rtxn, Kind::Snapshot)? & enqueued;
|
||||
let to_snapshot = self.get_kind(rtxn, Kind::SnapshotCreation)? & enqueued;
|
||||
if !to_snapshot.is_empty() {
|
||||
return Ok(Some(Batch::Snapshot(self.get_existing_tasks(rtxn, to_snapshot)?)));
|
||||
return Ok(Some(Batch::SnapshotCreation(self.get_existing_tasks(rtxn, to_snapshot)?)));
|
||||
}
|
||||
|
||||
// 4. we batch the dumps.
|
||||
|
@ -552,7 +552,7 @@ impl IndexScheduler {
|
|||
wtxn.commit()?;
|
||||
Ok(vec![task])
|
||||
}
|
||||
Batch::Snapshot(_) => todo!(),
|
||||
Batch::SnapshotCreation(_) => todo!(),
|
||||
Batch::Dump(mut task) => {
|
||||
let started_at = OffsetDateTime::now_utc();
|
||||
let (keys, instance_uid, dump_uid) =
|
||||
|
|
|
@ -708,7 +708,7 @@ impl IndexScheduler {
|
|||
KindDump::DumpCreation { dump_uid, keys, instance_uid } => {
|
||||
KindWithContent::DumpCreation { dump_uid, keys, instance_uid }
|
||||
}
|
||||
KindDump::Snapshot => KindWithContent::Snapshot,
|
||||
KindDump::SnapshotCreation => KindWithContent::SnapshotCreation,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ pub fn swap_index_uid_in_task(task: &mut Task, swap: (&str, &str)) {
|
|||
K::TaskCancelation { .. }
|
||||
| K::TaskDeletion { .. }
|
||||
| K::DumpCreation { .. }
|
||||
| K::Snapshot => {}
|
||||
| K::SnapshotCreation => (),
|
||||
};
|
||||
if let Some(Details::IndexSwap { swaps }) = &mut task.details {
|
||||
for (lhs, rhs) in swaps.iter_mut() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue