sravani-revuri commented on code in PR #12169:
URL: https://github.com/apache/ozone/pull/12169#discussion_r4785980120


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/OBSBucketHandler.java:
##########
@@ -133,7 +133,7 @@ public long handleDirectKeys(long parentId, boolean 
withReplica,
         if (keyInfo != null) {
           DUResponse.DiskUsage diskUsage = new DUResponse.DiskUsage();
           String objectName = keyInfo.getKeyName();
-          diskUsage.setSubpath(objectName);
+          diskUsage.setSubpath(buildSubpath(normalizedPath, objectName));

Review Comment:
   Added the test but i think KEY_NINE in Legacy buckets fails. the key is only 
slashes. 
   du /vol2/flatleg////// returns 24 bytes (whole bucket) instead of 8 because 
of how EntityHandler normalizes this. The test currently skips files like this. 
is this something we should handle as a follow up/before this? or is this the 
intended behaviour?
   
   ### vol + buck space
   
   ```
   bash-5.1$ ozone admin namespace du -f /vol2/flatleg
   Connecting to Recon: 
http://recon:9888/api/v1/namespace/usage?path=/vol2/flatleg&files=true ...
   Path : /vol2/flatleg
   Total Size : 24 bytes
   
   DU
     Size      Path Name
     8 bytes   /vol2/flatleg//////
     8 bytes   /vol2/flatleg/file8
     8 bytes   /vol2/flatleg/file9
   ```
   
   ### key space whose name is only slashes
   ```
   bash-5.1$ ozone admin namespace du /vol2/flatleg//////
   Connecting to Recon: 
http://recon:9888/api/v1/namespace/usage?path=/vol2/flatleg////// ...
   
   Path : /vol2/flatleg//////
   Total Size : 24 bytes
   Size of Direct Keys : 24 bytes
   
   There's no immediate sub-path under this object.
   Add -f as an option to visualize files as sub-path, if any.
   ```
   
   ### another normal key in same path
   ```
   bash-5.1$ ozone admin namespace du /vol2/flatleg/file8
   Connecting to Recon: 
http://recon:9888/api/v1/namespace/usage?path=/vol2/flatleg/file8 ...
   
   Path : /vol2/flatleg/file8
   Total Size : 8 bytes
   
   There's no immediate sub-path under this object.
   Add -f as an option to visualize files as sub-path, if any.
   ```



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

Reply via email to