You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Andrew Gaul <no...@github.com> on 2015/04/03 02:54:03 UTC
[jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
You can view, comment on, or merge this pull request online at:
https://github.com/jclouds/jclouds/pull/719
-- Commit Summary --
* Allows copying an object and modifying metadata (user and object)
* Adds live test.
* JCLOUDS-651: Copy Swift system metadata
-- File Changes --
M apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/binders/BindMetadataToHeaders.java (6)
M apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java (49)
M apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java (53)
M apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java (81)
M apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiMockTest.java (56)
M blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java (3)
-- Patch Links --
https://github.com/jclouds/jclouds/pull/719.patch
https://github.com/jclouds/jclouds/pull/719.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719
Re: [jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
Posted by Zack Shoylev <no...@github.com>.
Yep, exactly. However, I also wanted to address all the content metadata in general. But. That's a lot of work and affects multiple providers. Some choices:
1. Refactor properly and change the provider/api code as needed. Remove default behavior. Treat all headers the same way, maybe. Get rid of how content- headers work now. Hope for the best.
2. Keep the default behavior but add some options that allow us to modify that behavior from a provider/api, so not all providers are affected. For example a NO_DEFAULT_CONTENT_META property or similar.
3. Other ideas?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719#issuecomment-90239600
Re: [jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
Posted by Andrew Gaul <no...@github.com>.
Agree with your read of the documentation and its attached example, although running without this change I see this failure:
```
testCopyBlobCopyMetadata(org.jclouds.rackspace.cloudfiles.us.blobstore.integration.CloudFilesUSBlobIntegrationLiveTest) Time elapsed: 38.811 sec <<< FAILURE!
java.lang.NullPointerException: null
at org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest.checkContentDisposition(BaseBlobIntegrationTest.java:666)
at org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest.checkContentMetadata(BaseBlobIntegrationTest.java:646)
at org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest.testCopyBlobCopyMetadata(BaseBlobIntegrationTest.java:762)
```
Maybe we are triggering this behavior by accidentally specifying a header which triggers replacement of others?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719#issuecomment-89410619
Re: [jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
Posted by Zack Shoylev <no...@github.com>.
So yeah, I suspect this is catching a bug with how we send the copy request when no options are specified. This arises with how contentmetadata is handled in core jclouds, if i remember correctly.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719#issuecomment-90233223
Re: [jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
Posted by Zack Shoylev <no...@github.com>.
I will get back to this tomorrow if needed, but go ahead and merge if you think it's ready @andrewgaul
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719#issuecomment-89183459
Re: [jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
Posted by Andrew Gaul <no...@github.com>.
@zack-shoylev Perhaps we are hitting one of the consequences of [JCLOUDS-595](https://issues.apache.org/jira/browse/JCLOUDS-595). I investigated removing a default Content-Type but this needs more work:
https://github.com/andrewgaul/jclouds/tree/no-default-content-type
Maybe you would like to pick this up since it enables Swift/CloudFiles to use its auto-detect Content-Type?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719#issuecomment-90235882
Re: [jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
Posted by Zack Shoylev <no...@github.com>.
Have you had a chance to run the live tests? I thought swift copies the metadata and we just need to override it, based on this in the docs:
"All metadata is preserved during the object copy."
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719#issuecomment-89183043
Re: [jclouds] JCLOUDS-651: Copy Swift system metadata (#719)
Posted by Zack Shoylev <no...@github.com>.
I suspect that we send the content metadata headers regardless and overwrite. However, you will not see them in the log
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/719#issuecomment-90232778