JyotinderSingh commented on code in PR #3395:
URL: https://github.com/apache/ozone/pull/3395#discussion_r870045995
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/validation/ValidationContext.java:
##########
@@ -34,19 +39,36 @@ public interface ValidationContext {
*/
LayoutVersionManager versionManager();
+ /**
+ * Gets the {@link BucketLayout} of the given bucket. In case of a link
bucket
+ * the method returns the layout of the source bucket.
+ *
+ * @return {@link BucketLayout} of the given bucket.
+ */
+ BucketLayout getBucketLayout(String volumeName, String bucketName)
+ throws IOException;
+
/**
* Creates a context object based on the given parameters.
*
* @param versionManager the {@link LayoutVersionManager} of the service
* @return the {@link ValidationContext} specified by the parameters.
*/
- static ValidationContext of(LayoutVersionManager versionManager) {
+ static ValidationContext of(LayoutVersionManager versionManager,
+ OMMetadataManager omMetadataManager) {
return new ValidationContext() {
@Override
public LayoutVersionManager versionManager() {
return versionManager;
}
+
+ @Override
+ public BucketLayout getBucketLayout(String volumeName, String bucketName)
+ throws IOException {
+ return OzoneManagerUtils.getBucketLayout(omMetadataManager, volumeName,
+ bucketName);
Review Comment:
Thanks for the suggestion @rakeshadr, I have added this unit test to the
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]