Skip to content

Commit

Permalink
deps: update opendal to 0.46 and refactor accordingly (#225)
Browse files Browse the repository at this point in the history
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
  • Loading branch information
aawsome and simonsan authored May 14, 2024
1 parent 3eeb42f commit 1c4a82d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ tokio = { version = "1.36.0", optional = true, default-features = false }

[target.'cfg(not(windows))'.dependencies]
# opendal backend - sftp is not supported on windows, see https://github.com/apache/incubator-opendal/issues/2963
opendal = { version = "0.45", features = ["services-b2", "services-sftp", "services-swift", "layers-blocking", "layers-throttle"], optional = true }
opendal = { version = "0.46", features = ["services-b2", "services-sftp", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true }

[target.'cfg(windows)'.dependencies]
# opendal backend
opendal = { version = "0.45", features = ["services-b2", "services-swift", "layers-blocking", "layers-throttle"], optional = true }
opendal = { version = "0.46", features = ["services-b2", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true }

[dev-dependencies]
rstest = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/backend/src/opendal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl ReadBackend for OpenDALBackend {
fn read_full(&self, tpe: FileType, id: &Id) -> Result<Bytes> {
trace!("reading tpe: {tpe:?}, id: {id}");

Ok(self.operator.read(&self.path(tpe, id))?.into())
Ok(self.operator.read(&self.path(tpe, id))?.to_bytes())
}

fn read_partial(
Expand All @@ -231,7 +231,7 @@ impl ReadBackend for OpenDALBackend {
.read_with(&self.path(tpe, id))
.range(range)
.call()?
.into())
.to_bytes())
}
}

Expand Down

0 comments on commit 1c4a82d

Please sign in to comment.