-
Notifications
You must be signed in to change notification settings - Fork 401
feat!(io): Implement Storage for OpenDal #2080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| Ok(opendal::Reader::read(self, range).await?.to_bytes()) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to storage.rs, and will move this to iceberg-storage/opendal/ in the future, because this is opendal specific
| let _ = opendal::Writer::close(self).await?; | ||
| Ok(()) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, moved this to storage.rs, and will move this to iceberg-storage/opendal/ in the future, because this is opendal specific
| async fn close(&mut self) -> crate::Result<()> { | ||
| self.as_mut().close().await | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted this because we pass Box<dyn FileWrite> around and use boxed items directly.
I updated AsyncFileWriter accordingly
| let mut writer = self.writer().await?; | ||
| writer.write(bs).await?; | ||
| writer.close().await | ||
| self.storage.write(&self.path, bs).await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a minor behavior difference here. The new implementation calls Operator::write directly while the old one uses Writer::write and then explicitly closes it.
According to OpenDal's doc, the difference seems trivial
| format!("{relative_path}/") | ||
| }; | ||
| Ok(op.remove_all(&path).await?) | ||
| pub async fn delete_prefix(&self, path: impl AsRef<str>) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change, the method is renamed to delete_prefix
Which issue does this PR close?
What changes are included in this PR?
Wired
OpenDalwithStoragetrait.FileIOstill uses hardcodedOpenDalas of now so no customer facing behavior changesAre these changes tested?
No new tests added, rely on existing tests