peterxcli commented on code in PR #10138:
URL: https://github.com/apache/ozone/pull/10138#discussion_r3173253050


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketArgs.java:
##########
@@ -151,6 +155,18 @@ public BucketEncryptionKeyInfo 
getBucketEncryptionKeyInfo() {
     return bekInfo;
   }
 
+  public CorsConfiguration getCorsConfiguration() {
+    return corsConfiguration;
+  }
+
+  public boolean hasCorsConfiguration() {
+    return corsConfiguration != null;
+  }
+
+  public boolean shouldClearCorsConfiguration() {

Review Comment:
   nit
   ```suggestion
     public boolean ClearCorsConfiguration() {
   ```



##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java:
##########
@@ -221,10 +231,75 @@ protected void init() {
     // hook method
   }
 
+  protected OzoneBucket getBucket(String bucketName)
+      throws OS3Exception, IOException {
+    OzoneBucket bucket;
+    try {
+      bucket = client.getObjectStore().getS3Bucket(bucketName);
+    } catch (OMException ex) {
+      if (ex.getResult() == ResultCodes.BUCKET_NOT_FOUND
+          || ex.getResult() == ResultCodes.VOLUME_NOT_FOUND) {
+        throw newError(S3ErrorTable.NO_SUCH_BUCKET, bucketName, ex);
+      } else if (ex.getResult() == ResultCodes.INVALID_TOKEN) {
+        throw newError(S3ErrorTable.ACCESS_DENIED,
+            s3Auth.getAccessID(), ex);
+      } else if (ex.getResult() == ResultCodes.PERMISSION_DENIED) {
+        throw newError(S3ErrorTable.ACCESS_DENIED, bucketName, ex);
+      } else if (ex.getResult() == ResultCodes.TIMEOUT ||
+          ex.getResult() == ResultCodes.INTERNAL_ERROR) {
+        throw newError(S3ErrorTable.INTERNAL_ERROR, bucketName, ex);

Review Comment:
   can we reuse existing error handler for get bucket?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to