marker should be null when there are no more items

This commit is contained in:
Ka-Hing Cheung 2015-07-21 11:43:49 -07:00
parent ed1149141d
commit 2c578d7bcb
3 changed files with 3 additions and 10 deletions

View File

@ -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

View File

@ -53,13 +53,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

View File

@ -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);
}