You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Timur Alperovich <no...@github.com> on 2015/07/08 01:40:02 UTC

[jclouds] JCLOUDS-930: Handle subdir entries correctly. (#801)

When listing blobs, Swift returns an array of "subdir" entries for
every common prefix. The openstack-swift provider needs to process
such entries and add them to the result set. The subdir array is an
array of strings, so additional metadata needs to be added to the
objects (bogus ETag, bogus LastModifiedDate, and so on).

When directory marker blobs are used, this means that potential _two_
entries are generated for every directory if:
1. the delimiter is set and matches the directory blob (e.g. dir/ and
   delimiter /)
2. there are objects under the directory name (e.g. dir/blob), which
   will result in results that include common prefixes (subdir)

In the above example, we should expect two results: "dir" and "dir/"
representing the directory marker blob and the common prefix,
respectively.

This is caught in the testDirectory integration test.

The patch changes the behavior of the Swift provider to correctly
handle the results in the subdir stanza and changes the test to expect
the directory marker to be returned in the list.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * JCLOUDS-930: Handle subdir entries correctly.

-- File Changes --

    M apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseObjectListFromResponse.java (12)
    M blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java (4)

-- Patch Links --

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

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/801

Re: [jclouds] JCLOUDS-930: Handle subdir entries correctly. (#801)

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

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

Re: [jclouds] JCLOUDS-930: Handle subdir entries correctly. (#801)

Posted by Andrew Gaul <no...@github.com>.
Pushed to master as 6d27fbb18ac682df4579c98b7c3f3fefe8ca11e6.

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

Re: [jclouds] JCLOUDS-930: Handle subdir entries correctly. (#801)

Posted by Timur Alperovich <no...@github.com>.
The Azure PR will fail in integration tests if merged before this commit (as the change to the test is in this commit).

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

Re: [jclouds] JCLOUDS-930: Handle subdir entries correctly. (#801)

Posted by Andrew Gaul <no...@github.com>.
>           assert container.getNextMarker() == null;
> -         assert container.size() == 1 : container;
> +         assertThat(container.size()).isEqualTo(2);

`assertThat(container).hasSize(2)`

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/801/files#r34104733

Re: [jclouds] JCLOUDS-930: Handle subdir entries correctly. (#801)

Posted by Timur Alperovich <no...@github.com>.
>           assert container.getNextMarker() == null;
> -         assert container.size() == 1 : container;
> +         assertThat(container.size()).isEqualTo(2);

Done

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/801/files#r34106234