Skip to content

Commit

Permalink
refactor: update fusio & use DynWrite in wal instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ethe committed Nov 11, 2024
1 parent 583c335 commit 25b0389
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.idea
Cargo.lock
db_path
bindings/python/target
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ crc32fast = "1"
crossbeam-skiplist = "0.1"
datafusion = { version = "42", optional = true }
flume = { version = "0.11", features = ["async"] }
fusio = { package = "fusio", version = "0.3.1", features = [
fusio = { package = "fusio", version = "0.3.3", features = [
"aws",
"dyn",
"fs",
Expand Down
3 changes: 3 additions & 0 deletions bindings/python/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub enum FsOptions {
region: Option<String>,
sign_payload: Option<bool>,
checksum: Option<bool>,
endpoint: Option<String>,
},
}

Expand All @@ -56,12 +57,14 @@ impl From<FsOptions> for fusio_dispatch::FsOptions {
region,
sign_payload,
checksum,
endpoint,
} => fusio_dispatch::FsOptions::S3 {
bucket,
credential: credential.map(fusio::remotes::aws::AwsCredential::from),
region,
sign_payload,
checksum,
endpoint,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.80.0"
channel = "1.82"
components = ["clippy", "rust-analyzer", "rustfmt"]
6 changes: 3 additions & 3 deletions src/inmem/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crossbeam_skiplist::{
map::{Entry, Range},
SkipMap,
};
use fusio::{buffered::BufWriter, dynamic::DynFile, DynFs};
use fusio::{buffered::BufWriter, DynFs, DynWrite};
use ulid::Ulid;

use crate::{
Expand Down Expand Up @@ -37,7 +37,7 @@ where
R: Record,
{
pub(crate) data: SkipMap<Timestamped<R::Key>, Option<R>>,
wal: Option<Mutex<WalFile<Box<dyn DynFile>, R>>>,
wal: Option<Mutex<WalFile<Box<dyn DynWrite>, R>>>,
pub(crate) trigger: Arc<Box<dyn Trigger<R> + Send + Sync>>,
}

Expand All @@ -61,7 +61,7 @@ where
)
.await?,
option.wal_buffer_size,
)) as Box<dyn DynFile>;
)) as Box<dyn DynWrite>;

wal = Some(Mutex::new(WalFile::new(file, file_id)));
};
Expand Down
2 changes: 1 addition & 1 deletion src/wal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<F, R> WalFile<F, R> {

impl<F, R> WalFile<F, R>
where
F: Write + Unpin + Send,
F: Write + Send,
R: Record,
{
pub(crate) async fn write<'r>(
Expand Down

0 comments on commit 25b0389

Please sign in to comment.