Search in sources :

Example 1 with S3AsyncWaiter

use of software.amazon.awssdk.services.s3.waiters.S3AsyncWaiter in project flink by apache.

the class AWSServicesTestUtils method createBucket.

public static void createBucket(S3AsyncClient s3Client, String bucketName) throws ExecutionException, InterruptedException {
    CreateBucketRequest bucketRequest = CreateBucketRequest.builder().bucket(bucketName).build();
    s3Client.createBucket(bucketRequest);
    HeadBucketRequest bucketRequestWait = HeadBucketRequest.builder().bucket(bucketName).build();
    try (final S3AsyncWaiter waiter = s3Client.waiter()) {
        waiter.waitUntilBucketExists(bucketRequestWait).get();
    }
}
Also used : S3AsyncWaiter(software.amazon.awssdk.services.s3.waiters.S3AsyncWaiter) HeadBucketRequest(software.amazon.awssdk.services.s3.model.HeadBucketRequest) CreateBucketRequest(software.amazon.awssdk.services.s3.model.CreateBucketRequest)

Aggregations

CreateBucketRequest (software.amazon.awssdk.services.s3.model.CreateBucketRequest)1 HeadBucketRequest (software.amazon.awssdk.services.s3.model.HeadBucketRequest)1 S3AsyncWaiter (software.amazon.awssdk.services.s3.waiters.S3AsyncWaiter)1