devmadhuu commented on code in PR #4923:
URL: https://github.com/apache/ozone/pull/4923#discussion_r1233546330


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java:
##########
@@ -422,6 +429,30 @@ public Response getDeletedKeyInfo(
     return Response.ok(deletedKeyInsightInfo).build();
   }
 
+  /**
+   * Creates a keys summary for deleted keys and updates the provided
+   * keysSummary map. Calculates the total number of deleted keys, replicated
+   * data size, and unreplicated data size.
+   *
+   * @param keysSummary A map to store the keys summary information.
+   */
+  private void createKeysSummaryForDeletedKey(Map<String, Long> keysSummary) {
+    // Fetch the necessary metrics for deleted keys
+    Long replicatedSizeDeleted = getValueFromId(globalStatsDao.findById(
+        OmTableInsightTask.getReplicatedSizeKeyFromTable(DELETED_TABLE)));
+    Long unreplicatedSizeDeleted = getValueFromId(globalStatsDao.findById(
+        OmTableInsightTask.getUnReplicatedSizeKeyFromTable(DELETED_TABLE)));
+    Long deletedKeyCount = getValueFromId(globalStatsDao.findById(
+        OmTableInsightTask.getTableCountKeyFromTable(DELETED_TABLE)));
+
+    // Calculate the total number of deleted keys
+    keysSummary.put("totalDeletedKeys", deletedKeyCount);
+    // Calculate the total replicated and unreplicated sizes
+    keysSummary.put("totalReplicatedDataSize", replicatedSizeDeleted);
+    keysSummary.put("totalUnreplicatedDataSize", unreplicatedSizeDeleted);
+  }
+
+
   private void getPendingForDeletionDirInfo(

Review Comment:
   @ArafatKhan2198  thanks for working on this patch, however I think, we need 
similar summary for this dirs also.



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