list MPU parts with prefix listing instead of marker

we now use segment conventions that allow us to do more
efficient listing
This commit is contained in:
Ka-Hing Cheung 2015-06-23 18:26:53 -07:00 committed by Andrew Gaul
parent 38fa41d056
commit e0bafd4c10
1 changed files with 1 additions and 4 deletions

View File

@ -477,12 +477,9 @@ public class RegionScopedSwiftBlobStore implements BlobStore {
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) {
ImmutableList.Builder<MultipartPart> parts = ImmutableList.builder();
PageSet<? extends StorageMetadata> pageSet = list(mpu.containerName(),
new ListContainerOptions().afterMarker(mpu.blobName() + '/').recursive());
new ListContainerOptions().inDirectory(mpu.blobName()).recursive());
// TODO: pagination
for (StorageMetadata sm : pageSet) {
if (!sm.getName().startsWith(mpu.blobName() + '/')) {
break;
}
int lastSlash = sm.getName().lastIndexOf('/');
int partNumber = Integer.parseInt(sm.getName().substring(lastSlash + 1));
parts.add(MultipartPart.create(partNumber, sm.getSize(), sm.getETag()));