ArafatKhan2198 commented on code in PR #4764:
URL: https://github.com/apache/ozone/pull/4764#discussion_r1222656874
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java:
##########
@@ -184,11 +208,11 @@ public Response getOpenKeyInfo(
keyEntityInfo.setSize(omKeyInfo.getDataSize());
keyEntityInfo.setReplicatedSize(omKeyInfo.getReplicatedSize());
keyEntityInfo.setReplicationConfig(omKeyInfo.getReplicationConfig());
- openKeyInsightInfo.setUnreplicatedTotal(
- openKeyInsightInfo.getUnreplicatedTotal() +
+ openKeyInsightInfo.setUnreplicatedDataSize(
+ openKeyInsightInfo.getUnreplicatedDataSize() +
Review Comment:
Corrected the doc! please check!
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java:
##########
@@ -211,10 +235,48 @@ public Response getOpenKeyInfo(
break;
}
}
+ // Populate the clusterSummary map
+ createClusterSummaryForOpenKey(clusterSummary);
+
+ openKeyInsightInfo.setClusterSummary(clusterSummary);
+
openKeyInsightInfo.setLastKey(lastKey);
return Response.ok(openKeyInsightInfo).build();
}
+ private void createClusterSummaryForOpenKey(
+ Map<String, Object> clusterSummary) {
+ 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)));
+
+ // Calculate the total number of open keys
+ clusterSummary.put("totalOpenKeys",
+ openKeyCountForKeyTable + openKeyCountForFileTable);
+ // Calculate the total replicated and unreplicated sizes
+ clusterSummary.put("totalReplicatedDataSize",
Review Comment:
Corrected the doc! please check!
--
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]