You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Andrew Gaul <no...@github.com> on 2013/10/02 02:41:30 UTC

[jclouds] Support exists checks with DreamObjects Swift API (#165)

Swift URLs with container and blob name take these forms:

    https://region-a.geo-1.objects.hpcloudsvc.com/v1/account/container/blob
    https://objects.dreamhost.com/swift/v1/container/blob

ParseSwiftErrorFromHttpResponse is too specific in this case; instead
interpret 404 errors directly via FalseOn404.
You can merge this Pull Request by running:

  git pull https://github.com/maginatics/jclouds dreamobjects-swift-blob-container-exits

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds/pull/165

-- Commit Summary --

  * Support exists checks with DreamObjects Swift API

-- File Changes --

    M apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java (6)
    M blobstore/src/main/java/org/jclouds/blobstore/BlobStoreFallbacks.java (12)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/165.patch
https://github.com/jclouds/jclouds/pull/165.diff

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Everett Toews <no...@github.com>.
During release week we like to do a little house cleaning in the jclouds world. That means sweeping out the pull request queue.

This PR is over 6 months old. Please update us on its status here. If we don't hear anything, we will take that as lazy consensus that the PR is no longer relevant and it will be closed on Friday, May 30. 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-44345044

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Phillips <no...@github.com>.
@andrewgaul: ping? Something to try to get in for 1.7.0?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-30170255

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Phillips <no...@github.com>.
@andrewgaul: Thoughts on the proposed Javadoc update? Could you include that in this PR?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-27156416

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Adrian Cole <no...@github.com>.
As this is effectively an on the way out codebase, and the replacement
"openstack-swift" doesnt try to split the difference of object doesnt exist
vs container...

Id punt to gaul... and in absence say 404 means the object was not found,
and this could be on account of a missing container.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25626777

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Phillips <no...@github.com>.
>  I think BaseBlobIntergrationTest is the one.

>From what I can see, `objectExists` is actually only defined in [CommonSwiftClient](https://github.com/jclouds/jclouds/blob/master/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java#L121); it's not a BlobStore method. `blobExists` seems like the closest relative [in BlobStore](https://github.com/jclouds/jclouds/blob/master/blobstore/src/main/java/org/jclouds/blobstore/BlobStore.java#L185), but I don't think it has the same contract regarding exceptions.

[CommonSwiftClientTest](https://github.com/jclouds/jclouds/blob/master/apis/swift/src/test/java/org/jclouds/openstack/swift/CommonSwiftClientTest.java)?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25612090

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Phillips <no...@github.com>.
> and in absence say 404 means the object was not found, and this could be on account of a missing container.

Note that, in that case, we should update the Javadoc for `objectExists`, which currently describes the [`@throws ContainerNotFound` behaviour](https://github.com/jclouds/jclouds/blob/master/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java#L118)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25678777

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #263](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/263/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25505896

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Phillips <no...@github.com>.
> Or will we need to distinguish between KeyNotFoundException and ContainerNotFoundException

E.g. currently, if `objectExists` results in a ContainerNotFoundException (rather than a KeyNotFoundException), the exception would currently be thrown (since only a KNFE would trigger the fallback), as far as I can see. This change would return false on _every_ 404 - is this a change in behaviour that could matter?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25529817

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Phillips <no...@github.com>.
Am I understanding this correctly: we're bypassing ParseSwiftErrorFromHttpResponse because the DreamObjects pattern `/v1/container/blob` does not match the standard (?) Swift pattern `/v1/account/container/blob`?

Does it make sense to have special-case logic for these two calls only (I guess that was your question, @andrewgaul?) Or will we need to distinguish between KeyNotFoundException and ContainerNotFoundException (which the ParseSwiftErrorFromHttpResponse does, as far as I can see) for DreamObjects somewhere?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25529726

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Phillips <no...@github.com>.
> Id punt to gaul... and in absence say 404 means the object was not found, and this could be on account of a 
> missing container.

Certainly works for me... @andrewgaul: any areas you're aware of where the different behaviour could cause problems?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25632531

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Gaul <no...@github.com>.
I can no longer test this and will close the PR.  @shrinandj please resubmit if you have interest in DreamObjects support.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-44345556

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Gaul <no...@github.com>.
Unsure if we should follow this approach or loosen parsing strictness in ParseSwiftErrorFromHttpResponse.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25504947

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Adrian Cole <no...@github.com>.
Good point.   We should add a live test that container not found throws an
exception.  @demobox want to do the honors?  I think
BaseBlobIntergrationTest is the one.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25544789

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #724](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/724/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25505898

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Adrian Cole <no...@github.com>.
404 makes sense here.

+1

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-25506800

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Gaul <no...@github.com>.
Closed #165.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#event-125337843

Re: [jclouds] Support exists checks with DreamObjects Swift API (#165)

Posted by Andrew Gaul <no...@github.com>.
@demobox will look at after 1.7.0 release.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/165#issuecomment-30705905