From 33070682dcf1ec0bf9b22cd2ea38cf983a628f7d Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 17 Jun 2020 23:06:09 -0400 Subject: bump the version of libaio-futures --- Cargo.lock | 10 +++++----- Cargo.toml | 6 +++--- src/lib.rs | 15 +++++++-------- src/wal.rs | 10 ++++++++-- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96962a3..a85b950 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -232,7 +232,7 @@ dependencies = [ [[package]] name = "growth-ring" -version = "0.1.2" +version = "0.1.3" dependencies = [ "async-trait", "crc", @@ -281,9 +281,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libaio-futures" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e831955e07aa19f495c993327d647d6a49bc9e5d6856238c00fd1833a1a06eee" +checksum = "e435ab17c42371feda64ba459de5a248980ba96c367c29d0c7c63ab6481fc563" dependencies = [ "crossbeam-channel", "libc", @@ -307,9 +307,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28e0c685219cd60e49a2796bba7e4fe6523e10daca4fd721e84e7f905093d60c" +checksum = "297efb9401445cf7b6986a583d7ac194023334b46b294ff7da0d36662c1251c2" dependencies = [ "hashbrown", ] diff --git a/Cargo.toml b/Cargo.toml index a8a82ef..c53eb7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "growth-ring" -version = "0.1.2" +version = "0.1.3" authors = ["Determinant "] edition = "2018" homepage = "https://github.com/Determinant/growth-ring" @@ -12,12 +12,12 @@ description = "Simple and modular write-ahead-logging implementation." [dependencies] crc = "1.8.1" -lru = "0.5.1" +lru = "0.5.2" scan_fmt = "0.2.5" regex = "1.3.9" async-trait = "0.1.35" futures = "0.3.5" -libaio-futures = "0.1.2" +libaio-futures = "0.1.4" nix = "0.17.0" libc = "0.2.71" diff --git a/src/lib.rs b/src/lib.rs index f7b3f73..45d4843 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,7 +50,7 @@ pub mod wal; use async_trait::async_trait; use futures::executor::block_on; -use libaiofut::{new_batch_scheduler, AIOBatchSchedulerIn, AIOManager}; +use libaiofut::{AIOBuilder, AIOManager}; use libc::off_t; use nix::fcntl::{fallocate, open, openat, FallocateFlags, OFlag}; use nix::sys::stat::Mode; @@ -62,14 +62,14 @@ use wal::{WALBytes, WALFile, WALPos, WALRingId, WALStore}; pub struct WALFileAIO { fd: RawFd, - aiomgr: Rc>, + aiomgr: Rc, } impl WALFileAIO { pub fn new( rootfd: RawFd, filename: &str, - aiomgr: Rc>, + aiomgr: Rc, ) -> Result { openat( rootfd, @@ -137,7 +137,7 @@ pub struct WALStoreAIO Result<(), ()>> { rootfd: RawFd, rootpath: String, recover_func: RefCell, - aiomgr: Rc>, + aiomgr: Rc, } impl Result<(), ()>> WALStoreAIO { @@ -145,14 +145,13 @@ impl Result<(), ()>> WALStoreAIO { wal_dir: &str, truncate: bool, recover_func: F, - aiomgr: Option>, + aiomgr: Option, ) -> Result { let recover_func = RefCell::new(recover_func); let rootpath = wal_dir.to_string(); let aiomgr = Rc::new(aiomgr.ok_or(Err(())).or_else( - |_: Result, ()>| { - AIOManager::new(new_batch_scheduler(None), 128, None, None) - .or(Err(())) + |_: Result| { + AIOBuilder::default().build().or(Err(())) }, )?); diff --git a/src/wal.rs b/src/wal.rs index f1a6e85..28831cd 100644 --- a/src/wal.rs +++ b/src/wal.rs @@ -574,8 +574,8 @@ pub struct WALLoader { recover_policy: RecoverPolicy, } -impl WALLoader { - pub fn new() -> Self { +impl Default for WALLoader { + fn default() -> Self { WALLoader { file_nbit: 22, // 4MB block_nbit: 15, // 32KB, @@ -583,6 +583,12 @@ impl WALLoader { recover_policy: RecoverPolicy::Strict } } +} + +impl WALLoader { + pub fn new() -> Self { + Default::default() + } pub fn file_nbit(&mut self, v: u8) -> &mut Self { self.file_nbit = v; -- cgit v1.2.3