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/05/11 08:56:16 UTC

[GitHub] [ozone] JyotinderSingh commented on a diff in pull request #3395: HDDS-6720. Add a function to get bucket layout info in Request Validators

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