JyotinderSingh commented on code in PR #3277:
URL: https://github.com/apache/ozone/pull/3277#discussion_r844838758
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerUtils.java:
##########
@@ -121,11 +122,19 @@ public static BucketLayout getBucketLayout(String volName,
}
}
return buckInfo.getBucketLayout();
- } else {
- LOG.error("Bucket not found: {}/{} ", volName, buckName);
- // TODO: Handle bucket validation
}
- return BucketLayout.DEFAULT;
+ LOG.error("Could not get BucketLayout. Volume: {}, Bucket: {} ", volName,
+ buckName);
+ OMMetadataManager omMetadataManager = ozoneManager.getMetadataManager();
+ OmVolumeArgs volumeArgs = omMetadataManager.getVolumeTable()
+ .get(omMetadataManager.getVolumeKey(volName));
+ if (volumeArgs == null) {
+ throw new OMException("Could not get BucketLayout. Volume not found: "
+ + volName, OMException.ResultCodes.VOLUME_NOT_FOUND);
+ }
+ throw new OMException("Could not get BucketLayout." +
Review Comment:
Thank you for the reviews @rakeshadr, I have addressed these points in my
latest patch.
--
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]