Skip to content

Commit

Permalink
feat(io): Implement base IO Module (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
devillove084 authored Aug 17, 2024
1 parent d1c4fd2 commit 8a2ea68
Show file tree
Hide file tree
Showing 8 changed files with 646 additions and 69 deletions.
11 changes: 11 additions & 0 deletions crates/paimon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@ edition.workspace = true
license.workspace = true
version.workspace = true

[features]
default = ["storage-memory", "storage-fs"]
storage-all = ["storage-memory", "storage-fs"]

storage-memory = ["opendal/services-memory"]
storage-fs = ["opendal/services-fs"]

[dependencies]
url = "2.5.2"
async-trait = "0.1.81"
bytes = "1.7.1"
bitflags = "2.6.0"
tokio = { version = "1.39.2", features = ["macros"] }
chrono = { version = "0.4.38", features = ["serde"] }
serde = { version = "1", features = ["derive"] }
serde_bytes = "0.11.15"
Expand Down
20 changes: 20 additions & 0 deletions crates/paimon/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,24 @@ pub enum Error {
message: String,
source: opendal::Error,
},
#[snafu(
visibility(pub(crate)),
display("Paimon hitting unsupported io error {}", message)
)]
IoUnsupported { message: String },
#[snafu(
visibility(pub(crate)),
display("Paimon hitting invalid config: {}", message)
)]
ConfigInvalid { message: String },
}

impl From<opendal::Error> for Error {
fn from(source: opendal::Error) -> Self {
// TODO: Simple use IoUnexpected for now
Error::IoUnexpected {
message: "IO operation failed on underlying storage".to_string(),
source,
}
}
}
Loading

0 comments on commit 8a2ea68

Please sign in to comment.