Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(core/services-azblob): support user defined metadata #5274
feat(core/services-azblob): support user defined metadata #5274
Changes from 10 commits
23bb518
f645cc6
4c6476a
398efed
39e4d62
72e6e10
155bb1a
1927932
4282d5d
d28eae6
4d6057b
3228bd2
d76c46d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should the metadata parsing be done in two steps (first call
parse_into_metadata
and thenparse_prefixed_headers
) or should we add a newprefix: Optional<&str>
parameter to theparse_into_metadata
function and the prefixed headers parsing will be done there (and also themeta.with_user_metadata
call, as theparse_into_metadata
returns aMetadata
struct)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.
Hi, I tend to keep
parse_into_metadata
simple because not all services handle metadata and user metadata in the same way.As I mentioned before, OpenDAL tends to have more readable code. It's acceptable for us to have some duplicated code here and there. We can revisit this part when we have more similar code, rather than just two or three instances.
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 check is also done in the s3 backend.
Should we always call
meta.with_user_metadata(user_meta);
instead of checking if theuser_meta
is empty?Or can we for example, add that checking inside
meta.with_user_metadata(user_meta);
and do an early return if theuser_meta
hashmap is empty?opendal/core/src/types/metadata.rs
Line 524 in 1927932
I find that checking in each backend if the hashmap is empty is error-prone boilerplate...
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.
It's fine to have such a check. OpenDAL tends to have more readable code because we have many services, and that code is rarely modified.
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'm setting the metadata headers only for the
azblob_put_blob_request
.Should this also be done for
block
requests, for example, inazblob_put_block_request
? Or the metadata will be only supported forblobs
?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 see that in
OSS
the metadata headers is also set for theappend_object_request
. Should the azure append blob requests also send these headers?azblob_append_blob_request
,azblob_init_appendable_blob_request
, etc..?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.
Not sure for now; I will need some time to delve into the documentation.
I remember that only the first append request can include user metadata, but I'm not sure about that. Feel free to do more research on this.
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.
Changed this in order to be consistent with what I did in the azure part. It is more idiomatic to use string interpolation