Move the UpdateStore into the http-ui crate

This commit is contained in:
Kerollmops 2021-06-08 17:44:25 +02:00
parent 32cf5a29ce
commit 103dddba2f
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
6 changed files with 10 additions and 6 deletions

2
Cargo.lock generated
View File

@ -961,6 +961,7 @@ dependencies = [
"askama_warp", "askama_warp",
"byte-unit", "byte-unit",
"bytes 0.5.6", "bytes 0.5.6",
"crossbeam-channel",
"either", "either",
"flate2", "flate2",
"fst", "fst",
@ -1365,7 +1366,6 @@ dependencies = [
"bstr", "bstr",
"byteorder", "byteorder",
"chrono", "chrono",
"crossbeam-channel",
"csv", "csv",
"either", "either",
"flate2", "flate2",

View File

@ -8,6 +8,7 @@ edition = "2018"
[dependencies] [dependencies]
anyhow = "1.0.38" anyhow = "1.0.38"
byte-unit = { version = "4.0.9", default-features = false, features = ["std"] } byte-unit = { version = "4.0.9", default-features = false, features = ["std"] }
crossbeam-channel = "0.5.0"
grenad = { git = "https://github.com/Kerollmops/grenad.git", rev = "3adcb26" } grenad = { git = "https://github.com/Kerollmops/grenad.git", rev = "3adcb26" }
heed = "0.10.6" heed = "0.10.6"
meilisearch-tokenizer = { git = "https://github.com/meilisearch/Tokenizer.git", tag = "v0.2.2" } meilisearch-tokenizer = { git = "https://github.com/meilisearch/Tokenizer.git", tag = "v0.2.2" }

View File

@ -1,3 +1,5 @@
mod update_store;
use std::{io, mem}; use std::{io, mem};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::fmt::Display; use std::fmt::Display;
@ -29,10 +31,12 @@ use tokio::sync::broadcast;
use warp::{Filter, http::Response}; use warp::{Filter, http::Response};
use warp::filters::ws::Message; use warp::filters::ws::Message;
use milli::{FilterCondition, Index, MatchingWords, obkv_to_json, SearchResult, UpdateStore}; use milli::{FilterCondition, Index, MatchingWords, obkv_to_json, SearchResult};
use milli::update::{IndexDocumentsMethod, Setting, UpdateBuilder, UpdateFormat}; use milli::update::{IndexDocumentsMethod, Setting, UpdateBuilder, UpdateFormat};
use milli::update::UpdateIndexingStep::*; use milli::update::UpdateIndexingStep::*;
use self::update_store::UpdateStore;
static GLOBAL_THREAD_POOL: OnceCell<ThreadPool> = OnceCell::new(); static GLOBAL_THREAD_POOL: OnceCell<ThreadPool> = OnceCell::new();
#[derive(Debug, StructOpt)] #[derive(Debug, StructOpt)]

View File

@ -1,3 +1,5 @@
#![allow(unused)]
use std::path::Path; use std::path::Path;
use std::sync::Arc; use std::sync::Arc;
@ -6,7 +8,7 @@ use heed::types::{OwnedType, DecodeIgnore, SerdeJson, ByteSlice};
use heed::{EnvOpenOptions, Env, Database}; use heed::{EnvOpenOptions, Env, Database};
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
use crate::BEU64; pub type BEU64 = heed::zerocopy::U64<heed::byteorder::BE>;
#[derive(Clone)] #[derive(Clone)]
pub struct UpdateStore<M, N> { pub struct UpdateStore<M, N> {

View File

@ -9,7 +9,6 @@ anyhow = "1.0.38"
bstr = "0.2.15" bstr = "0.2.15"
byteorder = "1.4.2" byteorder = "1.4.2"
chrono = { version = "0.4.19", features = ["serde"] } chrono = { version = "0.4.19", features = ["serde"] }
crossbeam-channel = "0.5.0"
csv = "1.1.5" csv = "1.1.5"
either = "1.6.1" either = "1.6.1"
flate2 = "1.0.20" flate2 = "1.0.20"

View File

@ -4,7 +4,6 @@ mod criterion;
mod external_documents_ids; mod external_documents_ids;
mod fields_ids_map; mod fields_ids_map;
mod search; mod search;
mod update_store;
pub mod facet; pub mod facet;
pub mod heed_codec; pub mod heed_codec;
pub mod index; pub mod index;
@ -29,7 +28,6 @@ pub use self::heed_codec::{RoaringBitmapLenCodec, BoRoaringBitmapLenCodec, CboRo
pub use self::index::Index; pub use self::index::Index;
pub use self::search::{Search, FacetDistribution, FilterCondition, SearchResult, MatchingWords}; pub use self::search::{Search, FacetDistribution, FilterCondition, SearchResult, MatchingWords};
pub use self::tree_level::TreeLevel; pub use self::tree_level::TreeLevel;
pub use self::update_store::UpdateStore;
pub type FastMap4<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher32>>; pub type FastMap4<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher32>>;
pub type FastMap8<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher64>>; pub type FastMap8<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher64>>;