Repository navigation
Add ability to set metadata for object uploads in transfer library. - #76
Conversation
There was a problem hiding this comment.
I'd like for the map to be in the function call instead of in this object. This object does not contain any other s3 object specific data; it is a handle for callbacks and status checks etc...
Also, when you do so, be sure to handle r-values instead of just a copy.
There was a problem hiding this comment.
Ok that makes sense, thanks for the review. I was wondering if I should go that route but there are many other request properties available in a PutObjectRequest/CreateMultipartUploadRequest that are yet to be implemented here (cache control, content encoding, request payer, etc) and this would be an api breaking change each time unless we did function overloading for UploadFile. Would that be acceptable or we're ok changing the function signature each time to add a new property?
There was a problem hiding this comment.
Two overloads should work. Leave the original, then add one with the map as
const ref, then another as an r-value.
On Jan 12, 2016 10:43 AM, "kahkeng" [email protected] wrote:
In aws-cpp-sdk-transfer/include/aws/transfer/UploadFileRequest.h
#76 (comment):@@ -126,6 +126,11 @@ class AWS_TRANSFER_API UploadFileRequest : public S3FileRequest, public std::ena
bool HasPassedGetObject() const { return m_getObjectPassed.load(); }
bool HasPassedListObjects() const { return m_listObjectsPassed.load(); }
- // A map of metadata to store with the object in S3.
Ok that makes sense, thanks for the review. I was wondering if I should go
that route but there are many other request properties available in a
PutObjectRequest that are yet to be implemented here (cache control,
content encoding, request payer, etc) and this would be an api breaking
change each time unless we did function overloading for UploadFile. Would
that be acceptable or we're ok changing the function signature each time to
add a new property?—
Reply to this email directly or view it on GitHub
https://github.com/awslabs/aws-sdk-cpp/pull/76/files#r49495151.
|
nice work on this, see my comment above. |
766c6ed to
23b358b
Compare
|
Ok I refactored to what I think you were suggesting, let me know if I misunderstood you or if anything needs to change. I understand that we don't want to use the UploadFileRequest object as a container for data. I'm just a little concerned that we will need to have many overloaded methods to transfer the various attributes to the underlying CreateMultipartUploadRequest and PutObjectRequest objects. I'm just doing it for metadata here but there are many more that aren't supported yet. Thanks! |
There was a problem hiding this comment.
ASSERT_EQ(metadata["key1"], headObjectMetadata["key1"]);
|
Thanks for your work on this! Just a few thoughts. |
ac3baf4 to
50ff929
Compare
|
Thanks for the feedback, I think I addressed them all in this new commit. Regarding putting metadata into the initialization list, I had to make one of the new constructors the default constructor, otherwise, I'd get a |
|
This looks good. I'm going to pull down and run through the test suite. If everything works correctly, I'll merge the request. Thanks for your work on this. |
There was a problem hiding this comment.
Actually, to confirm, I think I also need to wrap metadata here with std::forward? If so, I can adjust this patch.
|
I've added one more instance of |
|
Updated the diff to use |
Add ability to set metadata for object uploads in transfer library.
…rgs to develop * commit '4c7d1c51e4676d068823cd5c48460e610003efbd': Add new args to docker.py functions.
Adding the ability for users of TransferClient to set metadata of objects they are uploading. Let me know if there's anything that needs to change with the new public methods I added here.