rakeshadr commented on a change in pull request #2533:
URL: https://github.com/apache/ozone/pull/2533#discussion_r714689092
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAclRequest.java
##########
@@ -146,6 +153,36 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
*/
abstract String getPath();
+ public BucketLayout getBucketLayout(OzoneManager ozoneManager) {
+ BucketLayout bucketLayout = BucketLayout.LEGACY;
+ OmBucketInfo buckInfo = null;
+ try {
+ ObjectParser objectParser = new ObjectParser(getPath(),
+ OzoneManagerProtocolProtos.OzoneObj.ObjectType.KEY);
+
+ String volume = objectParser.getVolume();
+ String bucket = objectParser.getBucket();
+
+ String buckKey =
+ ozoneManager.getMetadataManager().getBucketKey(volume, bucket);
+
+ try {
+ buckInfo =
+ ozoneManager.getMetadataManager().getBucketTable().get(buckKey);
+ if (buckInfo == null) {
+ LOG.error("Bucket not found: {}/{} ", volume, bucket);
+ return BucketLayout.LEGACY;
+ }
+ bucketLayout = buckInfo.getBucketLayout();
+ } catch (IOException e) {
+ LOG.debug("Failed to get the value for the key: " + buckKey);
Review comment:
Please change it to` LOG.error`
`LOG.error("Failed to get bucket for the key: {}", buckKey);`
--
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]