diff --git a/index-scheduler/src/autobatcher.rs b/index-scheduler/src/autobatcher.rs index a6adfd549..83b0d56ab 100644 --- a/index-scheduler/src/autobatcher.rs +++ b/index-scheduler/src/autobatcher.rs @@ -22,10 +22,6 @@ enum AutobatchKind { IndexDeletion, IndexUpdate, IndexSwap, - TaskCancelation, - TaskDeletion, - DumpExport, - Snapshot, } impl AutobatchKind { @@ -62,10 +58,12 @@ impl From for AutobatchKind { KindWithContent::IndexCreation { .. } => AutobatchKind::IndexCreation, KindWithContent::IndexUpdate { .. } => AutobatchKind::IndexUpdate, KindWithContent::IndexSwap { .. } => AutobatchKind::IndexSwap, - KindWithContent::TaskCancelation { .. } => AutobatchKind::TaskCancelation, - KindWithContent::TaskDeletion { .. } => AutobatchKind::TaskDeletion, - KindWithContent::DumpExport { .. } => AutobatchKind::DumpExport, - KindWithContent::Snapshot => AutobatchKind::Snapshot, + KindWithContent::TaskCancelation { .. } + | KindWithContent::TaskDeletion { .. } + | KindWithContent::DumpExport { .. } + | 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, 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 }, K::DocumentClear, ) => Continue(BatchKind::ClearAndSettings { - settings_ids: settings_ids, + settings_ids, allow_index_creation, other: vec![id], }), @@ -379,9 +374,6 @@ impl BatchKind { import_ids, }) } - (_, K::TaskCancelation | K::TaskDeletion | K::DumpExport | K::Snapshot) => { - unreachable!() - } ( BatchKind::IndexCreation { .. } | BatchKind::IndexDeletion { .. } diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 4bafe8494..ab6e4d5bd 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -1,7 +1,6 @@ use std::collections::HashSet; use std::fs::File; use std::io::BufWriter; -use std::sync::atomic::Ordering::Relaxed; use crate::{autobatcher::BatchKind, Error, IndexScheduler, Result, TaskId};