greatly reduce the number of warnings

This commit is contained in:
Tamo 2022-09-14 13:13:44 +02:00 committed by Clément Renault
parent 38e4ffe73c
commit b816535e33
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
4 changed files with 37 additions and 37 deletions

View File

@ -88,7 +88,7 @@ impl BatchKind {
} }
/// Return true if you must stop. /// Return true if you must stop.
fn accumulate(mut self, id: TaskId, kind: Kind) -> ControlFlow<Self, Self> { fn accumulate(self, id: TaskId, kind: Kind) -> ControlFlow<Self, Self> {
match (self, kind) { match (self, kind) {
// We don't batch any of these operations // We don't batch any of these operations
( (

View File

@ -1,7 +1,7 @@
use crate::{ use crate::{
autobatcher::BatchKind, autobatcher::BatchKind,
task::{KindWithContent, Status}, task::{KindWithContent, Status},
Error, IndexScheduler, Result, TaskId, Error, IndexScheduler, Result,
}; };
use index::{Settings, Unchecked}; use index::{Settings, Unchecked};
use milli::{ use milli::{
@ -43,13 +43,13 @@ impl IndexScheduler {
batch: BatchKind, batch: BatchKind,
) -> Result<Option<Batch>> { ) -> Result<Option<Batch>> {
match batch { match batch {
BatchKind::DocumentClear { ids } => todo!(), BatchKind::DocumentClear { ids: _ } => todo!(),
BatchKind::DocumentAddition { addition_ids } => todo!(), BatchKind::DocumentAddition { addition_ids: _ } => todo!(),
BatchKind::DocumentUpdate { update_ids } => todo!(), BatchKind::DocumentUpdate { update_ids: _ } => todo!(),
BatchKind::DocumentDeletion { deletion_ids } => todo!(), BatchKind::DocumentDeletion { deletion_ids: _ } => todo!(),
BatchKind::ClearAndSettings { BatchKind::ClearAndSettings {
other, other: _,
settings_ids, settings_ids: _,
} => todo!(), } => todo!(),
BatchKind::SettingsAndDocumentAddition { BatchKind::SettingsAndDocumentAddition {
addition_ids, addition_ids,
@ -104,15 +104,15 @@ impl IndexScheduler {
})) }))
} }
BatchKind::SettingsAndDocumentUpdate { BatchKind::SettingsAndDocumentUpdate {
update_ids, update_ids: _,
settings_ids, settings_ids: _,
} => todo!(), } => todo!(),
BatchKind::Settings { settings_ids } => todo!(), BatchKind::Settings { settings_ids: _ } => todo!(),
BatchKind::IndexCreation { id } => todo!(), BatchKind::IndexCreation { id: _ } => todo!(),
BatchKind::IndexDeletion { ids } => todo!(), BatchKind::IndexDeletion { ids: _ } => todo!(),
BatchKind::IndexUpdate { id } => todo!(), BatchKind::IndexUpdate { id: _ } => todo!(),
BatchKind::IndexSwap { id } => todo!(), BatchKind::IndexSwap { id: _ } => todo!(),
BatchKind::IndexRename { id } => todo!(), BatchKind::IndexRename { id: _ } => todo!(),
} }
} }
@ -158,7 +158,7 @@ impl IndexScheduler {
// matter. // matter.
let index_name = task.indexes().unwrap()[0]; let index_name = task.indexes().unwrap()[0];
let index = self.get_index(rtxn, &index_name)? & enqueued; let _index = self.get_index(rtxn, &index_name)? & enqueued;
let enqueued = enqueued let enqueued = enqueued
.into_iter() .into_iter()
@ -185,18 +185,18 @@ impl IndexScheduler {
Batch::Snapshot(_) => todo!(), Batch::Snapshot(_) => todo!(),
Batch::Dump(_) => todo!(), Batch::Dump(_) => todo!(),
Batch::DocumentAddition { Batch::DocumentAddition {
index_uid, index_uid: _,
primary_key, primary_key: _,
content_files, content_files: _,
tasks, tasks: _,
} => todo!(), } => todo!(),
Batch::SettingsAndDocumentAddition { Batch::SettingsAndDocumentAddition {
index_uid, index_uid,
primary_key, primary_key,
content_files, content_files,
document_addition_tasks, document_addition_tasks,
settings, settings: _,
settings_tasks, settings_tasks: _,
} => { } => {
let index = self.index_mapper.create_index(wtxn, &index_uid)?; let index = self.index_mapper.create_index(wtxn, &index_uid)?;
let mut updated_tasks = Vec::new(); let mut updated_tasks = Vec::new();

View File

@ -5,25 +5,25 @@ mod index_mapper;
pub mod task; pub mod task;
mod utils; mod utils;
use batch::Batch;
pub use error::Error; pub use error::Error;
use file_store::FileStore; use file_store::FileStore;
use index::Index; use index::Index;
use index_mapper::IndexMapper; use index_mapper::IndexMapper;
use synchronoise::SignalEvent; use synchronoise::SignalEvent;
pub use task::Task; pub use task::Task;
use task::{Kind, KindWithContent, Status}; use task::{Kind, Status};
use time::OffsetDateTime;
use uuid::Uuid;
use std::collections::hash_map::Entry;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc; use std::sync::Arc;
use std::{collections::HashMap, sync::RwLock}; use std::{sync::RwLock};
use milli::heed::types::{OwnedType, SerdeBincode, Str};
use milli::heed::{Database, Env};
use milli::heed::types::{DecodeIgnore, OwnedType, SerdeBincode, Str};
use milli::heed::{Database, Env, EnvOpenOptions, RoTxn, RwTxn};
use milli::update::{IndexDocumentsMethod, IndexerConfig};
use milli::{RoaringBitmapCodec, BEU32}; use milli::{RoaringBitmapCodec, BEU32};
use roaring::RoaringBitmap; use roaring::RoaringBitmap;
use serde::Deserialize; use serde::Deserialize;
@ -80,7 +80,7 @@ pub struct IndexScheduler {
impl IndexScheduler { impl IndexScheduler {
pub fn new() -> Self { pub fn new() -> Self {
// we want to start the loop right away in case meilisearch was ctrl+Ced while processing things // we want to start the loop right away in case meilisearch was ctrl+Ced while processing things
let wake_up = SignalEvent::auto(true); let _wake_up = SignalEvent::auto(true);
todo!() todo!()
} }
@ -182,7 +182,7 @@ impl IndexScheduler {
continue; continue;
} }
}; };
let mut batch = match self.create_next_batch(&wtxn) { let batch = match self.create_next_batch(&wtxn) {
Ok(Some(batch)) => batch, Ok(Some(batch)) => batch,
Ok(None) => continue, Ok(None) => continue,
Err(e) => { Err(e) => {
@ -194,7 +194,7 @@ impl IndexScheduler {
// 2. update the tasks with a starting date *but* do not write anything on disk // 2. update the tasks with a starting date *but* do not write anything on disk
// 3. process the tasks // 3. process the tasks
let res = self.process_batch(&mut wtxn, batch); let _res = self.process_batch(&mut wtxn, batch);
// 4. store the updated tasks on disk // 4. store the updated tasks on disk

View File

@ -1,6 +1,6 @@
use anyhow::Result; use anyhow::Result;
use index::{Settings, Unchecked}; use index::{Settings, Unchecked};
use milli::update::IndexDocumentsMethod;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::path::PathBuf; use std::path::PathBuf;
use time::OffsetDateTime; use time::OffsetDateTime;