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 2022/04/06 11:27:38 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #3277: HDDS-6545. OzoneManagerUtils#getBucketLayout should not suppress bucket key lookup errors.

adoroszlai commented on code in PR #3277:
URL: https://github.com/apache/ozone/pull/3277#discussion_r843822285


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -338,8 +338,8 @@ public OmKeyInfo lookupKey(OmKeyArgs args, String clientAddress)
         bucketName);
 
     BucketLayout bucketLayout =
-        getBucketLayout(metadataManager, args.getVolumeName(),
-            args.getBucketName());
+        OzoneManagerUtils.getBucketLayout(args.getVolumeName(),
+            args.getBucketName(), ozoneManager, new HashSet<>());

Review Comment:
   I have minor code suggestions for this refactoring:
   
   1. Create another `getBucketLayout` method (in `OzoneManagerUtils`) without the `Set<Pair<String, String>> visited` parameter, passing `new HashSet<>()` to the existing `getBucketLayout` method.
   2. Make `OzoneManager` the first param of this new method.
   3. Add static import for `OzoneManagerUtils.getBucketLayout`.
   
   This would make the code more readable and minimize the changes necessary to satisfy line width rules.



-- 
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: issues-unsubscribe@ozone.apache.org

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