Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support download latest index metadata from remote #9477

Prev Previous commit
Next Next commit
Fix: correct limit checks for S3Container refactoring
Signed-off-by: bansvaru <bansvaru@amazon.com>
  • Loading branch information
linuxpi committed Sep 2, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit a3345138148e08ba28f3cb762689052a187c3daa
Original file line number Diff line number Diff line change
@@ -362,10 +362,11 @@ public List<BlobMetadata> listBlobsByPrefixInSortedOrder(String blobNamePrefix,
}
String prefix = blobNamePrefix == null ? keyPath : buildKey(blobNamePrefix);
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
return executeListing(clientReference, listObjectsRequest(prefix, limit), limit).stream()
List<BlobMetadata> blobs = executeListing(clientReference, listObjectsRequest(prefix, limit), limit).stream()
.flatMap(listing -> listing.contents().stream())
.map(s3Object -> new PlainBlobMetadata(s3Object.key().substring(keyPath.length()), s3Object.size()))
.collect(Collectors.toList());
return blobs.subList(0, Math.min(limit, blobs.size()));
} catch (final Exception e) {
throw new IOException("Exception when listing blobs by prefix [" + prefix + "]", e);
}
Original file line number Diff line number Diff line change
@@ -227,6 +227,9 @@ default void listBlobsByPrefixInSortedOrder(
BlobNameSortOrder blobNameSortOrder,
ActionListener<List<BlobMetadata>> listener
) {
if (limit < 0) {
throw new IllegalArgumentException("limit should not be a negative value");
}
try {
listener.onResponse(listBlobsByPrefixInSortedOrder(blobNamePrefix, limit, blobNameSortOrder));
} catch (Exception e) {