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