Skip to content

Commit

Permalink
Bump object_store to 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Jan 17, 2024
1 parent aabb29c commit 5423bc0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Bump `opendal` to 0.44
- Bump `object_store` to 0.9
- **Breaking** `async_store_chunk` and `AsyncWritableStorageTraits::set` now take `bytes::Bytes`
- `bytes::Bytes` are used by both supported async stores (`object_store` and `opendal`), and this avoids a copy

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ inventory = "0.3"
itertools = "0.12"
ndarray = { version = "0.15", optional = true }
num = { version = "0.4" }
object_store = { version = "0.8.0", optional = true }
object_store = { version = "0.9.0", optional = true }
opendal = { version = "0.44", optional = true }
parking_lot = "0.12"
pathdiff = "0.2"
Expand Down
14 changes: 13 additions & 1 deletion src/storage/store/store_async/object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,19 @@ impl<T: object_store::ObjectStore> AsyncReadableStorageTraits for AsyncObjectSto
.await;
match get_ranges {
Ok(get_ranges) => Ok(Some(
get_ranges.iter().map(|bytes| bytes.to_vec()).collect(),
std::iter::zip(ranges, get_ranges)
.map(|(range, bytes)| {
if range.len() == bytes.len() {
Ok(bytes.to_vec())
} else {
Err(StorageError::Other(format!(
"Unexpected length of bytes returned, expected {}, got {}",
range.len(),
bytes.len()
)))
}
})
.collect::<Result<_, StorageError>>()?,
)),
Err(err) => {
if matches!(err, object_store::Error::NotFound { .. }) {
Expand Down

0 comments on commit 5423bc0

Please sign in to comment.