You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/05/11 15:12:12 UTC

[GitHub] [ozone] symious commented on a change in pull request #2198: HDDS-5167. Add clean option for Freon randomkeys to clean generated objects

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org