symious commented on a change in pull request #2198:
URL: https://github.com/apache/ozone/pull/2198#discussion_r630267113
##########
File path:
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -406,6 +432,24 @@ public void ensureVolumeExists(
} catch (OMException ex) {
if (ex.getResult() == ResultCodes.VOLUME_NOT_FOUND) {
rpcClient.getObjectStore().createVolume(volumeName);
+ volumeCreated = true;
+ } else {
+ throw ex;
+ }
+ }
+ }
+
+ /**
+ * Create missing target bucket for S3KeyGenerator.
+ */
+ public void ensureBucketExist(AmazonS3 s3, String bucketName) {
+ HeadBucketRequest headBucketRequest = new HeadBucketRequest(bucketName);
+ try {
+ s3.headBucket(headBucketRequest);
+ } catch (AmazonServiceException ex) {
+ if (ex.getErrorCode().equals("NoSuchBucket")) {
+ s3.createBucket(bucketName);
+ setBucketCreated();
Review comment:
Removed S3 code from `baseFreonGenerator`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]