ArafatKhan2198 commented on code in PR #5037:
URL: https://github.com/apache/ozone/pull/5037#discussion_r1258701081


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java:
##########
@@ -179,6 +200,40 @@ private Triple<Long, Long, Long> getTableSizeAndCount(
     return Triple.of(count, unReplicatedSize, replicatedSize);
   }
 
+  /**
+   * Fetches the size of a deleted directory identified by the given path.
+   * The size is obtained from the NSSummary table using the directory 
objectID.
+   * The path is expected to be in the format :-
+   * "volumeId/bucketId/parentId/dirName/dirObjectId".
+   *
+   * @param path             The path of the deleted directory.
+   * @return The size of the deleted directory.
+   * @throws IOException If an I/O error occurs while retrieving the size.
+   */
+  public long fetchSizeForDeletedDirectory(String path)
+      throws IOException {
+    if (path == null || path.isEmpty()) {
+      return 0L;
+    }
+    String[] parts = path.split("/");
+    String directoryObjectId = parts.length >= 6 ? parts[5] : "";

Review Comment:
   I have also verified the path from the `OmMetadataManagerImpl` clas where 
the formats of all the OM tables are mentioned :- 
   
![image](https://github.com/apache/ozone/assets/98023601/9cc39276-9767-4c39-ace3-d561c9a363a9)
   



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