Moving to heed v0.5.0

This commit is contained in:
Clément Renault 2019-11-04 10:49:27 +01:00
parent 6b326a45d7
commit 2a50e08bb8
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
6 changed files with 18 additions and 18 deletions

View File

@ -12,7 +12,7 @@ crossbeam-channel = "0.3.9"
deunicode = "1.0.0" deunicode = "1.0.0"
env_logger = "0.7.0" env_logger = "0.7.0"
hashbrown = { version = "0.6.0", features = ["serde"] } hashbrown = { version = "0.6.0", features = ["serde"] }
heed = "0.3.1" heed = "0.5.0"
log = "0.4.8" log = "0.4.8"
meilidb-schema = { path = "../meilidb-schema", version = "0.6.0" } meilidb-schema = { path = "../meilidb-schema", version = "0.6.0" }
meilidb-tokenizer = { path = "../meilidb-tokenizer", version = "0.6.0" } meilidb-tokenizer = { path = "../meilidb-tokenizer", version = "0.6.0" }

View File

@ -46,7 +46,7 @@ fn update_awaiter(receiver: Receiver<()>, env: heed::Env, update_fn: Arc<ArcSwap
} }
}; };
let mut nested_writer = match unsafe { env.nested_write_txn(&writer) } { let mut nested_writer = match env.nested_write_txn(&mut writer) {
Ok(writer) => writer, Ok(writer) => writer,
Err(e) => { Err(e) => {
error!("LMDB nested write transaction begin failed: {}", e); error!("LMDB nested write transaction begin failed: {}", e);

View File

@ -7,8 +7,8 @@ use crate::{DocumentId, RankedMap};
use super::{ConvertToNumber, ConvertToString, Indexer, SerializerError}; use super::{ConvertToNumber, ConvertToString, Indexer, SerializerError};
pub struct Serializer<'a> { pub struct Serializer<'a, 'b> {
pub txn: &'a mut heed::RwTxn, pub txn: &'a mut heed::RwTxn<'b>,
pub schema: &'a Schema, pub schema: &'a Schema,
pub document_store: DocumentsFields, pub document_store: DocumentsFields,
pub document_fields_counts: DocumentsFieldsCounts, pub document_fields_counts: DocumentsFieldsCounts,
@ -17,15 +17,15 @@ pub struct Serializer<'a> {
pub document_id: DocumentId, pub document_id: DocumentId,
} }
impl<'a> ser::Serializer for Serializer<'a> { impl<'a, 'b> ser::Serializer for Serializer<'a, 'b> {
type Ok = (); type Ok = ();
type Error = SerializerError; type Error = SerializerError;
type SerializeSeq = ser::Impossible<Self::Ok, Self::Error>; type SerializeSeq = ser::Impossible<Self::Ok, Self::Error>;
type SerializeTuple = ser::Impossible<Self::Ok, Self::Error>; type SerializeTuple = ser::Impossible<Self::Ok, Self::Error>;
type SerializeTupleStruct = ser::Impossible<Self::Ok, Self::Error>; type SerializeTupleStruct = ser::Impossible<Self::Ok, Self::Error>;
type SerializeTupleVariant = ser::Impossible<Self::Ok, Self::Error>; type SerializeTupleVariant = ser::Impossible<Self::Ok, Self::Error>;
type SerializeMap = MapSerializer<'a>; type SerializeMap = MapSerializer<'a, 'b>;
type SerializeStruct = StructSerializer<'a>; type SerializeStruct = StructSerializer<'a, 'b>;
type SerializeStructVariant = ser::Impossible<Self::Ok, Self::Error>; type SerializeStructVariant = ser::Impossible<Self::Ok, Self::Error>;
forward_to_unserializable_type! { forward_to_unserializable_type! {
@ -190,8 +190,8 @@ impl<'a> ser::Serializer for Serializer<'a> {
} }
} }
pub struct MapSerializer<'a> { pub struct MapSerializer<'a, 'b> {
txn: &'a mut heed::RwTxn, txn: &'a mut heed::RwTxn<'b>,
schema: &'a Schema, schema: &'a Schema,
document_id: DocumentId, document_id: DocumentId,
document_store: DocumentsFields, document_store: DocumentsFields,
@ -201,7 +201,7 @@ pub struct MapSerializer<'a> {
current_key_name: Option<String>, current_key_name: Option<String>,
} }
impl<'a> ser::SerializeMap for MapSerializer<'a> { impl<'a, 'b> ser::SerializeMap for MapSerializer<'a, 'b> {
type Ok = (); type Ok = ();
type Error = SerializerError; type Error = SerializerError;
@ -253,8 +253,8 @@ impl<'a> ser::SerializeMap for MapSerializer<'a> {
} }
} }
pub struct StructSerializer<'a> { pub struct StructSerializer<'a, 'b> {
txn: &'a mut heed::RwTxn, txn: &'a mut heed::RwTxn<'b>,
schema: &'a Schema, schema: &'a Schema,
document_id: DocumentId, document_id: DocumentId,
document_store: DocumentsFields, document_store: DocumentsFields,
@ -263,7 +263,7 @@ pub struct StructSerializer<'a> {
ranked_map: &'a mut RankedMap, ranked_map: &'a mut RankedMap,
} }
impl<'a> ser::SerializeStruct for StructSerializer<'a> { impl<'a, 'b> ser::SerializeStruct for StructSerializer<'a, 'b> {
type Ok = (); type Ok = ();
type Error = SerializerError; type Error = SerializerError;

View File

@ -77,8 +77,8 @@ pub fn push_documents_addition<D: serde::Serialize>(
Ok(last_update_id) Ok(last_update_id)
} }
pub fn apply_documents_addition( pub fn apply_documents_addition<'a, 'b>(
writer: &mut heed::RwTxn, writer: &'a mut heed::RwTxn<'b>,
main_store: store::Main, main_store: store::Main,
documents_fields_store: store::DocumentsFields, documents_fields_store: store::DocumentsFields,
documents_fields_counts_store: store::DocumentsFieldsCounts, documents_fields_counts_store: store::DocumentsFieldsCounts,

View File

@ -149,8 +149,8 @@ pub fn next_update_id(
Ok(new_update_id) Ok(new_update_id)
} }
pub fn update_task( pub fn update_task<'a, 'b>(
writer: &mut heed::RwTxn, writer: &'a mut heed::RwTxn<'b>,
index: store::Index, index: store::Index,
update_id: u64, update_id: u64,
update: Update, update: Update,

View File

@ -13,7 +13,7 @@ chrono = { version = "0.4.9", features = ["serde"] }
crossbeam-channel = "0.3.9" crossbeam-channel = "0.3.9"
envconfig = "0.5.1" envconfig = "0.5.1"
envconfig_derive = "0.5.1" envconfig_derive = "0.5.1"
heed = "0.3.1" heed = "0.5.0"
http = "0.1.19" http = "0.1.19"
indexmap = { version = "1.3.0", features = ["serde-1"] } indexmap = { version = "1.3.0", features = ["serde-1"] }
jemallocator = "0.3.2" jemallocator = "0.3.2"