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 2021/08/09 08:29:50 UTC

[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2502: HDDS-5531. For Link Buckets avoid showing metadata.

bharatviswa504 commented on a change in pull request #2502:
URL: https://github.com/apache/ozone/pull/2502#discussion_r685003941



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/InfoBucketHandler.java
##########
@@ -40,7 +41,56 @@ public void execute(OzoneClient client, OzoneAddress address)
         .getVolume(address.getVolumeName())
         .getBucket(address.getBucketName());
 
-    printObjectAsJson(bucket);
+    if (bucket.getSourceBucket() != null && bucket.getSourceVolume() != null) {
+      printObjectAsJson(new LinkBucket(bucket));
+    } else {
+      printObjectAsJson(bucket);
+    }
+  }
+
+  /**
+   * Class used for link buckets.
+   */
+  private static class LinkBucket {

Review comment:
       It has other fields like quota, storage type etc., for link buckets we created with source bucket/source volume.
   As I do-not want to show any other metadata taken this approach. And also it is for CLI, i don't think it is a costly operation, so we should be fine

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/InfoBucketHandler.java
##########
@@ -40,7 +41,56 @@ public void execute(OzoneClient client, OzoneAddress address)
         .getVolume(address.getVolumeName())
         .getBucket(address.getBucketName());
 
-    printObjectAsJson(bucket);
+    if (bucket.getSourceBucket() != null && bucket.getSourceVolume() != null) {
+      printObjectAsJson(new LinkBucket(bucket));
+    } else {
+      printObjectAsJson(bucket);
+    }
+  }
+
+  /**
+   * Class used for link buckets.
+   */
+  private static class LinkBucket {

Review comment:
       It has other fields like quota, storage type etc., for link buckets we created with source bucket/source volume.
   As I do-not want to show any other metadata taken this approach. And also it is for CLI, i don't think it is a costly operation, so we should be fine IMHO.




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