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();
}
}
Aggregations