From ecf4e43b3d989b643cc3ee507ac1d57d38a09030 Mon Sep 17 00:00:00 2001 From: Irevoire Date: Mon, 24 Oct 2022 19:08:15 +0200 Subject: [PATCH] rename the dumpExport to dumpCreation --- dump/src/lib.rs | 6 +++--- dump/src/reader/compat/v2_to_v3.rs | 8 ++++---- dump/src/reader/compat/v3_to_v4.rs | 8 ++++---- dump/src/reader/compat/v4_to_v5.rs | 6 +++--- dump/src/reader/compat/v5_to_v6.rs | 16 ++++++++------- dump/src/reader/mod.rs | 30 ++++++++++++++--------------- dump/src/reader/v2/mod.rs | 8 ++++---- dump/src/reader/v3/mod.rs | 8 ++++---- dump/src/reader/v4/mod.rs | 6 +++--- dump/src/reader/v5/mod.rs | 6 +++--- index-scheduler/src/autobatcher.rs | 2 +- index-scheduler/src/batch.rs | 20 +++++++++---------- index-scheduler/src/lib.rs | 4 ++-- index-scheduler/src/utils.rs | 6 ++++-- meilisearch-http/src/routes/dump.rs | 2 +- meilisearch-types/src/tasks.rs | 20 +++++++++---------- 16 files changed, 79 insertions(+), 77 deletions(-) diff --git a/dump/src/lib.rs b/dump/src/lib.rs index 772825bdd..4dbc82da4 100644 --- a/dump/src/lib.rs +++ b/dump/src/lib.rs @@ -124,7 +124,7 @@ pub enum KindDump { query: String, tasks: RoaringBitmap, }, - DumpExport { + DumpCreation { dump_uid: String, keys: Vec, instance_uid: Option, @@ -188,8 +188,8 @@ impl From for KindDump { KindWithContent::TaskDeletion { query, tasks } => { KindDump::TasksDeletion { query, tasks } } - KindWithContent::DumpExport { dump_uid, keys, instance_uid } => { - KindDump::DumpExport { dump_uid, keys, instance_uid } + KindWithContent::DumpCreation { dump_uid, keys, instance_uid } => { + KindDump::DumpCreation { dump_uid, keys, instance_uid } } KindWithContent::Snapshot => KindDump::Snapshot, } diff --git a/dump/src/reader/compat/v2_to_v3.rs b/dump/src/reader/compat/v2_to_v3.rs index 3eb3e7879..ae1f7118c 100644 --- a/dump/src/reader/compat/v2_to_v3.rs +++ b/dump/src/reader/compat/v2_to_v3.rs @@ -425,7 +425,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"f43338ecceeddd1ce13ffd55438b2347"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"54b3d7a0d96de35427d867fa17164a99"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); @@ -440,7 +440,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"0d76c745cb334e8c20d6d6a14df733e1"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"ae7c5ade2243a553152dab2f354e9095"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d153b5a81d8b3cdcbe1dec270b574022"); @@ -455,7 +455,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"09a2f7c571729f70f4cd93e24e8e3f28"); + meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"1be82b894556d23953af557b6a328a58"); let documents = movies2.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 0); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d751713988987e9331980363e24189ce"); @@ -470,7 +470,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"09a2f7c571729f70f4cd93e24e8e3f28"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"1be82b894556d23953af557b6a328a58"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/compat/v3_to_v4.rs b/dump/src/reader/compat/v3_to_v4.rs index c12aeba78..20af18c21 100644 --- a/dump/src/reader/compat/v3_to_v4.rs +++ b/dump/src/reader/compat/v3_to_v4.rs @@ -395,7 +395,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ea46dd6b58c5e1d65c1c8159a32695ea"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"d3402aff19b90acea9e9a07c466690aa"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); @@ -410,7 +410,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"4df4074ef6bfb71e8dc66d08ff8c9dfd"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"687aaab250f01b55d57bc69aa313b581"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d153b5a81d8b3cdcbe1dec270b574022"); @@ -425,7 +425,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"24eaf4046d9718dabff36f35103352d4"); + meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"cd9fedbd7e3492831a94da62c90013ea"); let documents = movies2.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 0); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d751713988987e9331980363e24189ce"); @@ -440,7 +440,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"24eaf4046d9718dabff36f35103352d4"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"cd9fedbd7e3492831a94da62c90013ea"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/compat/v4_to_v5.rs b/dump/src/reader/compat/v4_to_v5.rs index b82305cc0..a7d695cbe 100644 --- a/dump/src/reader/compat/v4_to_v5.rs +++ b/dump/src/reader/compat/v4_to_v5.rs @@ -428,7 +428,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ed1a6977a832b1ab49cd5068b77ce498"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"26947283836ee4cdf0974f82efcc5332"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -443,7 +443,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"70681af1d52411218036fbd5a9b94ab5"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"156871410d17e23803d0c90ddc6a66cb"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"786022a66ecb992c8a2a60fee070a5ab"); @@ -458,7 +458,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"7019bb8f146004dcdd91fc3c3254b742"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"69c9916142612cf4a2da9b9ed9455e9e"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/compat/v5_to_v6.rs b/dump/src/reader/compat/v5_to_v6.rs index ed874d3ff..79470bbec 100644 --- a/dump/src/reader/compat/v5_to_v6.rs +++ b/dump/src/reader/compat/v5_to_v6.rs @@ -119,9 +119,11 @@ impl CompatV5ToV6 { allow_index_creation, settings: Box::new(settings.into()), }, - v5::tasks::TaskContent::Dump { uid } => { - v6::Kind::DumpExport { dump_uid: uid, keys: keys.clone(), instance_uid } - } + v5::tasks::TaskContent::Dump { uid } => v6::Kind::DumpCreation { + dump_uid: uid, + keys: keys.clone(), + instance_uid, + }, }, canceled_by: None, details: task_view.details.map(|details| match details { @@ -415,7 +417,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"5d5d839c70adf763d0dc2e0b46c59828"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"42d4200cf6d92a6449989ca48cd8e28a"); assert_eq!(update_files.len(), 22); assert!(update_files[0].is_none()); // the dump creation assert!(update_files[1].is_some()); // the enqueued document addition @@ -445,7 +447,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"9896a66a399c24a0f4f6a3c8563cd14a"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"8e5cadabf74aebe1160bf51c3d489efe"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -460,7 +462,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"d0dc7efd1360f95fce57d7931a70b7c9"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"4894ac1e74b9e1069ed5ee262b7a1aca"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 200); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"e962baafd2fbae4cdd14e876053b0c5a"); @@ -475,7 +477,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"59c8e30c2022897987ea7b4394167b06"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"054dbf08a79e08bb9becba6f5d090f13"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/mod.rs b/dump/src/reader/mod.rs index a73b843f2..dbbcab88b 100644 --- a/dump/src/reader/mod.rs +++ b/dump/src/reader/mod.rs @@ -198,7 +198,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"5d5d839c70adf763d0dc2e0b46c59828"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"42d4200cf6d92a6449989ca48cd8e28a"); assert_eq!(update_files.len(), 22); assert!(update_files[0].is_none()); // the dump creation assert!(update_files[1].is_some()); // the enqueued document addition @@ -228,7 +228,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"9896a66a399c24a0f4f6a3c8563cd14a"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"8e5cadabf74aebe1160bf51c3d489efe"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -243,7 +243,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"d0dc7efd1360f95fce57d7931a70b7c9"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"4894ac1e74b9e1069ed5ee262b7a1aca"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 200); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"e962baafd2fbae4cdd14e876053b0c5a"); @@ -258,7 +258,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"59c8e30c2022897987ea7b4394167b06"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"054dbf08a79e08bb9becba6f5d090f13"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); @@ -305,7 +305,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ed1a6977a832b1ab49cd5068b77ce498"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"1f9da51a4518166fb440def5437eafdb"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -320,7 +320,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"70681af1d52411218036fbd5a9b94ab5"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"488816aba82c1bd65f1609630055c611"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"786022a66ecb992c8a2a60fee070a5ab"); @@ -335,7 +335,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"7019bb8f146004dcdd91fc3c3254b742"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"7b4f66dad597dc651650f35fe34be27f"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); @@ -383,7 +383,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"1a5ed16d00e6163662d9d7ffe400c5d0"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"855f3165dec609b919171ff83f82b364"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); @@ -398,7 +398,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"9a6b511669b8f53d193d2f0bd1671baa"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"43e0bf1746c3ea1d64c1e10ea544c190"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d153b5a81d8b3cdcbe1dec270b574022"); @@ -413,7 +413,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"4fdf905496d9a511800ff523728728ac"); + meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"5fd06a5038f49311600379d43412b655"); let documents = movies2.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 0); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d751713988987e9331980363e24189ce"); @@ -428,7 +428,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"4fdf905496d9a511800ff523728728ac"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"5fd06a5038f49311600379d43412b655"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); @@ -476,7 +476,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"a7d4fed93bfc91d0f1126d3371abf48e"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"b15b71f56dd082d8e8ec5182e688bf36"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); @@ -491,7 +491,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"e79c3cc4eef44bd22acfb60957b459d9"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"5389153ddf5527fa79c54b6a6e9c21f6"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d153b5a81d8b3cdcbe1dec270b574022"); @@ -506,7 +506,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"7917f954b6f345336073bb155540ad6d"); + meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"8aebab01301d266acf3e18dd449c008f"); let documents = movies2.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 0); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d751713988987e9331980363e24189ce"); @@ -521,7 +521,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"7917f954b6f345336073bb155540ad6d"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"8aebab01301d266acf3e18dd449c008f"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/v2/mod.rs b/dump/src/reader/v2/mod.rs index b311c5f14..73396db50 100644 --- a/dump/src/reader/v2/mod.rs +++ b/dump/src/reader/v2/mod.rs @@ -255,7 +255,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"b4814eab5e73e2dcfc90aad50aa583d1"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"c41bf7315d404da46c99b9e3a2a3cc1e"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); @@ -270,7 +270,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"59dd69f590635a58f3d99edc9e1fa21f"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"3d1d96c85b6bab46e957bc8d2532a910"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d153b5a81d8b3cdcbe1dec270b574022"); @@ -285,7 +285,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"ac041085004c43373fe90dc48f5c23ab"); + meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"4f04afc086828d8da0da57a7d598ddba"); let documents = movies2.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 0); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d751713988987e9331980363e24189ce"); @@ -300,7 +300,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"ac041085004c43373fe90dc48f5c23ab"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"4f04afc086828d8da0da57a7d598ddba"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/v3/mod.rs b/dump/src/reader/v3/mod.rs index 9438aa1a3..387064f97 100644 --- a/dump/src/reader/v3/mod.rs +++ b/dump/src/reader/v3/mod.rs @@ -271,7 +271,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"7460d4b242b5c8b1bda223f63bbbf349"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"f309b009608cc0b770b2f74516f92647"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); @@ -286,7 +286,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"d83ab8e79bb44595667d6ce3e6629a4f"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"95dff22ba3a7019616c12df9daa35e1e"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d153b5a81d8b3cdcbe1dec270b574022"); @@ -301,7 +301,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"44d3b5a3b3aa6cd950373ff751d05bb7"); + meili_snap::snapshot_hash!(format!("{:#?}", movies2.settings()), @"1dafc4b123e3a8e14a889719cc01f6e5"); let documents = movies2.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 0); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"d751713988987e9331980363e24189ce"); @@ -316,7 +316,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"44d3b5a3b3aa6cd950373ff751d05bb7"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"1dafc4b123e3a8e14a889719cc01f6e5"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/v4/mod.rs b/dump/src/reader/v4/mod.rs index 32340fba5..d71cd5d6a 100644 --- a/dump/src/reader/v4/mod.rs +++ b/dump/src/reader/v4/mod.rs @@ -267,7 +267,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ace6546a6eb856ecb770b2409975c01d"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"65b139c6b9fc251e187073c8557803e2"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -282,7 +282,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"4dfa34fa34f2c03259482e1e4555faa8"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"06aa1988493485d9b2cda7c751e6bb15"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 110); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"786022a66ecb992c8a2a60fee070a5ab"); @@ -297,7 +297,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"1aa241a5e3afd8c85a4e7b9db42362d7"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"7d722fc2629eaa45032ed3deb0c9b4ce"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/dump/src/reader/v5/mod.rs b/dump/src/reader/v5/mod.rs index 16ad20781..5df544bd0 100644 --- a/dump/src/reader/v5/mod.rs +++ b/dump/src/reader/v5/mod.rs @@ -310,7 +310,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"9896a66a399c24a0f4f6a3c8563cd14a"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"b392b928dab63468318b2bdaad844c5a"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -325,7 +325,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"d0dc7efd1360f95fce57d7931a70b7c9"); + meili_snap::snapshot_hash!(format!("{:#?}", movies.settings()), @"2f881248b7c3623e2ba2885dbf0b2c18"); let documents = movies.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 200); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"e962baafd2fbae4cdd14e876053b0c5a"); @@ -340,7 +340,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"59c8e30c2022897987ea7b4394167b06"); + meili_snap::snapshot_hash!(format!("{:#?}", spells.settings()), @"ade154e63ab713de67919892917d3d9d"); let documents = spells.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"235016433dd04262c7f2da01d1e808ce"); diff --git a/index-scheduler/src/autobatcher.rs b/index-scheduler/src/autobatcher.rs index ad27b50ee..4d15992ab 100644 --- a/index-scheduler/src/autobatcher.rs +++ b/index-scheduler/src/autobatcher.rs @@ -59,7 +59,7 @@ impl From 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.") } diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 42c3a7867..bbd05365d 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -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 diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index 615b18d4e..c54558bab 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -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, }, diff --git a/index-scheduler/src/utils.rs b/index-scheduler/src/utils.rs index 007c0c065..45e26edeb 100644 --- a/index-scheduler/src/utils.rs +++ b/index-scheduler/src/utils.rs @@ -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 { diff --git a/meilisearch-http/src/routes/dump.rs b/meilisearch-http/src/routes/dump.rs index 1d02b675c..1148cdcb6 100644 --- a/meilisearch-http/src/routes/dump.rs +++ b/meilisearch-http/src/routes/dump.rs @@ -33,7 +33,7 @@ pub async fn create_dump( )) .unwrap(); - let task = KindWithContent::DumpExport { + let task = KindWithContent::DumpCreation { keys: auth_controller.list_keys()?, instance_uid: analytics.instance_uid().cloned(), dump_uid, diff --git a/meilisearch-types/src/tasks.rs b/meilisearch-types/src/tasks.rs index 4b6705655..af23f8171 100644 --- a/meilisearch-types/src/tasks.rs +++ b/meilisearch-types/src/tasks.rs @@ -41,7 +41,7 @@ impl Task { use KindWithContent::*; match &self.kind { - DumpExport { .. } + DumpCreation { .. } | Snapshot | TaskCancelation { .. } | TaskDeletion { .. } @@ -76,7 +76,7 @@ impl Task { | KindWithContent::IndexSwap { .. } | KindWithContent::TaskCancelation { .. } | KindWithContent::TaskDeletion { .. } - | KindWithContent::DumpExport { .. } + | KindWithContent::DumpCreation { .. } | KindWithContent::Snapshot => None, } } @@ -128,7 +128,7 @@ pub enum KindWithContent { query: String, tasks: RoaringBitmap, }, - DumpExport { + DumpCreation { dump_uid: String, keys: Vec, instance_uid: Option, @@ -149,7 +149,7 @@ impl KindWithContent { KindWithContent::IndexSwap { .. } => Kind::IndexSwap, KindWithContent::TaskCancelation { .. } => Kind::TaskCancelation, KindWithContent::TaskDeletion { .. } => Kind::TaskDeletion, - KindWithContent::DumpExport { .. } => Kind::DumpExport, + KindWithContent::DumpCreation { .. } => Kind::DumpCreation, KindWithContent::Snapshot => Kind::Snapshot, } } @@ -158,7 +158,7 @@ impl KindWithContent { use KindWithContent::*; match self { - DumpExport { .. } | Snapshot | TaskCancelation { .. } | TaskDeletion { .. } => None, + DumpCreation { .. } | Snapshot | TaskCancelation { .. } | TaskDeletion { .. } => None, DocumentAdditionOrUpdate { index_uid, .. } | DocumentDeletion { index_uid, .. } | DocumentClear { index_uid } @@ -217,7 +217,7 @@ impl KindWithContent { deleted_tasks: None, original_query: query.clone(), }), - KindWithContent::DumpExport { .. } => None, + KindWithContent::DumpCreation { .. } => None, KindWithContent::Snapshot => None, } } @@ -260,7 +260,7 @@ impl KindWithContent { deleted_tasks: Some(0), original_query: query.clone(), }), - KindWithContent::DumpExport { .. } => None, + KindWithContent::DumpCreation { .. } => None, KindWithContent::Snapshot => None, } } @@ -298,7 +298,7 @@ impl From<&KindWithContent> for Option
{ deleted_tasks: None, original_query: query.clone(), }), - KindWithContent::DumpExport { dump_uid, .. } => { + KindWithContent::DumpCreation { dump_uid, .. } => { Some(Details::Dump { dump_uid: dump_uid.clone() }) } KindWithContent::Snapshot => None, @@ -370,7 +370,7 @@ pub enum Kind { IndexSwap, TaskCancelation, TaskDeletion, - DumpExport, + DumpCreation, Snapshot, } @@ -395,7 +395,7 @@ impl FromStr for Kind { } else if kind.eq_ignore_ascii_case("taskDeletion") { Ok(Kind::TaskDeletion) } else if kind.eq_ignore_ascii_case("dumpCreation") { - Ok(Kind::DumpExport) + Ok(Kind::DumpCreation) } else { Err(ResponseError::from_msg( format!(