rebase on index-scheduler

This commit is contained in:
Tamo 2022-10-17 15:11:35 +02:00 committed by Clément Renault
parent e0221fc0a3
commit d0e91555d1
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
7 changed files with 12 additions and 6 deletions

View File

@ -21,6 +21,7 @@ meilisearch-types = { path = "../meilisearch-types" }
http = "0.2.8" http = "0.2.8"
regex = "1.6.0" regex = "1.6.0"
lazy_static = "1.4.0" lazy_static = "1.4.0"
roaring = { version = "0.10.0", features = ["serde"] }
[dev-dependencies] [dev-dependencies]
big_s = "1.0.2" big_s = "1.0.2"

View File

@ -4,6 +4,7 @@ use meilisearch_types::{
settings::Unchecked, settings::Unchecked,
tasks::{Details, KindWithContent, Status, Task, TaskId}, tasks::{Details, KindWithContent, Status, Task, TaskId},
}; };
use roaring::RoaringBitmap;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use time::OffsetDateTime; use time::OffsetDateTime;
@ -115,7 +116,7 @@ pub enum KindDump {
}, },
DeleteTasks { DeleteTasks {
query: String, query: String,
tasks: Vec<TaskId>, tasks: RoaringBitmap,
}, },
DumpExport { DumpExport {
dump_uid: String, dump_uid: String,
@ -177,7 +178,9 @@ impl From<KindWithContent> for KindDump {
} }
KindWithContent::IndexSwap { lhs, rhs } => KindDump::IndexSwap { lhs, rhs }, KindWithContent::IndexSwap { lhs, rhs } => KindDump::IndexSwap { lhs, rhs },
KindWithContent::CancelTask { tasks } => KindDump::CancelTask { tasks }, KindWithContent::CancelTask { tasks } => KindDump::CancelTask { tasks },
KindWithContent::DeleteTasks { query, tasks } => KindDump::DeleteTasks { query, tasks }, KindWithContent::TaskDeletion { query, tasks } => {
KindDump::DeleteTasks { query, tasks }
}
KindWithContent::DumpExport { dump_uid, .. } => KindDump::DumpExport { dump_uid }, KindWithContent::DumpExport { dump_uid, .. } => KindDump::DumpExport { dump_uid },
KindWithContent::Snapshot => KindDump::Snapshot, KindWithContent::Snapshot => KindDump::Snapshot,
} }

View File

@ -480,7 +480,7 @@ impl IndexScheduler {
KindDump::IndexSwap { lhs, rhs } => KindWithContent::IndexSwap { lhs, rhs }, KindDump::IndexSwap { lhs, rhs } => KindWithContent::IndexSwap { lhs, rhs },
KindDump::CancelTask { tasks } => KindWithContent::CancelTask { tasks }, KindDump::CancelTask { tasks } => KindWithContent::CancelTask { tasks },
KindDump::DeleteTasks { query, tasks } => { KindDump::DeleteTasks { query, tasks } => {
KindWithContent::DeleteTasks { query, tasks } KindWithContent::TaskDeletion { query, tasks }
} }
KindDump::DumpExport { dump_uid } => KindWithContent::DumpExport { KindDump::DumpExport { dump_uid } => KindWithContent::DumpExport {
dump_uid, dump_uid,

View File

@ -14,3 +14,4 @@ sha2 = "0.10.6"
thiserror = "1.0.37" thiserror = "1.0.37"
time = { version = "0.3.15", features = ["serde-well-known", "formatting", "parsing", "macros"] } time = { version = "0.3.15", features = ["serde-well-known", "formatting", "parsing", "macros"] }
uuid = { version = "1.1.2", features = ["serde", "v4"] } uuid = { version = "1.1.2", features = ["serde", "v4"] }
roaring = { version = "0.10.0", features = ["serde"] }

View File

@ -18,7 +18,7 @@ pub enum AuthControllerError {
} }
internal_error!( internal_error!(
AuthControllerError: milli::heed::Error, AuthControllerError: meilisearch_types::milli::heed::Error,
std::io::Error, std::io::Error,
serde_json::Error, serde_json::Error,
std::str::Utf8Error std::str::Utf8Error

View File

@ -11,6 +11,7 @@ use std::sync::Arc;
use hmac::{Hmac, Mac}; use hmac::{Hmac, Mac};
use meilisearch_types::keys::KeyId; use meilisearch_types::keys::KeyId;
use meilisearch_types::milli;
use meilisearch_types::star_or::StarOr; use meilisearch_types::star_or::StarOr;
use meilisearch_types::milli; use meilisearch_types::milli;
use milli::heed::types::{ByteSlice, DecodeIgnore, SerdeJson}; use milli::heed::types::{ByteSlice, DecodeIgnore, SerdeJson};

View File

@ -87,7 +87,7 @@ impl Task {
| KindWithContent::IndexUpdate { .. } | KindWithContent::IndexUpdate { .. }
| KindWithContent::IndexSwap { .. } | KindWithContent::IndexSwap { .. }
| KindWithContent::CancelTask { .. } | KindWithContent::CancelTask { .. }
| KindWithContent::DeleteTasks { .. } | KindWithContent::TaskDeletion { .. }
| KindWithContent::DumpExport { .. } | KindWithContent::DumpExport { .. }
| KindWithContent::Snapshot => None, | KindWithContent::Snapshot => None,
} }
@ -250,7 +250,7 @@ impl From<&KindWithContent> for Option<Details> {
}), }),
KindWithContent::IndexSwap { .. } => None, KindWithContent::IndexSwap { .. } => None,
KindWithContent::CancelTask { .. } => None, KindWithContent::CancelTask { .. } => None,
KindWithContent::DeleteTasks { .. } => todo!(), KindWithContent::TaskDeletion { .. } => todo!(),
KindWithContent::DumpExport { dump_uid, .. } => Some(Details::Dump { KindWithContent::DumpExport { dump_uid, .. } => Some(Details::Dump {
dump_uid: dump_uid.clone(), dump_uid: dump_uid.clone(),
}), }),