Skip to content
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

HDDS-6440. Handle custom metadata (x-amz-meta) during put-object through S3 API. #3200

Closed
wants to merge 11 commits into from

Conversation

avijayanhwx
Copy link
Contributor

What changes were proposed in this pull request?

Handle user defined metadata supplied through the s3 interface.
Reference - https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingObjects.html

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-6440

How was this patch tested?

Manually tested put, head and copy object.
Added acceptance tests.

this.bucketName = bucketName;
this.name = keyName;
this.dataSize = size;
this.creationTime = Instant.ofEpochMilli(creationTime);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be set by OM?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, nesting the constructors would help reduce code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking into it

@kerneltime
Copy link
Contributor

LGTM except for a couple of changes. I think limits are important here. Also, a minor nit.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @avijayanhwx for working on this. Looks good, except the minor duplication in constructor.

Note that keys in GDPR-enabled buckets are shown by ozone sh key info with metadata gdprEnabled: true. With this patch it is possible to set the same metadata on normal keys, which can be confusing.

  "metadata" : {
    "gdprEnabled" : "true"
  },

Comment on lines 84 to 87
public OzoneKey(String volumeName, String bucketName,
String keyName, long size, long creationTime,
long modificationTime, ReplicationType type,
int replicationFactor, Map<String, String> metadata) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can omit this constructor (with type and factor), it should be deprecated in favor of ReplicationConfig right away.

Comment on lines 121 to 127
this.volumeName = volumeName;
this.bucketName = bucketName;
this.name = keyName;
this.dataSize = size;
this.creationTime = Instant.ofEpochMilli(creationTime);
this.modificationTime = Instant.ofEpochMilli(modificationTime);
this.replicationConfig = replicationConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.volumeName = volumeName;
this.bucketName = bucketName;
this.name = keyName;
this.dataSize = size;
this.creationTime = Instant.ofEpochMilli(creationTime);
this.modificationTime = Instant.ofEpochMilli(modificationTime);
this.replicationConfig = replicationConfig;
this(volumeName, bucketName, keyName, size, creationTime,
modificationTime, replicationConfig);

@avijayanhwx
Copy link
Contributor Author

Thanks for the review, will address them!

@ChenSammi
Copy link
Contributor

Hey @avijayanhwx, would you like to rebase the patch against the master?

@adoroszlai
Copy link
Contributor

/pending

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this issue as un-mergeable as requested.

Please use /ready comment when it's resolved.

Please note that the PR will be closed after 21 days of inactivity from now. (But can be re-opened anytime later...)

/pending

@github-actions
Copy link

github-actions bot commented Aug 9, 2022

Thank you very much for the patch. I am closing this PR temporarily as there was no activity recently and it is waiting for response from its author.

It doesn't mean that this PR is not important or ignored: feel free to reopen the PR at any time.

It only means that attention of committers is not required. We prefer to keep the review queue clean. This ensures PRs in need of review are more visible, which results in faster feedback for all PRs.

If you need ANY help to finish this PR, please contact the community on the mailing list or the slack channel."

@github-actions github-actions bot closed this Aug 9, 2022
@kerneltime
Copy link
Contributor

@DaveTeng0 can you pick this one up?

@DaveTeng0
Copy link
Contributor

cc. kerneltime, adoroszlai Hey guys! I sync this branch with latest master and resolved all the merge conflicts in another PR. Please feel free to take a look at it if it's good and let me know any issue!
Thanks!

@kerneltime kerneltime closed this Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants