Repository: jclouds Updated Branches: refs/heads/swift/null-marker-for-end-of-list [created] 2c578d7bc
marker should be null when there are no more items Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/2c578d7b Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/2c578d7b Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/2c578d7b Branch: refs/heads/swift/null-marker-for-end-of-list Commit: 2c578d7bcb2e5a2703fc9bed4a7d1bd8a7d16344 Parents: ed11491 Author: Ka-Hing Cheung <[email protected]> Authored: Tue Jul 21 11:43:49 2015 -0700 Committer: Ka-Hing Cheung <[email protected]> Committed: Tue Jul 21 15:46:58 2015 -0700 ---------------------------------------------------------------------- .../swift/v1/blobstore/RegionScopedSwiftBlobStore.java | 4 +--- .../integration/SwiftContainerIntegrationLiveTest.java | 7 ------- .../integration/internal/BaseContainerIntegrationTest.java | 2 ++ 3 files changed, 3 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds/blob/2c578d7b/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java ---------------------------------------------------------------------- diff --git a/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java b/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java index 0049de7..fa1f41b 100644 --- a/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java +++ b/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java @@ -206,9 +206,7 @@ public class RegionScopedSwiftBlobStore implements BlobStore { List<? extends StorageMetadata> list = transform(objects, toBlobMetadata(container)); int limit = Optional.fromNullable(options.getMaxResults()).or(10000); String marker = null; - if (list.isEmpty()) { - marker = options.getMarker(); - } else if (list.size() == limit) { + if (!list.isEmpty() && list.size() == limit) { marker = list.get(limit - 1).getName(); } // TODO: we should probably deprecate this option http://git-wip-us.apache.org/repos/asf/jclouds/blob/2c578d7b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/integration/SwiftContainerIntegrationLiveTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/integration/SwiftContainerIntegrationLiveTest.java b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/integration/SwiftContainerIntegrationLiveTest.java index 67e9c7a..fc8746b 100644 --- a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/integration/SwiftContainerIntegrationLiveTest.java +++ b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/integration/SwiftContainerIntegrationLiveTest.java @@ -54,13 +54,6 @@ public class SwiftContainerIntegrationLiveTest extends BaseContainerIntegrationT } @Override - public void testDelimiter() { - // Swift does not return the last marker when listing, which breaks the testDelimiter test. One more query would - // need to be made for Swift (using the latest object and getting no results back). - throw new SkipException("The test fails for Swift, as it requires one more request"); - } - - @Override public void testDirectory() { // The test fails with swift, where the marker blob for the directory is removed, as part of the call to // clearContainer http://git-wip-us.apache.org/repos/asf/jclouds/blob/2c578d7b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java ---------------------------------------------------------------------- diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java index 832848d..6fc9ee9 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java @@ -187,6 +187,8 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { container); assert container.getNextMarker() == null; + container = view.getBlobStore().list(containerName, afterMarker("z")); + assertThat(container.getNextMarker()).isNull(); } finally { returnContainer(containerName); }
