refactor!: Consolidate ObjectStore: rename & rename_if_not_exists => rename_opts#555
Conversation
Change the `ObjectStore` core trait to have a single, extensible rename operation. This helps apache#385 and apache#297. Also adds extensions similar to apache/arrow-rs#7170 and apache/arrow-rs#7213 . Also see apache#548 -- which did something similar for `copy`.
c874ee2 to
d9e7af3
Compare
rename & rename_if_not_exists => rename_optsObjectStore: rename & rename_if_not_exists => rename_opts
alamb
left a comment
There was a problem hiding this comment.
Makes sense to me -- thank you @crepererum
I found it interesting that the S3/Azure clients don't actually use the underlying rename APIs yet (the clients implement rename as copy then delete)
|
|
||
| impl Eq for CopyOptions {} | ||
|
|
||
| /// Configure preconditions for the target of rename operation. |
There was a problem hiding this comment.
I did some research about the names used in cloud providers
S3 uses the term If-None-Match for the "don't overwrite" method: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RenameObject.html
From what I can tell, GCP doesn't support an atoimic rename/overwrite operation. If you want to overwrite you have to delete the target first : https://docs.cloud.google.com/storage/docs/copying-renaming-moving-objects
Azure Blob Storage calls it "replace if exists", specifically https://learn.microsoft.com/en-us/rest/api/storageservices/rename-file x-ms-file-rename-replace-if-exists
So TLDR I think these options are well named and reflect the available capabilities 👍
Which issue does this PR close?
This helps #385 and #297.
Rationale for this change
Change the
ObjectStorecore trait to have a single, extensible copy operation.Also adds extensions similar to
apache/arrow-rs#7170
and
apache/arrow-rs#7213 .
Also see #548 for the same change that was made for
copy.What changes are included in this PR?
Interface change, see section below.
Are there any user-facing changes?
rename_optsalongsideRenameOptions&RenameModerename&rename_if_not_existsare moved toObjectStoreExt