mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 06:44:27 +01:00
remove the unused variants from the autobatcher
This commit is contained in:
parent
ab8f1c2865
commit
cff003c928
@ -22,10 +22,6 @@ enum AutobatchKind {
|
|||||||
IndexDeletion,
|
IndexDeletion,
|
||||||
IndexUpdate,
|
IndexUpdate,
|
||||||
IndexSwap,
|
IndexSwap,
|
||||||
TaskCancelation,
|
|
||||||
TaskDeletion,
|
|
||||||
DumpExport,
|
|
||||||
Snapshot,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AutobatchKind {
|
impl AutobatchKind {
|
||||||
@ -62,10 +58,12 @@ impl From<KindWithContent> for AutobatchKind {
|
|||||||
KindWithContent::IndexCreation { .. } => AutobatchKind::IndexCreation,
|
KindWithContent::IndexCreation { .. } => AutobatchKind::IndexCreation,
|
||||||
KindWithContent::IndexUpdate { .. } => AutobatchKind::IndexUpdate,
|
KindWithContent::IndexUpdate { .. } => AutobatchKind::IndexUpdate,
|
||||||
KindWithContent::IndexSwap { .. } => AutobatchKind::IndexSwap,
|
KindWithContent::IndexSwap { .. } => AutobatchKind::IndexSwap,
|
||||||
KindWithContent::TaskCancelation { .. } => AutobatchKind::TaskCancelation,
|
KindWithContent::TaskCancelation { .. }
|
||||||
KindWithContent::TaskDeletion { .. } => AutobatchKind::TaskDeletion,
|
| KindWithContent::TaskDeletion { .. }
|
||||||
KindWithContent::DumpExport { .. } => AutobatchKind::DumpExport,
|
| KindWithContent::DumpExport { .. }
|
||||||
KindWithContent::Snapshot => AutobatchKind::Snapshot,
|
| KindWithContent::Snapshot => {
|
||||||
|
panic!("The autobatcher should never be called with tasks that don't apply to an index.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,9 +152,6 @@ impl BatchKind {
|
|||||||
allow_index_creation,
|
allow_index_creation,
|
||||||
settings_ids: vec![task_id],
|
settings_ids: vec![task_id],
|
||||||
}),
|
}),
|
||||||
K::DumpExport | K::Snapshot | K::TaskCancelation | K::TaskDeletion => {
|
|
||||||
unreachable!()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +263,7 @@ impl BatchKind {
|
|||||||
BatchKind::Settings { settings_ids, allow_index_creation },
|
BatchKind::Settings { settings_ids, allow_index_creation },
|
||||||
K::DocumentClear,
|
K::DocumentClear,
|
||||||
) => Continue(BatchKind::ClearAndSettings {
|
) => Continue(BatchKind::ClearAndSettings {
|
||||||
settings_ids: settings_ids,
|
settings_ids,
|
||||||
allow_index_creation,
|
allow_index_creation,
|
||||||
other: vec![id],
|
other: vec![id],
|
||||||
}),
|
}),
|
||||||
@ -379,9 +374,6 @@ impl BatchKind {
|
|||||||
import_ids,
|
import_ids,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
(_, K::TaskCancelation | K::TaskDeletion | K::DumpExport | K::Snapshot) => {
|
|
||||||
unreachable!()
|
|
||||||
}
|
|
||||||
(
|
(
|
||||||
BatchKind::IndexCreation { .. }
|
BatchKind::IndexCreation { .. }
|
||||||
| BatchKind::IndexDeletion { .. }
|
| BatchKind::IndexDeletion { .. }
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::BufWriter;
|
use std::io::BufWriter;
|
||||||
use std::sync::atomic::Ordering::Relaxed;
|
|
||||||
|
|
||||||
use crate::{autobatcher::BatchKind, Error, IndexScheduler, Result, TaskId};
|
use crate::{autobatcher::BatchKind, Error, IndexScheduler, Result, TaskId};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user