Not all data (only 1000 elements) retrieved from S3 using Amazon SDK

Viewed 1836

I have a problem with retrieving the data from S3 using Amazon SDK. The problem is that it retrieves only 1000 elements, while indeed I have 10,000 elements in the aws_bucket_data -> currentDataDirectory. I do not use setMaxKeys(...), so the result seems to be weird.

BasicAWSCredentials credentials = new BasicAWSCredentials("...", "...");
        client = new AmazonS3Client(credentials);

ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
                    .withBucketName(aws_bucket_data)
                    .withPrefix(currentDataDirectory);

ObjectListing objectListing = client.listObjects(listObjectsRequest);

System.out.println(objectListing.getObjectSummaries().size());

How can I solve this problem?

1 Answers
Related