ArafatKhan2198 commented on code in PR #4764:
URL: https://github.com/apache/ozone/pull/4764#discussion_r1231523620
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java:
##########
@@ -211,10 +236,53 @@ public Response getOpenKeyInfo(
break;
}
}
+ // Populate the keysSummary map
+ createKeysSummaryForOpenKey(keysSummary);
+
+ openKeyInsightInfo.setKeysSummary(keysSummary);
+
openKeyInsightInfo.setLastKey(lastKey);
return Response.ok(openKeyInsightInfo).build();
}
+ /**
+ * Creates a keys summary for open keys and updates the provided
+ * keysSummary map. Calculates the total number of open keys, replicated
+ * data size, and unreplicated data size.
+ *
+ * @param keysSummary A map to store the keys summary information.
+ */
+ private void createKeysSummaryForOpenKey(
+ Map<String, Object> keysSummary) {
+ Long replicatedSizeOpenKey = getValueFromId(globalStatsDao.findById(
+ OmTableInsightTask.getReplicatedSizeKeyFromTable(OPEN_KEY_TABLE)));
+ Long replicatedSizeOpenFile = getValueFromId(globalStatsDao.findById(
+ OmTableInsightTask.getReplicatedSizeKeyFromTable(OPEN_FILE_TABLE)));
+ Long unreplicatedSizeOpenKey = getValueFromId(globalStatsDao.findById(
+ OmTableInsightTask.getUnReplicatedSizeKeyFromTable(OPEN_KEY_TABLE)));
+ Long unreplicatedSizeOpenFile = getValueFromId(globalStatsDao.findById(
+ OmTableInsightTask.getUnReplicatedSizeKeyFromTable(OPEN_FILE_TABLE)));
+ Long openKeyCountForKeyTable = getValueFromId(globalStatsDao.findById(
+ OmTableInsightTask.getTableCountKeyFromTable(OPEN_KEY_TABLE)));
+ Long openKeyCountForFileTable = getValueFromId(globalStatsDao.findById(
+ OmTableInsightTask.getTableCountKeyFromTable(OPEN_FILE_TABLE)));
Review Comment:
I believe a separate jira would be better!
--
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]