feat: allow using object_store as opendal's backend#6283
feat: allow using object_store as opendal's backend#6283Xuanwo merged 62 commits intoapache:mainfrom
Conversation
|
Thanks a lot for building this, but I think it's better to be part of opendal's object_store integration instead of in opendal core. |
thank you for the feedback, let me move it there |
|
Give Github Copilot a chance. |
There was a problem hiding this comment.
Pull Request Overview
This PR integrates object_store as a custom backend for opendal, enabling users to leverage object_store’s advanced features (parallel fetching, chunking, caching) through the opendal interface.
- Introduce a new
backendmodule withObjectStoreBuilderandObjectStoreBackend. - Implement reader, writer, lister, deleter adapters and unified error mapping.
- Update
core/Cargo.tomlto add theservices-object-storefeature and optionalobject_storedependency.
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| integrations/object_store/src/lib.rs | Expose backend module and re-export builder & backend |
| integrations/object_store/src/backend/writer.rs | Add ObjectStoreWriter and parse_write_args |
| integrations/object_store/src/backend/reader.rs | Add ObjectStoreReader and parse_read_args |
| integrations/object_store/src/backend/lister.rs | Add ObjectStoreLister |
| integrations/object_store/src/backend/deleter.rs | Add ObjectStoreDeleter |
| integrations/object_store/src/backend/error.rs | Map object_store::Error variants to opendal::Error |
| integrations/object_store/src/backend/mod.rs | Wire up Builder and Access implementation |
| core/Cargo.toml | Register services-object-store and optional object_store dependency |
Comments suppressed due to low confidence (2)
integrations/object_store/src/backend/writer.rs:77
- There are no unit tests covering
parse_write_args. Consider adding tests to verify mapping ofOpWriteoptions (content_type, content_disposition, cache_control, user_metadata) intoPutOptions.
pub(crate) fn parse_write_args(args: &OpWrite) -> Result<PutOptions> {
integrations/object_store/src/backend/reader.rs:70
- The
parse_read_argsfunction isn't covered by tests. Adding unit tests for version, conditional headers, and range options would help ensure correct behavior across scenarios.
fn parse_read_args(args: &OpRead) -> Result<object_store::GetOptions> {
5d8c912 to
7495e59
Compare
5a2755f to
a6076c7
Compare
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you, I believe are are very close now!
| stat_with_if_match: true, | ||
| stat_with_if_unmodified_since: true, | ||
| read: true, | ||
| write: true, |
There was a problem hiding this comment.
object_store should support many memtadata, but it's fine to leave them in next PR.
| let writer = ObjectStoreWriter::new(self.store.clone(), path, args); | ||
| Ok(( | ||
| RpWrite::default(), | ||
| MultipartWriter::new(self.info(), writer, 10), |
There was a problem hiding this comment.
We could make concurrent configurable; that might be a nice improvement for the next PR.
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { |
There was a problem hiding this comment.
I wish we could integrate with opendal's test suites, but so far I haven't figured out how to make it work. It might be worth opening an issue.
|
|
||
| // Generate a proper ETag for the part based on its content | ||
| // This follows the pattern used by many object stores where ETags are MD5 hashes | ||
| let etag = calculate_part_etag(&bytes, part_number); |
There was a problem hiding this comment.
We don't need to do this, and it might be incorrect. Let's just return an empty string since it not used anyways.
…th consistent naming
594eaa6 to
89086e0
Compare
|
@Xuanwo sorry for the late response. i updated the PR with following the feedbacks. please take another look when you have time at your convenience qwq there're still some follow ups that might be in future prs:
|
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you for working on this!
Which issue does this PR close?
Closes #6171.
Rationale for this change
with allowing
object_storeas opendal's backend, we can leverage opendal's advanced operation like parallel fetching, chunking, caching for usersobject_store.What changes are included in this PR?
New Backend Implementation: Added complete
object_storebackend in src/backend/ with full CRUD operations.Are there any user-facing changes?
ObjectStoreBackendandObjectStoreBuilderfor creatingobject_store-based OpenDAL operatorsservices-object-storefeature flag to enable the backend