mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-25 19:45:05 +08:00
greatly reduce the number of warnings
This commit is contained in:
parent
38e4ffe73c
commit
b816535e33
@ -88,7 +88,7 @@ impl BatchKind {
|
||||
}
|
||||
|
||||
/// 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) {
|
||||
// We don't batch any of these operations
|
||||
(
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
autobatcher::BatchKind,
|
||||
task::{KindWithContent, Status},
|
||||
Error, IndexScheduler, Result, TaskId,
|
||||
Error, IndexScheduler, Result,
|
||||
};
|
||||
use index::{Settings, Unchecked};
|
||||
use milli::{
|
||||
@ -43,13 +43,13 @@ impl IndexScheduler {
|
||||
batch: BatchKind,
|
||||
) -> Result<Option<Batch>> {
|
||||
match batch {
|
||||
BatchKind::DocumentClear { ids } => todo!(),
|
||||
BatchKind::DocumentAddition { addition_ids } => todo!(),
|
||||
BatchKind::DocumentUpdate { update_ids } => todo!(),
|
||||
BatchKind::DocumentDeletion { deletion_ids } => todo!(),
|
||||
BatchKind::DocumentClear { ids: _ } => todo!(),
|
||||
BatchKind::DocumentAddition { addition_ids: _ } => todo!(),
|
||||
BatchKind::DocumentUpdate { update_ids: _ } => todo!(),
|
||||
BatchKind::DocumentDeletion { deletion_ids: _ } => todo!(),
|
||||
BatchKind::ClearAndSettings {
|
||||
other,
|
||||
settings_ids,
|
||||
other: _,
|
||||
settings_ids: _,
|
||||
} => todo!(),
|
||||
BatchKind::SettingsAndDocumentAddition {
|
||||
addition_ids,
|
||||
@ -104,15 +104,15 @@ impl IndexScheduler {
|
||||
}))
|
||||
}
|
||||
BatchKind::SettingsAndDocumentUpdate {
|
||||
update_ids,
|
||||
settings_ids,
|
||||
update_ids: _,
|
||||
settings_ids: _,
|
||||
} => todo!(),
|
||||
BatchKind::Settings { settings_ids } => todo!(),
|
||||
BatchKind::IndexCreation { id } => todo!(),
|
||||
BatchKind::IndexDeletion { ids } => todo!(),
|
||||
BatchKind::IndexUpdate { id } => todo!(),
|
||||
BatchKind::IndexSwap { id } => todo!(),
|
||||
BatchKind::IndexRename { id } => todo!(),
|
||||
BatchKind::Settings { settings_ids: _ } => todo!(),
|
||||
BatchKind::IndexCreation { id: _ } => todo!(),
|
||||
BatchKind::IndexDeletion { ids: _ } => todo!(),
|
||||
BatchKind::IndexUpdate { id: _ } => todo!(),
|
||||
BatchKind::IndexSwap { id: _ } => todo!(),
|
||||
BatchKind::IndexRename { id: _ } => todo!(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ impl IndexScheduler {
|
||||
// matter.
|
||||
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
|
||||
.into_iter()
|
||||
@ -185,18 +185,18 @@ impl IndexScheduler {
|
||||
Batch::Snapshot(_) => todo!(),
|
||||
Batch::Dump(_) => todo!(),
|
||||
Batch::DocumentAddition {
|
||||
index_uid,
|
||||
primary_key,
|
||||
content_files,
|
||||
tasks,
|
||||
index_uid: _,
|
||||
primary_key: _,
|
||||
content_files: _,
|
||||
tasks: _,
|
||||
} => todo!(),
|
||||
Batch::SettingsAndDocumentAddition {
|
||||
index_uid,
|
||||
primary_key,
|
||||
content_files,
|
||||
document_addition_tasks,
|
||||
settings,
|
||||
settings_tasks,
|
||||
settings: _,
|
||||
settings_tasks: _,
|
||||
} => {
|
||||
let index = self.index_mapper.create_index(wtxn, &index_uid)?;
|
||||
let mut updated_tasks = Vec::new();
|
||||
|
@ -5,25 +5,25 @@ mod index_mapper;
|
||||
pub mod task;
|
||||
mod utils;
|
||||
|
||||
use batch::Batch;
|
||||
|
||||
pub use error::Error;
|
||||
use file_store::FileStore;
|
||||
use index::Index;
|
||||
use index_mapper::IndexMapper;
|
||||
use synchronoise::SignalEvent;
|
||||
pub use task::Task;
|
||||
use task::{Kind, KindWithContent, Status};
|
||||
use time::OffsetDateTime;
|
||||
use uuid::Uuid;
|
||||
use task::{Kind, Status};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
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 roaring::RoaringBitmap;
|
||||
use serde::Deserialize;
|
||||
@ -80,7 +80,7 @@ pub struct IndexScheduler {
|
||||
impl IndexScheduler {
|
||||
pub fn new() -> Self {
|
||||
// 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!()
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ impl IndexScheduler {
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let mut batch = match self.create_next_batch(&wtxn) {
|
||||
let batch = match self.create_next_batch(&wtxn) {
|
||||
Ok(Some(batch)) => batch,
|
||||
Ok(None) => continue,
|
||||
Err(e) => {
|
||||
@ -194,7 +194,7 @@ impl IndexScheduler {
|
||||
// 2. update the tasks with a starting date *but* do not write anything on disk
|
||||
|
||||
// 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
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use index::{Settings, Unchecked};
|
||||
use milli::update::IndexDocumentsMethod;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::PathBuf;
|
||||
use time::OffsetDateTime;
|
||||
|
Loading…
Reference in New Issue
Block a user