ArafatKhan2198 commented on code in PR #4764:
URL: https://github.com/apache/ozone/pull/4764#discussion_r1220362730
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java:
##########
@@ -211,10 +223,45 @@ public Response getOpenKeyInfo(
break;
}
}
+ // Populate the clusterSummary map
+ createClusterSummary(clusterSummary);
+
+ openKeyInsightInfo.setClusterSummary(clusterSummary);
+
openKeyInsightInfo.setLastKey(lastKey);
return Response.ok(openKeyInsightInfo).build();
}
+ private void createClusterSummary(Map<String, Object> clusterSummary) {
+ try {
+ long replicatedSizeOpenKey = globalStatsDao.findById(OmTableInsightTask
+ .getReplicatedSizeKeyFromTable(OPEN_KEY_TABLE)).getValue();
+ long replicatedSizeOpenFile = globalStatsDao.findById(OmTableInsightTask
+ .getReplicatedSizeKeyFromTable(OPEN_FILE_TABLE)).getValue();
+ long unreplicatedSizeOpenKey = globalStatsDao.findById(OmTableInsightTask
+ .getUnReplicatedSizeKeyFromTable(OPEN_KEY_TABLE)).getValue();
+ long unreplicatedSizeOpenFile =
globalStatsDao.findById(OmTableInsightTask
+ .getUnReplicatedSizeKeyFromTable(OPEN_FILE_TABLE)).getValue();
+ long openKeyCountForKeyTable = globalStatsDao.findById(OmTableInsightTask
+ .getTableCountKeyFromTable(OPEN_KEY_TABLE)).getValue();
+ long openKeyCountForFileTable =
globalStatsDao.findById(OmTableInsightTask
+ .getTableCountKeyFromTable(OPEN_FILE_TABLE)).getValue();
+
+ // Calculate the total number of open keys
+ clusterSummary.put("totalOpenKeys",
Review Comment:
Done!
--
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]