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/05 06:59:21 UTC

[GitHub] [ozone] bharatviswa504 opened a new pull request #2502: HDDS-5531. For Link Buckets avoid showing metadata.

bharatviswa504 opened a new pull request #2502:
URL: https://github.com/apache/ozone/pull/2502


   ## What changes were proposed in this pull request?
   
   Avoid showing unnecessary metadata for link buckets.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5531
   
   ## How was this patch tested?
   
   Manual test and also updated robot test
   
   bash-4.2$ ozone sh bucket info /linkvol/linkbuck
   ```
   {
     "volumeName" : "linkvol",
     "bucketName" : "linkbuck",
     "sourceVolumeName" : "vol1",
     "sourceBucketName" : "buck1",
     "creationTime" : "2021-08-05T06:51:24.815Z",
     "modificationTime" : "2021-08-05T06:51:24.815Z"
   }
   bash-4.2$ ozone sh bucket info /vol1/buck1
   {
     "metadata" : { },
     "volumeName" : "vol1",
     "name" : "buck1",
     "storageType" : "DISK",
     "versioning" : false,
     "usedBytes" : 0,
     "usedNamespace" : 0,
     "creationTime" : "2021-08-05T06:50:46.936Z",
     "modificationTime" : "2021-08-05T06:50:46.936Z",
     "quotaInBytes" : -1,
     "quotaInNamespace" : -1,
     "bucketLayout" : "LEGACY"
   }
   ```
   


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


[GitHub] [ozone] bharatviswa504 merged pull request #2502: HDDS-5531. For Link Buckets avoid showing metadata.

Posted by GitBox <gi...@apache.org>.
bharatviswa504 merged pull request #2502:
URL: https://github.com/apache/ozone/pull/2502


   


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2502:
URL: https://github.com/apache/ozone/pull/2502#discussion_r685005406



##########
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) {

Review comment:
       Creation of link does not allow if any of them is empty, technically one check should be okay, but it would be better to check both as safe check to be clear I have thought.
   
   Let me know if you still want it only one needs to be checked.




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


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

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2502:
URL: https://github.com/apache/ozone/pull/2502#issuecomment-895043896


   Thank You @avijayanhwx for the review, I have replied to review comments


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


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

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #2502:
URL: https://github.com/apache/ozone/pull/2502#discussion_r684429039



##########
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:
       Just a thought, can we clear the metadata map from the OzoneBucket if it is a link, instead of creating a new class?

##########
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) {

Review comment:
       nit. Do we need to check both bucket and volume != null? Is bucket check alone good enough?




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


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

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2502:
URL: https://github.com/apache/ozone/pull/2502#issuecomment-896197366


   Thank You @avijayanhwx for the review


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